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 | do_test ./test-time |
---|
80 | |
---|
81 | echo \* Testing directions |
---|
82 | do_test ./test-dir |
---|
83 | |
---|
84 | echo \* Testing wireless |
---|
85 | do_test ./test-wireless |
---|
86 | |
---|
87 | echo \* Testing error handling |
---|
88 | do_test ./test-errors |
---|
89 | |
---|
90 | echo \* Testing drop counters for erf |
---|
91 | do_test ./test-drops erf |
---|
92 | |
---|
93 | echo \* Testing drop counters for pcapfile |
---|
94 | do_test ./test-drops pcapfile |
---|
95 | |
---|
96 | echo \* Testing drop counters for duck |
---|
97 | do_test ./test-drops duck |
---|
98 | |
---|
99 | echo \* Testing drop counters for legacyatm |
---|
100 | do_test ./test-drops legacyatm |
---|
101 | |
---|
102 | echo \* Testing drop counters for legacypos |
---|
103 | do_test ./test-drops legacypos |
---|
104 | |
---|
105 | echo \* Testing drop counters for legacyeth |
---|
106 | do_test ./test-drops legacyeth |
---|
107 | |
---|
108 | echo \* Testing drop counters for tsh |
---|
109 | do_test ./test-drops tsh |
---|
110 | |
---|
111 | echo \* Testing larger trace file |
---|
112 | do_test ./test-drops legacylarge |
---|
113 | |
---|
114 | echo \* Testing writing erf |
---|
115 | do_test ./test-write erf |
---|
116 | |
---|
117 | echo \* Testing write pcap |
---|
118 | do_test ./test-write pcap |
---|
119 | |
---|
120 | echo \* Testing write pcapfile |
---|
121 | do_test ./test-write pcapfile |
---|
122 | |
---|
123 | # Not all types are convertable, for instance libtrace doesn't |
---|
124 | # do rtclient output, and erf doesn't support 802.11 |
---|
125 | echo \* Conversions |
---|
126 | echo " * erf -> erf" |
---|
127 | rm -f traces/*.out.* |
---|
128 | do_test ./test-convert erf erf |
---|
129 | |
---|
130 | echo " * erf -> pcap" |
---|
131 | do_test ./test-convert erf pcap |
---|
132 | |
---|
133 | echo " * pcap -> erf" |
---|
134 | rm -f traces/*.out.* |
---|
135 | do_test ./test-convert pcap erf |
---|
136 | |
---|
137 | echo " * pcapfile -> erf" |
---|
138 | rm -f traces/*.out.* |
---|
139 | do_test ./test-convert pcapfile erf |
---|
140 | |
---|
141 | echo " * pcapfile -> pcapfile" |
---|
142 | rm -f traces/*.out.* |
---|
143 | do_test ./test-convert pcapfile pcapfile |
---|
144 | |
---|
145 | echo " * pcapfilens -> pcapfile" |
---|
146 | rm -f traces/*.out.* |
---|
147 | do_test ./test-convert pcapfilens pcapfile |
---|
148 | |
---|
149 | echo " * pcapfilens -> erf" |
---|
150 | rm -f traces/*.out.* |
---|
151 | do_test ./test-convert pcapfilens erf |
---|
152 | |
---|
153 | echo " * pcap -> pcapfile" |
---|
154 | rm -f traces/*.out.* |
---|
155 | do_test ./test-convert pcap pcapfile |
---|
156 | |
---|
157 | echo " * erf -> pcapfile" |
---|
158 | rm -f traces/*.out.* |
---|
159 | do_test ./test-convert erf pcapfile |
---|
160 | |
---|
161 | echo " * pcap (sll) -> erf raw IP" |
---|
162 | rm -f traces/*.out.* |
---|
163 | do_test ./test-convert sll1 erf |
---|
164 | |
---|
165 | echo " * pcap (sll) -> erf loopback" |
---|
166 | rm -f traces/*.out.* |
---|
167 | do_test ./test-convert sll2 erf |
---|
168 | |
---|
169 | |
---|
170 | #./test-convert rtclient erf |
---|
171 | #./test-convert rtclient pcap |
---|
172 | |
---|
173 | # This doesn't work because pcap doesn't support legacyatm's linktype |
---|
174 | # so the packet is converted to a raw IP packet, which when read |
---|
175 | # back in again doesn't match legacyatm's original packet. |
---|
176 | #echo " * legacyatm -> pcapfile" |
---|
177 | #rm -f traces/*.out.* |
---|
178 | #./test-convert legacyatm pcapfile |
---|
179 | |
---|
180 | echo " * legacyeth -> pcapfile" |
---|
181 | rm -f traces/*.out.* |
---|
182 | do_test ./test-convert legacyeth pcapfile |
---|
183 | |
---|
184 | echo " * legacypos -> pcapfile" |
---|
185 | rm -f traces/*.out.* |
---|
186 | do_test ./test-convert legacypos pcapfile |
---|
187 | |
---|
188 | echo " * duck -> duck" |
---|
189 | rm -f traces/*.out.* |
---|
190 | do_test ./test-convert duck duck |
---|
191 | |
---|
192 | echo " * tsh -> pcapfile" |
---|
193 | rm -f traces/*.out.* |
---|
194 | do_test ./test-convert tsh pcapfile |
---|
195 | |
---|
196 | echo " * tsh -> pcap" |
---|
197 | rm -f traces/*.out.* |
---|
198 | do_test ./test-convert tsh pcap |
---|
199 | |
---|
200 | echo " * format autodetection - uncompressed" |
---|
201 | do_test ./test-autodetect traces/5_packets.erf |
---|
202 | echo " * format autodetection - gzip" |
---|
203 | do_test ./test-autodetect traces/5_packets.erf.gz |
---|
204 | echo " * format autodetection - bzip2" |
---|
205 | do_test ./test-autodetect traces/5_packets.erf.bz2 |
---|
206 | |
---|
207 | echo |
---|
208 | echo "Tests passed: $OK" |
---|
209 | echo "Tests failed: $FAIL" |
---|