Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/ipf Oh, wow. Loads of broken ipf test cases that went...
details: https://anonhg.NetBSD.org/src/rev/0340ed32420f
branches: trunk
changeset: 758109:0340ed32420f
user: jmmv <jmmv%NetBSD.org@localhost>
date: Tue Oct 19 16:36:36 2010 +0000
description:
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.
diffstat:
tests/ipf/h_common.sh | 6 +++---
tests/ipf/t_bpf.sh | 6 +++---
tests/ipf/t_filter_exec.sh | 12 ++++++------
tests/ipf/t_filter_parse.sh | 8 ++++----
tests/ipf/t_logging.sh | 4 ++--
tests/ipf/t_nat_exec.sh | 6 +++---
tests/ipf/t_nat_ipf_exec.sh | 8 ++++----
tests/ipf/t_nat_parse.sh | 6 +++---
tests/ipf/t_pools.sh | 6 +++---
9 files changed, 31 insertions(+), 31 deletions(-)
diffs (273 lines):
diff -r 425d38569cfa -r 0340ed32420f tests/ipf/h_common.sh
--- a/tests/ipf/h_common.sh Tue Oct 19 15:40:15 2010 +0000
+++ b/tests/ipf/h_common.sh Tue Oct 19 16:36:36 2010 +0000
@@ -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}' " "${@}" "; \
}"
}
diff -r 425d38569cfa -r 0340ed32420f tests/ipf/t_bpf.sh
--- a/tests/ipf/t_bpf.sh Tue Oct 19 15:40:15 2010 +0000
+++ b/tests/ipf/t_bpf.sh Tue Oct 19 16:36:36 2010 +0000
@@ -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
diff -r 425d38569cfa -r 0340ed32420f tests/ipf/t_filter_exec.sh
--- a/tests/ipf/t_filter_exec.sh Tue Oct 19 15:40:15 2010 +0000
+++ b/tests/ipf/t_filter_exec.sh Tue Oct 19 16:36:36 2010 +0000
@@ -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
diff -r 425d38569cfa -r 0340ed32420f tests/ipf/t_filter_parse.sh
--- a/tests/ipf/t_filter_parse.sh Tue Oct 19 15:40:15 2010 +0000
+++ b/tests/ipf/t_filter_parse.sh Tue Oct 19 16:36:36 2010 +0000
@@ -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
diff -r 425d38569cfa -r 0340ed32420f tests/ipf/t_logging.sh
--- a/tests/ipf/t_logging.sh Tue Oct 19 15:40:15 2010 +0000
+++ b/tests/ipf/t_logging.sh Tue Oct 19 16:36:36 2010 +0000
@@ -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
diff -r 425d38569cfa -r 0340ed32420f tests/ipf/t_nat_exec.sh
--- a/tests/ipf/t_nat_exec.sh Tue Oct 19 15:40:15 2010 +0000
+++ b/tests/ipf/t_nat_exec.sh Tue Oct 19 16:36:36 2010 +0000
@@ -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 \
diff -r 425d38569cfa -r 0340ed32420f tests/ipf/t_nat_ipf_exec.sh
--- a/tests/ipf/t_nat_ipf_exec.sh Tue Oct 19 15:40:15 2010 +0000
+++ b/tests/ipf/t_nat_ipf_exec.sh Tue Oct 19 16:36:36 2010 +0000
@@ -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
;;
diff -r 425d38569cfa -r 0340ed32420f tests/ipf/t_nat_parse.sh
--- a/tests/ipf/t_nat_parse.sh Tue Oct 19 15:40:15 2010 +0000
+++ b/tests/ipf/t_nat_parse.sh Tue Oct 19 16:36:36 2010 +0000
@@ -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
diff -r 425d38569cfa -r 0340ed32420f tests/ipf/t_pools.sh
--- a/tests/ipf/t_pools.sh Tue Oct 19 15:40:15 2010 +0000
+++ b/tests/ipf/t_pools.sh Tue Oct 19 16:36:36 2010 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index