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:/usr/local/lib/" |
---|
17 | export DYLD_LIBRARY_PATH="${libdir}" |
---|
18 | echo SLL Decoder |
---|
19 | do_test ./test-decode2 pcap:traces/100_sll.pcap |
---|
20 | do_test ./test-decode2 pcapfile:traces/sll.pcap.gz |
---|
21 | |
---|
22 | echo 802.1x decoder |
---|
23 | do_test ./test-decode2 pcap:traces/8021x.pcap |
---|
24 | |
---|
25 | echo MPLS Decoder |
---|
26 | do_test ./test-decode2 pcap:traces/10_mpls_ip.pcap |
---|
27 | |
---|
28 | echo Radius Decoder |
---|
29 | do_test ./test-decode2 pcap:traces/radius.pcap |
---|
30 | |
---|
31 | rm -f traces/*.out.* |
---|
32 | echo \* Read erf |
---|
33 | do_test ./test-format erf |
---|
34 | do_test ./test-decode erf |
---|
35 | |
---|
36 | echo \* Read erf provenance |
---|
37 | do_test ./test-format erfprov |
---|
38 | |
---|
39 | echo \* Read pcap |
---|
40 | do_test ./test-format pcap |
---|
41 | do_test ./test-decode pcap |
---|
42 | |
---|
43 | echo \* Read pcapfile |
---|
44 | do_test ./test-format pcapfile |
---|
45 | do_test ./test-decode pcapfile |
---|
46 | |
---|
47 | echo \* Read pcapfilens |
---|
48 | do_test ./test-format pcapfilens |
---|
49 | do_test ./test-decode pcapfilens |
---|
50 | |
---|
51 | echo \* Read legacyatm |
---|
52 | do_test ./test-format legacyatm |
---|
53 | do_test ./test-decode legacyatm |
---|
54 | |
---|
55 | echo \* Read legacyeth |
---|
56 | do_test ./test-format legacyeth |
---|
57 | do_test ./test-decode legacyeth |
---|
58 | |
---|
59 | echo \* Read legacypos |
---|
60 | do_test ./test-format legacypos |
---|
61 | do_test ./test-decode legacypos |
---|
62 | |
---|
63 | echo \* Read tsh |
---|
64 | do_test ./test-format tsh |
---|
65 | do_test ./test-decode tsh |
---|
66 | |
---|
67 | echo \* Read rawerf |
---|
68 | do_test ./test-format rawerf |
---|
69 | do_test ./test-decode rawerf |
---|
70 | |
---|
71 | echo \* Read pcapng |
---|
72 | do_test ./test-format pcapng |
---|
73 | do_test ./test-decode pcapng |
---|
74 | |
---|
75 | |
---|
76 | echo \* Testing pcap-bpf |
---|
77 | do_test ./test-pcap-bpf |
---|
78 | |
---|
79 | echo \* Testing payload length |
---|
80 | do_test ./test-plen |
---|
81 | |
---|
82 | echo \* Testing wire length |
---|
83 | echo \* ERF |
---|
84 | do_test ./test-wlen erf |
---|
85 | echo \* pcapfile |
---|
86 | do_test ./test-wlen pcapfile |
---|
87 | echo \* pcapfilens |
---|
88 | do_test ./test-wlen pcapfilens |
---|
89 | echo \* legacyatm |
---|
90 | do_test ./test-wlen legacyatm |
---|
91 | echo \* legacypos |
---|
92 | do_test ./test-wlen legacypos |
---|
93 | echo \* legacyeth |
---|
94 | do_test ./test-wlen legacyeth |
---|
95 | echo \* rawerf |
---|
96 | do_test ./test-wlen rawerf |
---|
97 | echo \* pcap |
---|
98 | do_test ./test-wlen pcap |
---|
99 | echo \* tsh |
---|
100 | do_test ./test-wlen tsh |
---|
101 | echo \* pcapng |
---|
102 | do_test ./test-wlen pcapng |
---|
103 | |
---|
104 | echo \* Testing port numbers |
---|
105 | do_test ./test-ports |
---|
106 | |
---|
107 | echo \* Testing fragment parsing |
---|
108 | do_test ./test-fragment |
---|
109 | |
---|
110 | echo \* Testing event framework |
---|
111 | do_test ./test-event |
---|
112 | |
---|
113 | echo \* Testing time conversions |
---|
114 | echo \* ERF |
---|
115 | do_test ./test-time erf |
---|
116 | echo \* pcapfile |
---|
117 | do_test ./test-time pcapfile |
---|
118 | echo \* pcapfilens |
---|
119 | do_test ./test-time pcapfilens |
---|
120 | echo \* legacyatm |
---|
121 | do_test ./test-time legacyatm |
---|
122 | echo \* legacypos |
---|
123 | do_test ./test-time legacypos |
---|
124 | echo \* legacyeth |
---|
125 | do_test ./test-time legacyeth |
---|
126 | echo \* pcap |
---|
127 | do_test ./test-time pcap |
---|
128 | echo \* rawerf |
---|
129 | do_test ./test-time rawerf |
---|
130 | echo \* tsh |
---|
131 | do_test ./test-time tsh |
---|
132 | echo \* pcapng |
---|
133 | do_test ./test-time pcapng |
---|
134 | |
---|
135 | echo \* Testing directions |
---|
136 | do_test ./test-dir |
---|
137 | |
---|
138 | echo \* Testing wireless |
---|
139 | do_test ./test-wireless |
---|
140 | |
---|
141 | echo \* Testing error handling |
---|
142 | do_test ./test-errors |
---|
143 | |
---|
144 | echo \* Testing drop counters for erf |
---|
145 | do_test ./test-drops erf |
---|
146 | |
---|
147 | echo \* Testing drop counters for pcapfile |
---|
148 | do_test ./test-drops pcapfile |
---|
149 | |
---|
150 | echo \* Testing drop counters for duck |
---|
151 | do_test ./test-drops duck |
---|
152 | |
---|
153 | echo \* Testing drop counters for legacyatm |
---|
154 | do_test ./test-drops legacyatm |
---|
155 | |
---|
156 | echo \* Testing drop counters for legacypos |
---|
157 | do_test ./test-drops legacypos |
---|
158 | |
---|
159 | echo \* Testing drop counters for legacyeth |
---|
160 | do_test ./test-drops legacyeth |
---|
161 | |
---|
162 | echo \* Testing drop counters for tsh |
---|
163 | do_test ./test-drops tsh |
---|
164 | |
---|
165 | echo \* Testing larger trace file |
---|
166 | do_test ./test-drops legacylarge |
---|
167 | |
---|
168 | echo \* Testing writing erf |
---|
169 | do_test ./test-write erf |
---|
170 | |
---|
171 | echo \* Testing write pcap |
---|
172 | do_test ./test-write pcap |
---|
173 | |
---|
174 | echo \* Testing write pcapfile |
---|
175 | do_test ./test-write pcapfile |
---|
176 | |
---|
177 | # Not all types are convertable, for instance libtrace doesn't |
---|
178 | # do rtclient output, and erf doesn't support 802.11 |
---|
179 | echo \* Conversions |
---|
180 | echo " * erf -> erf" |
---|
181 | rm -f traces/*.out.* |
---|
182 | do_test ./test-convert erf erf |
---|
183 | |
---|
184 | echo " * erf -> pcap" |
---|
185 | rm -f traces/*.out.* |
---|
186 | do_test ./test-convert erf pcap |
---|
187 | |
---|
188 | echo " * erf -> pcapfile" |
---|
189 | rm -f traces/*.out.* |
---|
190 | do_test ./test-convert erf pcapfile |
---|
191 | |
---|
192 | echo " * erf -> pcapng" |
---|
193 | rm -f traces/*.out.* |
---|
194 | do_test ./test-convert erf pcapng |
---|
195 | |
---|
196 | |
---|
197 | echo " * pcap -> pcap" |
---|
198 | rm -f traces/*.out.* |
---|
199 | do_test ./test-convert pcap pcap |
---|
200 | |
---|
201 | echo " * pcap -> erf" |
---|
202 | rm -f traces/*.out.* |
---|
203 | do_test ./test-convert pcap erf |
---|
204 | |
---|
205 | echo " * pcap -> pcapfile" |
---|
206 | rm -f traces/*.out.* |
---|
207 | do_test ./test-convert pcap pcapfile |
---|
208 | |
---|
209 | echo " * pcap -> pcapng" |
---|
210 | rm -f traces/*.out.* |
---|
211 | do_test ./test-convert pcap pcapng |
---|
212 | |
---|
213 | |
---|
214 | echo " * pcapfile -> erf" |
---|
215 | rm -f traces/*.out.* |
---|
216 | do_test ./test-convert pcapfile erf |
---|
217 | |
---|
218 | echo " * pcapfile -> pcapfile" |
---|
219 | rm -f traces/*.out.* |
---|
220 | do_test ./test-convert pcapfile pcapfile |
---|
221 | |
---|
222 | echo " * pcapfile -> pcap" |
---|
223 | rm -f traces/*.out.* |
---|
224 | do_test ./test-convert pcapfile pcap |
---|
225 | |
---|
226 | echo " * pcapfile -> pcapng" |
---|
227 | rm -f traces/*.out.* |
---|
228 | do_test ./test-convert pcapfile pcapng |
---|
229 | |
---|
230 | |
---|
231 | echo " * pcapfilens -> pcapfile" |
---|
232 | rm -f traces/*.out.* |
---|
233 | do_test ./test-convert pcapfilens pcapfile |
---|
234 | |
---|
235 | echo " * pcapfilens -> erf" |
---|
236 | rm -f traces/*.out.* |
---|
237 | do_test ./test-convert pcapfilens erf |
---|
238 | |
---|
239 | |
---|
240 | echo " * pcapng -> pcapfile" |
---|
241 | rm -f traces/*.out.* |
---|
242 | do_test ./test-convert pcapng pcapfile |
---|
243 | |
---|
244 | echo " * pcapng -> erf" |
---|
245 | rm -f traces/*.out.* |
---|
246 | do_test ./test-convert pcapng erf |
---|
247 | |
---|
248 | echo " * pcapng -> pcap" |
---|
249 | rm -f traces/*.out.* |
---|
250 | do_test ./test-convert pcapng pcap |
---|
251 | |
---|
252 | echo " * pcapng -> pcapng" |
---|
253 | rm -f traces/*.out.* |
---|
254 | do_test ./test-convert pcapng pcapng |
---|
255 | |
---|
256 | |
---|
257 | echo " * pcap (sll) -> erf raw IP" |
---|
258 | rm -f traces/*.out.* |
---|
259 | do_test ./test-convert sll1 erf |
---|
260 | |
---|
261 | echo " * pcap (sll) -> erf loopback" |
---|
262 | rm -f traces/*.out.* |
---|
263 | do_test ./test-convert sll2 erf |
---|
264 | |
---|
265 | |
---|
266 | #./test-convert rtclient erf |
---|
267 | #./test-convert rtclient pcap |
---|
268 | |
---|
269 | # This doesn't work because pcap doesn't support legacyatm's linktype |
---|
270 | # so the packet is converted to a raw IP packet, which when read |
---|
271 | # back in again doesn't match legacyatm's original packet. |
---|
272 | #echo " * legacyatm -> pcapfile" |
---|
273 | #rm -f traces/*.out.* |
---|
274 | #./test-convert legacyatm pcapfile |
---|
275 | |
---|
276 | echo " * legacyeth -> pcapfile" |
---|
277 | rm -f traces/*.out.* |
---|
278 | do_test ./test-convert legacyeth pcapfile |
---|
279 | |
---|
280 | echo " * legacypos -> pcapfile" |
---|
281 | rm -f traces/*.out.* |
---|
282 | do_test ./test-convert legacypos pcapfile |
---|
283 | |
---|
284 | # Don't bother with this anymore -- DUCK qualifies as 'meta' so |
---|
285 | # doesn't get written at the moment. |
---|
286 | #echo " * duck -> duck" |
---|
287 | #rm -f traces/*.out.* |
---|
288 | #do_test ./test-convert duck duck |
---|
289 | |
---|
290 | echo " * tsh -> pcapfile" |
---|
291 | rm -f traces/*.out.* |
---|
292 | do_test ./test-convert tsh pcapfile |
---|
293 | |
---|
294 | echo " * tsh -> pcap" |
---|
295 | rm -f traces/*.out.* |
---|
296 | do_test ./test-convert tsh pcap |
---|
297 | |
---|
298 | echo \* Testing packet truncation |
---|
299 | echo " * pcap " |
---|
300 | rm -f traces/*.out.* |
---|
301 | do_test ./test-setcaplen pcap pcapfile |
---|
302 | |
---|
303 | echo " * pcapfile " |
---|
304 | rm -f traces/*.out.* |
---|
305 | do_test ./test-setcaplen pcapfile pcapfile |
---|
306 | |
---|
307 | echo " * erf " |
---|
308 | rm -f traces/*.out.* |
---|
309 | do_test ./test-setcaplen erf erf |
---|
310 | |
---|
311 | echo " * pcapng " |
---|
312 | rm -f traces/*.out.* |
---|
313 | do_test ./test-setcaplen pcapng pcapfile |
---|
314 | |
---|
315 | echo " * pcapfilens " |
---|
316 | rm -f traces/*.out.* |
---|
317 | do_test ./test-setcaplen pcapfilens pcapfile |
---|
318 | |
---|
319 | |
---|
320 | |
---|
321 | echo " * format autodetection - uncompressed" |
---|
322 | do_test ./test-autodetect traces/5_packets.erf |
---|
323 | echo " * format autodetection - gzip" |
---|
324 | do_test ./test-autodetect traces/5_packets.erf.gz |
---|
325 | echo " * format autodetection - bzip2" |
---|
326 | do_test ./test-autodetect traces/5_packets.erf.bz2 |
---|
327 | echo " * format autodetection - lzma" |
---|
328 | do_test ./test-autodetect traces/5_packets.erf.xz |
---|
329 | |
---|
330 | echo " * VXLan decode" |
---|
331 | do_test ./test-vxlan |
---|
332 | |
---|
333 | echo " * Outermost VLAN ID" |
---|
334 | do_test ./test-vlan |
---|
335 | |
---|
336 | echo " * Outermost MPLS label" |
---|
337 | do_test ./test-mpls |
---|
338 | |
---|
339 | echo " * Layer2 Headers" |
---|
340 | do_test ./test-layer2-headers |
---|
341 | |
---|
342 | echo |
---|
343 | echo "Tests passed: $OK" |
---|
344 | echo "Tests failed: $FAIL" |
---|