Home | History | Annotate | Line # | Download | only in ipf
t_nat_exec.sh revision 1.8
      1  1.8  pgoyette # $NetBSD: t_nat_exec.sh,v 1.8 2012/07/08 14:45:05 pgoyette Exp $
      2  1.1      jmmv #
      3  1.1      jmmv # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
      4  1.1      jmmv # All rights reserved.
      5  1.1      jmmv #
      6  1.1      jmmv # Redistribution and use in source and binary forms, with or without
      7  1.1      jmmv # modification, are permitted provided that the following conditions
      8  1.1      jmmv # are met:
      9  1.1      jmmv # 1. Redistributions of source code must retain the above copyright
     10  1.1      jmmv #    notice, this list of conditions and the following disclaimer.
     11  1.1      jmmv # 2. Redistributions in binary form must reproduce the above copyright
     12  1.1      jmmv #    notice, this list of conditions and the following disclaimer in the
     13  1.1      jmmv #    documentation and/or other materials provided with the distribution.
     14  1.1      jmmv #
     15  1.1      jmmv # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     16  1.1      jmmv # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     17  1.1      jmmv # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     18  1.1      jmmv # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     19  1.1      jmmv # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     20  1.1      jmmv # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     21  1.1      jmmv # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     22  1.1      jmmv # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     23  1.1      jmmv # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     24  1.1      jmmv # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     25  1.1      jmmv # POSSIBILITY OF SUCH DAMAGE.
     26  1.1      jmmv #
     27  1.1      jmmv #
     28  1.1      jmmv # (C)opyright 1993-1996 by Darren Reed.
     29  1.1      jmmv #
     30  1.1      jmmv # See the IPFILTER.LICENCE file for details on licencing.
     31  1.1      jmmv #
     32  1.1      jmmv 
     33  1.2      jmmv nattest()
     34  1.1      jmmv {
     35  1.1      jmmv 	h_copydata $1
     36  1.8  pgoyette 	infmt=$2
     37  1.8  pgoyette 	outfmt=$3
     38  1.8  pgoyette 	shift
     39  1.8  pgoyette 	shift
     40  1.8  pgoyette 	shift
     41  1.8  pgoyette 	args=$@
     42  1.1      jmmv 
     43  1.8  pgoyette 	if [ $outfmt = hex ] ; then
     44  1.8  pgoyette 		format="-xF $infmt"
     45  1.1      jmmv 	else
     46  1.8  pgoyette 		format="-F $infmt"
     47  1.1      jmmv 	fi
     48  1.1      jmmv 
     49  1.8  pgoyette 	format="$format"
     50  1.1      jmmv 
     51  1.1      jmmv 	{ while read rule; do
     52  1.1      jmmv 		atf_check -o save:save -x \
     53  1.8  pgoyette 		    "echo \"$rule\" | ipftest $format -RbN - -i in $args"
     54  1.1      jmmv 		cat save >>out
     55  1.1      jmmv 		echo "-------------------------------" >>out
     56  1.1      jmmv 	done; } <reg
     57  1.1      jmmv 
     58  1.1      jmmv 	diff -u exp out || atf_fail "results differ"
     59  1.1      jmmv }
     60  1.1      jmmv 
     61  1.8  pgoyette broken_test_case n1 nattest text text
     62  1.8  pgoyette broken_test_case n2 nattest text text
     63  1.7    jruoho broken_test_case n3 nattest text text
     64  1.8  pgoyette broken_test_case n4 nattest text text
     65  1.8  pgoyette broken_test_case n5 nattest text text
     66  1.8  pgoyette broken_test_case n6 nattest text text
     67  1.7    jruoho broken_test_case n7 nattest text text
     68  1.8  pgoyette broken_test_case n8 nattest hex hex -T update_ipid=0
     69  1.8  pgoyette broken_test_case n9 nattest hex hex -T update_ipid=0
     70  1.8  pgoyette test_case n10 nattest hex hex -T update_ipid=0 -D
     71  1.8  pgoyette broken_test_case n11 nattest text text
     72  1.8  pgoyette broken_test_case n12 nattest hex hex -T update_ipid=0 -v
     73  1.7    jruoho broken_test_case n13 nattest text text
     74  1.7    jruoho broken_test_case n14 nattest text text
     75  1.8  pgoyette broken_test_case n15 nattest text text -T update_ipid=0
     76  1.1      jmmv test_case n16 nattest hex hex -D
     77  1.1      jmmv test_case n17 nattest hex hex -D
     78  1.8  pgoyette broken_test_case n100 nattest text text
     79  1.8  pgoyette broken_test_case n101 nattest text text
     80  1.8  pgoyette broken_test_case n102 nattest text text
     81  1.8  pgoyette broken_test_case n103 nattest text text
     82  1.8  pgoyette broken_test_case n104 nattest hex hex -T update_ipid=0
     83  1.8  pgoyette broken_test_case n105 nattest hex hex -T update_ipid=0
     84  1.8  pgoyette broken_test_case n106 nattest hex hex -T update_ipid=0
     85  1.8  pgoyette broken_test_case n200 nattest hex hex -T update_ipid=0
     86  1.8  pgoyette broken_test_case n201 nattest hex hex -T update_ipid=0
     87  1.8  pgoyette broken_test_case n202 nattest hex hex -T update_ipid=0
     88  1.8  pgoyette broken_test_case n1_6 nattest text text -6
     89  1.8  pgoyette broken_test_case n2_6 nattest text text -6
     90  1.8  pgoyette broken_test_case n4_6 nattest text text -6
     91  1.8  pgoyette broken_test_case n5_6 nattest text text -6
     92  1.8  pgoyette broken_test_case n6_6 nattest text text -6
     93  1.8  pgoyette broken_test_case n7_6 nattest text text -6
     94  1.8  pgoyette test_case n8_6 nattest hex hex -6D
     95  1.8  pgoyette test_case n9_6 nattest hex hex -6D
     96  1.8  pgoyette broken_test_case n11_6 nattest text text -6
     97  1.8  pgoyette test_case n12_6 nattest hex hex -D6
     98  1.8  pgoyette broken_test_case n15_6 nattest text text -6
     99  1.8  pgoyette broken_test_case n17_6 nattest hex hex -6
    100  1.1      jmmv 
    101  1.1      jmmv atf_init_test_cases()
    102  1.1      jmmv {
    103  1.8  pgoyette 	atf_add_test_case n1
    104  1.8  pgoyette 	atf_add_test_case n2
    105  1.1      jmmv 	atf_add_test_case n3
    106  1.8  pgoyette 	atf_add_test_case n4
    107  1.8  pgoyette 	atf_add_test_case n5
    108  1.8  pgoyette 	atf_add_test_case n6
    109  1.1      jmmv 	atf_add_test_case n7
    110  1.1      jmmv 	atf_add_test_case n8
    111  1.1      jmmv 	atf_add_test_case n9
    112  1.1      jmmv 	atf_add_test_case n10
    113  1.8  pgoyette 	atf_add_test_case n11
    114  1.1      jmmv 	atf_add_test_case n12
    115  1.1      jmmv 	atf_add_test_case n13
    116  1.1      jmmv 	atf_add_test_case n14
    117  1.1      jmmv 	atf_add_test_case n16
    118  1.1      jmmv 	atf_add_test_case n17
    119  1.8  pgoyette 	atf_add_test_case n100
    120  1.8  pgoyette 	atf_add_test_case n101
    121  1.8  pgoyette 	atf_add_test_case n102
    122  1.8  pgoyette 	atf_add_test_case n103
    123  1.8  pgoyette 	atf_add_test_case n104
    124  1.8  pgoyette 	atf_add_test_case n105
    125  1.8  pgoyette 	atf_add_test_case n106
    126  1.8  pgoyette 	atf_add_test_case n200
    127  1.8  pgoyette 	atf_add_test_case n201
    128  1.8  pgoyette 	atf_add_test_case n202
    129  1.8  pgoyette 
    130  1.8  pgoyette 	atf_add_test_case n1_6
    131  1.8  pgoyette 	atf_add_test_case n2_6
    132  1.8  pgoyette #	atf_add_test_case n3_6
    133  1.8  pgoyette 	atf_add_test_case n4_6
    134  1.8  pgoyette 	atf_add_test_case n5_6
    135  1.8  pgoyette 	atf_add_test_case n6_6
    136  1.8  pgoyette 	atf_add_test_case n7_6
    137  1.8  pgoyette 	atf_add_test_case n8_6
    138  1.8  pgoyette 	atf_add_test_case n9_6
    139  1.8  pgoyette 	atf_add_test_case n11_6
    140  1.8  pgoyette 	atf_add_test_case n12_6
    141  1.8  pgoyette 	atf_add_test_case n15_6
    142  1.8  pgoyette 	atf_add_test_case n17_6
    143  1.3     pooka 
    144  1.1      jmmv }
    145