Implement iptables forward manager core
This commit is contained in:
34
tests/run_all.sh
Normal file
34
tests/run_all.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
SKIP_INTEGRATION=0
|
||||
|
||||
for arg in "$@"; do
|
||||
case ${arg} in
|
||||
--skip-integration)
|
||||
SKIP_INTEGRATION=1
|
||||
;;
|
||||
*)
|
||||
printf '未知参数: %s\n' "${arg}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
run_test() {
|
||||
local file=$1
|
||||
printf '\n==> 运行 %s\n' "$(basename -- "${file}")"
|
||||
bash "${file}"
|
||||
}
|
||||
|
||||
run_test "${ROOT_DIR}/tests/test_common.sh"
|
||||
run_test "${ROOT_DIR}/tests/test_storage.sh"
|
||||
run_test "${ROOT_DIR}/tests/test_env_check.sh"
|
||||
run_test "${ROOT_DIR}/tests/test_rules_unit.sh"
|
||||
|
||||
if [[ ${SKIP_INTEGRATION} == 0 ]]; then
|
||||
run_test "${ROOT_DIR}/tests/test_integration.sh"
|
||||
fi
|
||||
|
||||
printf '\n全部测试完成。\n'
|
||||
Reference in New Issue
Block a user