etc/protocols - sync with NetBSD-8
[minix.git] / tests / ipf / t_filter_parse.sh
bloba253088a93c38a883b23f7d255360e3e1f9e3c07
1 # $NetBSD: t_filter_parse.sh,v 1.12 2014/12/06 19:31:25 dholland Exp $
3 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
4 # All rights reserved.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
15 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 # POSSIBILITY OF SUCH DAMAGE.
28 # (C)opyright 1993-1996 by Darren Reed.
30 # See the IPFILTER.LICENCE file for details on licencing.
33 itest()
35 h_copydata $1
37 case $3 in
38 ipf)
39 atf_check -o file:exp -e ignore ipf -Rnvf reg
41 ipftest)
42 atf_check -o file:exp ipftest -D -r reg -i /dev/null
44 esac
47 itest_i19()
49 cp "$(atf_get_srcdir)/expected/i19.dist" .
51 if [ "`grep LOG_SECURITY /usr/include/sys/syslog.h 2>&1`" = "" ] ; then
52 if [ "`grep LOG_AUDIT /usr/include/sys/syslog.h 2>&1`" = "" ] ; then
53 sed -e 's/security/!!!/g' i19.dist > i19.p1;
54 else
55 sed -e 's/security/audit/g' i19.dist > i19.p1;
57 else
58 cp i19.dist i19.p1;
60 if [ "`grep LOG_AUTHPRIV /usr/include/sys/syslog.h 2>&1`" = "" ] ; then
61 sed -e 's/authpriv/!!!/g' i19.p1 > i19.p2;
62 else
63 cp i19.p1 i19.p2;
65 if [ "`grep LOG_LOGALERT /usr/include/sys/syslog.h 2>&1`" = "" ] ; then
66 sed -e 's/logalert/!!!/g' i19.p2 > i19.p1;
67 else
68 cp i19.p2 i19.p1;
70 if [ "`grep LOG_FTP /usr/include/sys/syslog.h 2>&1`" = "" ] ; then
71 sed -e 's/ftp/!!!/g' i19.p1 > i19.p2;
72 else
73 cp i19.p1 i19.p2;
75 if [ "`egrep 'LOG_CRON.*15' /usr/include/sys/syslog.h 2>&1`" != "" ] ; then
76 sed -e 's/cron/cron2/g' i19.p2 > i19;
77 else
78 cp i19.p2 i19;
80 /bin/rm i19.p?
82 mv i19 exp
83 itest "$@"
86 test_case i1 itest text ipf
87 test_case i2 itest text ipf
88 test_case i3 itest text ipf
89 test_case i4 itest text ipf
90 test_case i5 itest text ipf
91 test_case i6 itest text ipf
92 test_case i7 itest text ipf
93 test_case i8 itest text ipf
94 test_case i9 itest text ipf
95 test_case i10 itest text ipf
96 test_case i11 itest text ipf
97 test_case i12 itest text ipf
98 test_case i13 itest text ipf
99 test_case i14 itest text ipf
100 test_case i15 itest text ipf
101 test_case i16 itest text ipf
102 failing_test_case i17 itest "Known to be broken" text ipftest
103 test_case i18 itest text ipf
104 test_case i19 itest_i19 text ipf
105 test_case i20 itest text ipf
106 test_case i21 itest text ipf
107 test_case i22 itest text ipf
108 test_case i23 itest text ipf
110 atf_init_test_cases()
112 atf_add_test_case i1
113 atf_add_test_case i2
114 atf_add_test_case i3
115 atf_add_test_case i4
116 atf_add_test_case i5
117 atf_add_test_case i6
118 atf_add_test_case i7
119 atf_add_test_case i8
120 atf_add_test_case i9
121 atf_add_test_case i10
122 atf_add_test_case i11
123 atf_add_test_case i12
124 atf_add_test_case i13
125 atf_add_test_case i14
126 atf_add_test_case i15
127 atf_add_test_case i16
128 atf_add_test_case i17
129 atf_add_test_case i18
130 atf_add_test_case i19
131 atf_add_test_case i20
132 atf_add_test_case i21
133 atf_add_test_case i22
134 atf_add_test_case i23