File: t_69_includeemptynoop

package info (click to toggle)
filtergen 0.12.8-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,924 kB
  • sloc: sh: 5,485; ansic: 4,268; yacc: 692; lex: 362; makefile: 165
file content (49 lines) | stat: -rwxr-xr-x 703 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh -x

TEST="that empty includes that create noops get parsed correctly"

testdir=`dirname $0`
. $testdir/testlib

cat > $work/rules <<EOF
input eth0 {
    proto tcp dport ssh accept;
    include $work/empty ;
};
EOF
if test $? -ne 0 ; then no_result ; fi

cat > $work/empty <<EOF

EOF
if test $? -ne 0 ; then no_result ; fi

$here/convert < $work/rules > $work/out
if test $? -ne 0 ; then fail ; fi

cat > $work/good <<EOF
( siblist
  ( input eth0
   )
  child
  ( siblist
    ( siblist
      ( proto tcp
       )
      child
      ( siblist
        ( dport ssh
         )
        child
        ( accept
         )
       )
     )
   )
 )
EOF

compare $work/good $work/out

# got this far?
pass