1 | #!/bin/bash |
---|
2 | |
---|
3 | OK=0 |
---|
4 | FAIL="" |
---|
5 | |
---|
6 | do_test() { |
---|
7 | if $@; then |
---|
8 | OK=$[ $OK + 1 ] |
---|
9 | else |
---|
10 | FAIL="$FAIL |
---|
11 | $@" |
---|
12 | fi |
---|
13 | } |
---|
14 | |
---|
15 | libdir=../lib/.libs:../libpacketdump/.libs |
---|
16 | export LD_LIBRARY_PATH="$libdir" |
---|
17 | export DYLD_LIBRARY_PATH="${libdir}" |
---|
18 | echo SLL Decoder |
---|
19 | do_test ./test-decode2 pcap:traces/100_sll.pcap |
---|
20 | |
---|
21 | echo 802.1x decoder |
---|
22 | do_test ./test-decode2 pcap:traces/8021x.pcap |
---|
23 | |
---|
24 | echo MPLS Decoder |
---|
25 | do_test ./test-decode2 pcap:traces/10_mpls_ip.pcap |
---|
26 | |
---|
27 | echo Radius Decoder |
---|
28 | do_test ./test-decode2 pcap:traces/radius.pcap |
---|
29 | |
---|
30 | rm -f traces/*.out.* |
---|
31 | echo \* Read erf |
---|
32 | do_test ./test-format erf |
---|
33 | do_test ./test-decode erf |
---|
34 | |
---|
35 | echo \* Read pcap |
---|
36 | do_test ./test-format pcap |
---|
37 | do_test ./test-decode pcap |
---|
38 | |
---|
39 | echo \* Read pcapfile |
---|
40 | do_test ./test-format pcapfile |
---|
41 | do_test ./test-decode pcapfile |
---|
42 | |
---|
43 | echo \* Read legacyatm |
---|
44 | do_test ./test-format legacyatm |
---|
45 | do_test ./test-decode legacyatm |
---|
46 | |
---|
47 | echo \* Read legacyeth |
---|
48 | do_test ./test-format legacyeth |
---|
49 | do_test ./test-decode legacyeth |
---|
50 | |
---|
51 | echo \* Read legacypos |
---|
52 | do_test ./test-format legacypos |
---|
53 | do_test ./test-decode legacypos |
---|
54 | |
---|
55 | echo \* Read tsh |
---|
56 | do_test ./test-format tsh |
---|
57 | do_test ./test-decode tsh |
---|
58 | |
---|
59 | echo \* Testing pcap-bpf |
---|
60 | do_test ./test-pcap-bpf |
---|
61 | |
---|
62 | echo \* Testing payload length |
---|
63 | do_test ./test-plen |
---|
64 | |
---|
65 | echo \* Testing event framework |
---|
66 | do_test ./test-event |
---|
67 | |
---|
68 | echo \* Testing time conversions |
---|
69 | do_test ./test-time |
---|
70 | |
---|
71 | echo \* Testing directions |
---|
72 | do_test ./test-dir |
---|
73 | |
---|
74 | echo \* Testing wireless |
---|
75 | do_test ./test-wireless |
---|
76 | |
---|
77 | echo \* Testing error handling |
---|
78 | do_test ./test-errors |
---|
79 | |
---|
80 | echo \* Testing drop counters for erf |
---|
81 | do_test ./test-drops erf |
---|
82 | |
---|
83 | echo \* Testing drop counters for pcapfile |
---|
84 | do_test ./test-drops pcapfile |
---|
85 | |
---|
86 | echo \* Testing drop counters for duck |
---|
87 | do_test ./test-drops duck |
---|
88 | |
---|
89 | echo \* Testing drop counters for legacyatm |
---|
90 | do_test ./test-drops legacyatm |
---|
91 | |
---|
92 | echo \* Testing drop counters for legacypos |
---|
93 | do_test ./test-drops legacypos |
---|
94 | |
---|
95 | echo \* Testing drop counters for legacyeth |
---|
96 | do_test ./test-drops legacyeth |
---|
97 | |
---|
98 | echo \* Testing drop counters for tsh |
---|
99 | do_test ./test-drops tsh |
---|
100 | |
---|
101 | echo \* Testing larger trace file |
---|
102 | do_test ./test-drops legacylarge |
---|
103 | |
---|
104 | echo \* Testing writing erf |
---|
105 | do_test ./test-write erf |
---|
106 | |
---|
107 | echo \* Testing write pcap |
---|
108 | do_test ./test-write pcap |
---|
109 | |
---|
110 | echo \* Testing write pcapfile |
---|
111 | do_test ./test-write pcapfile |
---|
112 | |
---|
113 | # Not all types are convertable, for instance libtrace doesn't |
---|
114 | # do rtclient output, and erf doesn't support 802.11 |
---|
115 | echo \* Conversions |
---|
116 | echo " * erf -> erf" |
---|
117 | rm -f traces/*.out.* |
---|
118 | do_test ./test-convert erf erf |
---|
119 | |
---|
120 | echo " * erf -> pcap" |
---|
121 | do_test ./test-convert erf pcap |
---|
122 | |
---|
123 | echo " * pcap -> erf" |
---|
124 | rm -f traces/*.out.* |
---|
125 | do_test ./test-convert pcap erf |
---|
126 | |
---|
127 | echo " * pcapfile -> erf" |
---|
128 | rm -f traces/*.out.* |
---|
129 | do_test ./test-convert pcapfile erf |
---|
130 | |
---|
131 | echo " * pcapfile -> pcapfile" |
---|
132 | rm -f traces/*.out.* |
---|
133 | do_test ./test-convert pcapfile pcapfile |
---|
134 | |
---|
135 | echo " * pcap -> pcapfile" |
---|
136 | rm -f traces/*.out.* |
---|
137 | do_test ./test-convert pcap pcapfile |
---|
138 | |
---|
139 | echo " * erf -> pcapfile" |
---|
140 | rm -f traces/*.out.* |
---|
141 | do_test ./test-convert erf pcapfile |
---|
142 | #./test-convert rtclient erf |
---|
143 | #./test-convert rtclient pcap |
---|
144 | |
---|
145 | # This doesn't work because pcap doesn't support legacyatm's linktype |
---|
146 | # so the packet is converted to a raw IP packet, which when read |
---|
147 | # back in again doesn't match legacyatm's original packet. |
---|
148 | #echo " * legacyatm -> pcapfile" |
---|
149 | #rm -f traces/*.out.* |
---|
150 | #./test-convert legacyatm pcapfile |
---|
151 | |
---|
152 | echo " * legacyeth -> pcapfile" |
---|
153 | rm -f traces/*.out.* |
---|
154 | do_test ./test-convert legacyeth pcapfile |
---|
155 | |
---|
156 | echo " * legacypos -> pcapfile" |
---|
157 | rm -f traces/*.out.* |
---|
158 | do_test ./test-convert legacypos pcapfile |
---|
159 | |
---|
160 | echo " * duck -> duck" |
---|
161 | rm -f traces/*.out.* |
---|
162 | do_test ./test-convert duck duck |
---|
163 | |
---|
164 | echo " * tsh -> pcapfile" |
---|
165 | rm -f traces/*.out.* |
---|
166 | do_test ./test-convert tsh pcapfile |
---|
167 | |
---|
168 | echo " * tsh -> pcap" |
---|
169 | rm -f traces/*.out.* |
---|
170 | do_test ./test-convert tsh pcap |
---|
171 | |
---|
172 | echo |
---|
173 | echo "Tests passed: $OK" |
---|
174 | echo "Tests failed: $FAIL" |
---|