source: test/do-tests.sh @ 43b773a

cachetimestampsdevelopetsiliverc-4.0.3rc-4.0.4ringdecrementfixringperformance
Last change on this file since 43b773a was 43b773a, checked in by Shane Alcock <salcock@…>, 3 years ago

Add basic tests for reading ERF provenance records

  • Property mode set to 100755
File size: 5.9 KB
Line 
1#!/bin/bash
2
3OK=0
4FAIL=""
5
6do_test() {
7        if $@; then
8                OK=$[ $OK + 1 ]
9        else
10                FAIL="$FAIL
11$@"
12        fi
13}
14
15libdir=../lib/.libs:../libpacketdump/.libs
16export LD_LIBRARY_PATH="$libdir:/usr/local/lib/"
17export DYLD_LIBRARY_PATH="${libdir}"
18echo SLL Decoder
19do_test ./test-decode2 pcap:traces/100_sll.pcap
20do_test ./test-decode2 pcapfile:traces/sll.pcap.gz
21
22echo 802.1x decoder
23do_test ./test-decode2 pcap:traces/8021x.pcap
24
25echo MPLS Decoder
26do_test ./test-decode2 pcap:traces/10_mpls_ip.pcap
27
28echo Radius Decoder
29do_test ./test-decode2 pcap:traces/radius.pcap
30
31rm -f traces/*.out.*
32echo \* Read erf
33do_test ./test-format erf
34do_test ./test-decode erf
35
36echo \* Read erf provenance
37do_test ./test-format erfprov
38
39echo \* Read pcap
40do_test ./test-format pcap
41do_test ./test-decode pcap
42
43echo \* Read pcapfile
44do_test ./test-format pcapfile
45do_test ./test-decode pcapfile
46
47echo \* Read pcapfilens
48do_test ./test-format pcapfilens
49do_test ./test-decode pcapfilens
50
51echo \* Read legacyatm
52do_test ./test-format legacyatm
53do_test ./test-decode legacyatm
54
55echo \* Read legacyeth
56do_test ./test-format legacyeth
57do_test ./test-decode legacyeth
58
59echo \* Read legacypos
60do_test ./test-format legacypos
61do_test ./test-decode legacypos
62
63echo \* Read tsh
64do_test ./test-format tsh
65do_test ./test-decode tsh
66
67echo \* Read rawerf
68do_test ./test-format rawerf
69do_test ./test-decode rawerf
70
71echo \* Read pcapng
72do_test ./test-format pcapng
73do_test ./test-decode pcapng
74
75
76echo \* Testing pcap-bpf
77do_test ./test-pcap-bpf
78
79echo \* Testing payload length
80do_test ./test-plen
81
82echo \* Testing port numbers
83do_test ./test-ports
84
85echo \* Testing fragment parsing
86do_test ./test-fragment
87
88echo \* Testing event framework
89do_test ./test-event
90
91echo \* Testing time conversions
92echo \* ERF
93do_test ./test-time erf
94echo \* pcapfile
95do_test ./test-time pcapfile
96echo \* pcapfilens
97do_test ./test-time pcapfilens
98echo \* legacyatm
99do_test ./test-time legacyatm
100echo \* legacypos
101do_test ./test-time legacypos
102echo \* legacyeth
103do_test ./test-time legacyeth
104echo \* pcap
105do_test ./test-time pcap
106echo \* rawerf
107do_test ./test-time rawerf
108echo \* tsh
109do_test ./test-time tsh
110echo \* pcapng
111do_test ./test-time pcapng
112
113echo \* Testing directions
114do_test ./test-dir
115
116echo \* Testing wireless
117do_test ./test-wireless
118
119echo \* Testing error handling
120do_test ./test-errors
121
122echo \* Testing drop counters for erf
123do_test ./test-drops erf
124
125echo \* Testing drop counters for pcapfile
126do_test ./test-drops pcapfile
127
128echo \* Testing drop counters for duck
129do_test ./test-drops duck
130
131echo \* Testing drop counters for legacyatm
132do_test ./test-drops legacyatm
133
134echo \* Testing drop counters for legacypos
135do_test ./test-drops legacypos
136
137echo \* Testing drop counters for legacyeth
138do_test ./test-drops legacyeth
139
140echo \* Testing drop counters for tsh
141do_test ./test-drops tsh
142
143echo \* Testing larger trace file
144do_test ./test-drops legacylarge
145
146echo \* Testing writing erf
147do_test ./test-write erf
148
149echo \* Testing write pcap
150do_test ./test-write pcap
151
152echo \* Testing write pcapfile
153do_test ./test-write pcapfile
154
155# Not all types are convertable, for instance libtrace doesn't
156# do rtclient output, and erf doesn't support 802.11
157echo \* Conversions
158echo " * erf -> erf"
159rm -f traces/*.out.*
160do_test ./test-convert erf erf
161
162echo " * erf -> pcap"
163do_test ./test-convert erf pcap
164
165echo " * pcap -> erf"
166rm -f traces/*.out.*
167do_test ./test-convert pcap erf
168
169echo " * pcapfile -> erf"
170rm -f traces/*.out.*
171do_test ./test-convert pcapfile erf
172
173echo " * pcapfile -> pcapfile"
174rm -f traces/*.out.*
175do_test ./test-convert pcapfile pcapfile
176
177echo " * pcapfilens -> pcapfile"
178rm -f traces/*.out.*
179do_test ./test-convert pcapfilens pcapfile
180
181echo " * pcapfilens -> erf"
182rm -f traces/*.out.*
183do_test ./test-convert pcapfilens erf
184
185echo " * pcap -> pcapfile"
186rm -f traces/*.out.*
187do_test ./test-convert pcap pcapfile
188
189echo " * erf -> pcapfile"
190rm -f traces/*.out.*
191do_test ./test-convert erf pcapfile
192
193echo " * pcapng -> pcapfile"
194rm -f traces/*.out.*
195do_test ./test-convert pcapng pcapfile
196
197echo " * pcapng -> erf"
198rm -f traces/*.out.*
199do_test ./test-convert pcapng erf
200
201echo " * pcap (sll) -> erf    raw IP"
202rm -f traces/*.out.*
203do_test ./test-convert sll1 erf
204
205echo " * pcap (sll) -> erf    loopback"
206rm -f traces/*.out.*
207do_test ./test-convert sll2 erf
208
209
210#./test-convert rtclient erf
211#./test-convert rtclient pcap
212
213# This doesn't work because pcap doesn't support legacyatm's linktype
214# so the packet is converted to a raw IP packet, which when read
215# back in again doesn't match legacyatm's original packet.
216#echo " * legacyatm -> pcapfile"
217#rm -f traces/*.out.*
218#./test-convert legacyatm pcapfile
219
220echo " * legacyeth -> pcapfile"
221rm -f traces/*.out.*
222do_test ./test-convert legacyeth pcapfile
223
224echo " * legacypos -> pcapfile"
225rm -f traces/*.out.*
226do_test ./test-convert legacypos pcapfile
227
228# Don't bother with this anymore -- DUCK qualifies as 'meta' so
229# doesn't get written at the moment.
230#echo " * duck -> duck"
231#rm -f traces/*.out.*
232#do_test ./test-convert duck duck
233
234echo " * tsh -> pcapfile"
235rm -f traces/*.out.*
236do_test ./test-convert tsh pcapfile
237
238echo " * tsh -> pcap"
239rm -f traces/*.out.*
240do_test ./test-convert tsh pcap
241
242echo \* Testing packet truncation
243echo " * pcap "
244rm -f traces/*.out.*
245do_test ./test-setcaplen pcap pcapfile
246
247echo " * pcapfile "
248rm -f traces/*.out.*
249do_test ./test-setcaplen pcapfile pcapfile
250
251echo " * erf "
252rm -f traces/*.out.*
253do_test ./test-setcaplen erf erf
254
255echo " * pcapng "
256rm -f traces/*.out.*
257do_test ./test-setcaplen pcapng pcapfile
258
259echo " * pcapfilens "
260rm -f traces/*.out.*
261do_test ./test-setcaplen pcapfilens pcapfile
262
263
264
265echo " * format autodetection - uncompressed"
266do_test ./test-autodetect traces/5_packets.erf
267echo " * format autodetection - gzip"
268do_test ./test-autodetect traces/5_packets.erf.gz
269echo " * format autodetection - bzip2"
270do_test ./test-autodetect traces/5_packets.erf.bz2
271echo " * format autodetection - lzma"
272do_test ./test-autodetect traces/5_packets.erf.xz
273
274echo " * VXLan decode"
275do_test ./test-vxlan
276
277echo
278echo "Tests passed: $OK"
279echo "Tests failed: $FAIL"
Note: See TracBrowser for help on using the repository browser.