Module Name: src Committed By: jmmv Date: Tue Oct 19 16:36:37 UTC 2010
Modified Files: src/tests/ipf: h_common.sh t_bpf.sh t_filter_exec.sh t_filter_parse.sh t_logging.sh t_nat_exec.sh t_nat_ipf_exec.sh t_nat_parse.sh t_pools.sh Log Message: Oh, wow. Loads of broken ipf test cases that went unnoticed because they were unchecked errors. Fix them. These have been caught by the upcoming version of atf, which explicitly does 'set -e' in shell test programs. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/ipf/h_common.sh src/tests/ipf/t_bpf.sh \ src/tests/ipf/t_filter_exec.sh src/tests/ipf/t_filter_parse.sh \ src/tests/ipf/t_logging.sh src/tests/ipf/t_nat_exec.sh \ src/tests/ipf/t_nat_ipf_exec.sh src/tests/ipf/t_nat_parse.sh \ src/tests/ipf/t_pools.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/ipf/h_common.sh diff -u src/tests/ipf/h_common.sh:1.1 src/tests/ipf/h_common.sh:1.2 --- src/tests/ipf/h_common.sh:1.1 Sat Jul 10 17:28:36 2010 +++ src/tests/ipf/h_common.sh Tue Oct 19 16:36:36 2010 @@ -1,4 +1,4 @@ -# $NetBSD: h_common.sh,v 1.1 2010/07/10 17:28:36 jmmv Exp $ +# $NetBSD: h_common.sh,v 1.2 2010/10/19 16:36:36 jmmv Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -50,7 +50,7 @@ atf_set use.fs true; \ }" eval "${name}_body() { \ - ${check_function} '${name}' \"\...@}\"; \ + ${check_function} '${name}' " "$...@}" "; \ }" } @@ -65,6 +65,6 @@ }" eval "${name}_body() { \ atf_skip 'This test case is probably broken'; \ - ${check_function} '${name}' \"\...@}\"; \ + ${check_function} '${name}' " "$...@}" "; \ }" } Index: src/tests/ipf/t_bpf.sh diff -u src/tests/ipf/t_bpf.sh:1.1 src/tests/ipf/t_bpf.sh:1.2 --- src/tests/ipf/t_bpf.sh:1.1 Sat Jul 10 17:28:36 2010 +++ src/tests/ipf/t_bpf.sh Tue Oct 19 16:36:36 2010 @@ -1,4 +1,4 @@ -# $NetBSD: t_bpf.sh,v 1.1 2010/07/10 17:28:36 jmmv Exp $ +# $NetBSD: t_bpf.sh,v 1.2 2010/10/19 16:36:36 jmmv Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -30,7 +30,7 @@ # See the IPFILTER.LICENCE file for details on licencing. # -h_itest() +itest() { h_copydata $1 @@ -44,7 +44,7 @@ esac } -h_bpftest() +bpftest() { h_copydata $(echo ${1} | tr _ .) cp "$(atf_get_srcdir)/input/$(echo ${1} | sed s,bpf_,,)" in Index: src/tests/ipf/t_filter_exec.sh diff -u src/tests/ipf/t_filter_exec.sh:1.1 src/tests/ipf/t_filter_exec.sh:1.2 --- src/tests/ipf/t_filter_exec.sh:1.1 Sat Jul 10 17:28:36 2010 +++ src/tests/ipf/t_filter_exec.sh Tue Oct 19 16:36:36 2010 @@ -1,4 +1,4 @@ -# $NetBSD: t_filter_exec.sh,v 1.1 2010/07/10 17:28:36 jmmv Exp $ +# $NetBSD: t_filter_exec.sh,v 1.2 2010/10/19 16:36:36 jmmv Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -30,20 +30,20 @@ # See the IPFILTER.LICENCE file for details on licencing. # -h_dotest() +dotest() { h_copydata $1 { while read rule; do atf_check -x "echo \"$rule\" | ipftest -F \ -$2 -Rbr - -i in $4 >>out" +$2 -Rbr - -i in $4 $5 >>out" echo "--------" >>out done; } <reg diff -u exp out || atf_fail "results differ" } -h_mtest() +mtest() { h_copydata $1 @@ -53,7 +53,7 @@ diff -u exp out || atf_fail "results differ" } -h_dotest6() +dotest6() { h_copydata $(echo ${1} | tr _ .) @@ -88,7 +88,7 @@ test_case f16 mtest text text test_case f17 mtest hex hex test_case f18 mtest text text -test_case f19 dotest text text -T fr_statemax=3 +broken_test_case f19 dotest text text -T fr_statemax=3 test_case f20 mtest text text test_case f24 mtest hex text test_case ipv6_1 dotest6 hex hex Index: src/tests/ipf/t_filter_parse.sh diff -u src/tests/ipf/t_filter_parse.sh:1.1 src/tests/ipf/t_filter_parse.sh:1.2 --- src/tests/ipf/t_filter_parse.sh:1.1 Sat Jul 10 17:28:36 2010 +++ src/tests/ipf/t_filter_parse.sh Tue Oct 19 16:36:36 2010 @@ -1,4 +1,4 @@ -# $NetBSD: t_filter_parse.sh,v 1.1 2010/07/10 17:28:36 jmmv Exp $ +# $NetBSD: t_filter_parse.sh,v 1.2 2010/10/19 16:36:36 jmmv Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -30,7 +30,7 @@ # See the IPFILTER.LICENCE file for details on licencing. # -h_itest() +itest() { h_copydata $1 @@ -44,7 +44,7 @@ esac } -h_itest_i19() +itest_i19() { cp "$(atf_get_srcdir)/expected/i19.dist" . @@ -80,7 +80,7 @@ /bin/rm i19.p? mv i19 exp - h_itest "$@" + itest "$@" } test_case i1 itest text ipf Index: src/tests/ipf/t_logging.sh diff -u src/tests/ipf/t_logging.sh:1.1 src/tests/ipf/t_logging.sh:1.2 --- src/tests/ipf/t_logging.sh:1.1 Sat Jul 10 17:28:36 2010 +++ src/tests/ipf/t_logging.sh Tue Oct 19 16:36:36 2010 @@ -1,4 +1,4 @@ -# $NetBSD: t_logging.sh,v 1.1 2010/07/10 17:28:36 jmmv Exp $ +# $NetBSD: t_logging.sh,v 1.2 2010/10/19 16:36:36 jmmv Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -30,7 +30,7 @@ # See the IPFILTER.LICENCE file for details on licencing. # -h_logtest() +logtest() { h_copydata $1 cp $(atf_get_srcdir)/expected/$1.b exp.b Index: src/tests/ipf/t_nat_exec.sh diff -u src/tests/ipf/t_nat_exec.sh:1.1 src/tests/ipf/t_nat_exec.sh:1.2 --- src/tests/ipf/t_nat_exec.sh:1.1 Sat Jul 10 17:28:36 2010 +++ src/tests/ipf/t_nat_exec.sh Tue Oct 19 16:36:36 2010 @@ -1,4 +1,4 @@ -# $NetBSD: t_nat_exec.sh,v 1.1 2010/07/10 17:28:36 jmmv Exp $ +# $NetBSD: t_nat_exec.sh,v 1.2 2010/10/19 16:36:36 jmmv Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -30,7 +30,7 @@ # See the IPFILTER.LICENCE file for details on licencing. # -h_nattest() +nattest() { h_copydata $1 @@ -40,7 +40,7 @@ format="-F $2" fi - format="$4 $format" + format="$4 $5 $format" { while read rule; do atf_check -o save:save -x \ Index: src/tests/ipf/t_nat_ipf_exec.sh diff -u src/tests/ipf/t_nat_ipf_exec.sh:1.1 src/tests/ipf/t_nat_ipf_exec.sh:1.2 --- src/tests/ipf/t_nat_ipf_exec.sh:1.1 Sat Jul 10 17:28:36 2010 +++ src/tests/ipf/t_nat_ipf_exec.sh Tue Oct 19 16:36:36 2010 @@ -1,4 +1,4 @@ -# $NetBSD: t_nat_ipf_exec.sh,v 1.1 2010/07/10 17:28:36 jmmv Exp $ +# $NetBSD: t_nat_ipf_exec.sh,v 1.2 2010/10/19 16:36:36 jmmv Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -30,7 +30,7 @@ # See the IPFILTER.LICENCE file for details on licencing. # -h_natipftest() +natipftest() { h_copydata $1 cp $(atf_get_srcdir)/regress/$1.nat nat @@ -46,13 +46,13 @@ single) { while read rule; do atf_check -o save:save -x "echo \"$rule\" | \ -ipftest -R $5 $format -b -r ipf -N - -i in" +ipftest -R $5 $6 $format -b -r ipf -N - -i in" cat save >>out echo "-------------------------------" >>out done; } <nat ;; multi) - atf_check -o save:out ipftest -R $5 \ + atf_check -o save:out ipftest -R $5 $6 \ $format -b -r ipf -N nat -i in echo "-------------------------------" >>out ;; Index: src/tests/ipf/t_nat_parse.sh diff -u src/tests/ipf/t_nat_parse.sh:1.1 src/tests/ipf/t_nat_parse.sh:1.2 --- src/tests/ipf/t_nat_parse.sh:1.1 Sat Jul 10 17:28:36 2010 +++ src/tests/ipf/t_nat_parse.sh Tue Oct 19 16:36:36 2010 @@ -1,4 +1,4 @@ -# $NetBSD: t_nat_parse.sh,v 1.1 2010/07/10 17:28:36 jmmv Exp $ +# $NetBSD: t_nat_parse.sh,v 1.2 2010/10/19 16:36:36 jmmv Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -30,7 +30,7 @@ # See the IPFILTER.LICENCE file for details on licencing. # -h_intest() +intest() { h_copydata $1 @@ -38,7 +38,7 @@ } test_case in1 intest text text -test_case in2 intest text text +broken_test_case in2 intest text text test_case in3 intest text text test_case in4 intest text text test_case in5 intest text text Index: src/tests/ipf/t_pools.sh diff -u src/tests/ipf/t_pools.sh:1.1 src/tests/ipf/t_pools.sh:1.2 --- src/tests/ipf/t_pools.sh:1.1 Sat Jul 10 17:28:36 2010 +++ src/tests/ipf/t_pools.sh Tue Oct 19 16:36:36 2010 @@ -1,4 +1,4 @@ -# $NetBSD: t_pools.sh,v 1.1 2010/07/10 17:28:36 jmmv Exp $ +# $NetBSD: t_pools.sh,v 1.2 2010/10/19 16:36:36 jmmv Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -30,7 +30,7 @@ # See the IPFILTER.LICENCE file for details on licencing. # -h_iptest() +iptest() { h_copydata $1 mkdir input @@ -39,7 +39,7 @@ atf_check -o file:exp -e ignore ippool -f reg -nRv } -h_ptest() +ptest() { h_copydata $1 cp $(atf_get_srcdir)/regress/$1.pool pool 2>/dev/null