Files
IPTables-Management/tests/test_cli.sh
2026-04-17 09:41:45 +08:00

15 lines
591 B
Bash

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
# shellcheck source=tests/lib/assert.sh
source "${ROOT_DIR}/tests/lib/assert.sh"
help_output=$("${ROOT_DIR}/iptables-forward.sh" --help)
assert_contains "${help_output}" '--batch add <proto> <listen_port> <target_ip> <target_port> <ipver> [desc]' 'main script help should describe batch add'
install_help=$("${ROOT_DIR}/install.sh" --help)
assert_contains "${install_help}" '仅创建符号链接,不复制源码。' 'install help should explain symlink behavior'
pass 'test_cli.sh'