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 | 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 pcap |
---|
37 | do_test ./test-format pcap |
---|
38 | do_test ./test-decode pcap |
---|
39 | |
---|
40 | echo \* Read pcapfile |
---|
41 | do_test ./test-format pcapfile |
---|
42 | do_test ./test-decode pcapfile |
---|
43 | |
---|
44 | echo \* Read pcapfilens |
---|
45 | do_test ./test-format pcapfilens |
---|
46 | do_test ./test-decode pcapfilens |
---|
47 | |
---|
48 | echo \* Read legacyatm |
---|
49 | do_test ./test-format legacyatm |
---|
50 | do_test ./test-decode legacyatm |
---|
51 | |
---|
52 | echo \* Read legacyeth |
---|
53 | do_test ./test-format legacyeth |
---|
54 | do_test ./test-decode legacyeth |
---|
55 | |
---|
56 | echo \* Read legacypos |
---|
57 | do_test ./test-format legacypos |
---|
58 | do_test ./test-decode legacypos |
---|
59 | |
---|
60 | echo \* Read tsh |
---|
61 | do_test ./test-format tsh |
---|
62 | do_test ./test-decode tsh |
---|
63 | |
---|
64 | echo \* Read rawerf |
---|
65 | do_test ./test-format rawerf |
---|
66 | do_test ./test-decode rawerf |
---|
67 | |
---|
68 | |
---|
69 | echo \* Testing pcap-bpf |
---|
70 | do_test ./test-pcap-bpf |
---|
71 | |
---|
72 | echo \* Testing payload length |
---|
73 | do_test ./test-plen |
---|
74 | |
---|
75 | echo \* Testing event framework |
---|
76 | do_test ./test-event |
---|
77 | |
---|
78 | echo \* Testing time conversions |
---|
79 | echo \* ERF |
---|
80 | do_test ./test-time erf |
---|
81 | echo \* pcapfile |
---|
82 | do_test ./test-time pcapfile |
---|
83 | echo \* pcapfilens |
---|
84 | do_test ./test-time pcapfilens |
---|
85 | echo \* legacyatm |
---|
86 | do_test ./test-time legacyatm |
---|
87 | echo \* legacypos |
---|
88 | do_test ./test-time legacypos |
---|
89 | echo \* legacyeth |
---|
90 | do_test ./test-time legacyeth |
---|
91 | echo \* pcap |
---|
92 | do_test ./test-time pcap |
---|
93 | echo \* rawerf |
---|
94 | do_test ./test-time rawerf |
---|
95 | echo \* tsh |
---|
96 | do_test ./test-time tsh |
---|
97 | |
---|
98 | echo \* Testing directions |
---|
99 | do_test ./test-dir |
---|
100 | |
---|
101 | echo \* Testing wireless |
---|
102 | do_test ./test-wireless |
---|
103 | |
---|
104 | echo \* Testing error handling |
---|
105 | do_test ./test-errors |
---|
106 | |
---|
107 | echo \* Testing drop counters for erf |
---|
108 | do_test ./test-drops erf |
---|
109 | |
---|
110 | echo \* Testing drop counters for pcapfile |
---|
111 | do_test ./test-drops pcapfile |
---|
112 | |
---|
113 | echo \* Testing drop counters for duck |
---|
114 | do_test ./test-drops duck |
---|
115 | |
---|
116 | echo \* Testing drop counters for legacyatm |
---|
117 | do_test ./test-drops legacyatm |
---|
118 | |
---|
119 | echo \* Testing drop counters for legacypos |
---|
120 | do_test ./test-drops legacypos |
---|
121 | |
---|
122 | echo \* Testing drop counters for legacyeth |
---|
123 | do_test ./test-drops legacyeth |
---|
124 | |
---|
125 | echo \* Testing drop counters for tsh |
---|
126 | do_test ./test-drops tsh |
---|
127 | |
---|
128 | echo \* Testing larger trace file |
---|
129 | do_test ./test-drops legacylarge |
---|
130 | |
---|
131 | echo \* Testing writing erf |
---|
132 | do_test ./test-write erf |
---|
133 | |
---|
134 | echo \* Testing write pcap |
---|
135 | do_test ./test-write pcap |
---|
136 | |
---|
137 | echo \* Testing write pcapfile |
---|
138 | do_test ./test-write pcapfile |
---|
139 | |
---|
140 | # Not all types are convertable, for instance libtrace doesn't |
---|
141 | # do rtclient output, and erf doesn't support 802.11 |
---|
142 | echo \* Conversions |
---|
143 | echo " * erf -> erf" |
---|
144 | rm -f traces/*.out.* |
---|
145 | do_test ./test-convert erf erf |
---|
146 | |
---|
147 | echo " * erf -> pcap" |
---|
148 | do_test ./test-convert erf pcap |
---|
149 | |
---|
150 | echo " * pcap -> erf" |
---|
151 | rm -f traces/*.out.* |
---|
152 | do_test ./test-convert pcap erf |
---|
153 | |
---|
154 | echo " * pcapfile -> erf" |
---|
155 | rm -f traces/*.out.* |
---|
156 | do_test ./test-convert pcapfile erf |
---|
157 | |
---|
158 | echo " * pcapfile -> pcapfile" |
---|
159 | rm -f traces/*.out.* |
---|
160 | do_test ./test-convert pcapfile pcapfile |
---|
161 | |
---|
162 | echo " * pcapfilens -> pcapfile" |
---|
163 | rm -f traces/*.out.* |
---|
164 | do_test ./test-convert pcapfilens pcapfile |
---|
165 | |
---|
166 | echo " * pcapfilens -> erf" |
---|
167 | rm -f traces/*.out.* |
---|
168 | do_test ./test-convert pcapfilens erf |
---|
169 | |
---|
170 | echo " * pcap -> pcapfile" |
---|
171 | rm -f traces/*.out.* |
---|
172 | do_test ./test-convert pcap pcapfile |
---|
173 | |
---|
174 | echo " * erf -> pcapfile" |
---|
175 | rm -f traces/*.out.* |
---|
176 | do_test ./test-convert erf pcapfile |
---|
177 | |
---|
178 | echo " * pcap (sll) -> erf raw IP" |
---|
179 | rm -f traces/*.out.* |
---|
180 | do_test ./test-convert sll1 erf |
---|
181 | |
---|
182 | echo " * pcap (sll) -> erf loopback" |
---|
183 | rm -f traces/*.out.* |
---|
184 | do_test ./test-convert sll2 erf |
---|
185 | |
---|
186 | |
---|
187 | #./test-convert rtclient erf |
---|
188 | #./test-convert rtclient pcap |
---|
189 | |
---|
190 | # This doesn't work because pcap doesn't support legacyatm's linktype |
---|
191 | # so the packet is converted to a raw IP packet, which when read |
---|
192 | # back in again doesn't match legacyatm's original packet. |
---|
193 | #echo " * legacyatm -> pcapfile" |
---|
194 | #rm -f traces/*.out.* |
---|
195 | #./test-convert legacyatm pcapfile |
---|
196 | |
---|
197 | echo " * legacyeth -> pcapfile" |
---|
198 | rm -f traces/*.out.* |
---|
199 | do_test ./test-convert legacyeth pcapfile |
---|
200 | |
---|
201 | echo " * legacypos -> pcapfile" |
---|
202 | rm -f traces/*.out.* |
---|
203 | do_test ./test-convert legacypos pcapfile |
---|
204 | |
---|
205 | echo " * duck -> duck" |
---|
206 | rm -f traces/*.out.* |
---|
207 | do_test ./test-convert duck duck |
---|
208 | |
---|
209 | echo " * tsh -> pcapfile" |
---|
210 | rm -f traces/*.out.* |
---|
211 | do_test ./test-convert tsh pcapfile |
---|
212 | |
---|
213 | echo " * tsh -> pcap" |
---|
214 | rm -f traces/*.out.* |
---|
215 | do_test ./test-convert tsh pcap |
---|
216 | |
---|
217 | echo " * format autodetection - uncompressed" |
---|
218 | do_test ./test-autodetect traces/5_packets.erf |
---|
219 | echo " * format autodetection - gzip" |
---|
220 | do_test ./test-autodetect traces/5_packets.erf.gz |
---|
221 | echo " * format autodetection - bzip2" |
---|
222 | do_test ./test-autodetect traces/5_packets.erf.bz2 |
---|
223 | |
---|
224 | echo |
---|
225 | echo "Tests passed: $OK" |
---|
226 | echo "Tests failed: $FAIL" |
---|