diff options
author | Phil Sutter <phil@nwl.cc> | 2023-03-05 12:46:49 +0100 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2023-03-10 13:16:51 +0100 |
commit | 844f591866865e1d6ff0066e93123458a46b1caf (patch) | |
tree | 8eb00dce7bf5fa4eafc385f104b3192836c8180f /tests/xlate/runtest.sh | |
parent | 621f3a27d058d1e2e3e884fa70503e2de5b6c742 (diff) | |
download | ipset-844f591866865e1d6ff0066e93123458a46b1caf.tar.gz |
tests: xlate: Make test input valid
Make sure ipset at least accepts the test input by running it against
plain ipset once for sanity. This exposed two issues:
* Set 'hip5' doesn't have comment support, so add the commented elements
to 'hip6' instead (likely a typo).
* Set 'bip1' range 2.0.0.1-2.1.0.1 exceeds the max allowed for bitmap
sets. Reduce it accordingly.
Fixes: 7587d1c4b5465 ("tests: add tests ipset to nftables")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'tests/xlate/runtest.sh')
-rwxr-xr-x | tests/xlate/runtest.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/xlate/runtest.sh b/tests/xlate/runtest.sh index 6a2f80c..8b42f0b 100755 --- a/tests/xlate/runtest.sh +++ b/tests/xlate/runtest.sh @@ -6,8 +6,18 @@ if [ ! -x "$DIFF" ] ; then exit 1 fi +ipset=${IPSET_BIN:-../../src/ipset} ipset_xlate=${IPSET_XLATE_BIN:-$(dirname $0)/ipset-translate} +$ipset restore < xlate.t +rc=$? +$ipset destroy +if [ $rc -ne 0 ] +then + echo -e "[\033[0;31mERROR\033[0m] invalid test input" + exit 1 +fi + TMP=$(mktemp) $ipset_xlate restore < xlate.t &> $TMP if [ $? -ne 0 ] |