source: test/do-tests.sh @ 5692bc4

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 5692bc4 was 5692bc4, checked in by Shane Alcock <salcock@…>, 7 years ago

Made timestamp integrity testing more thorough

We now test timestamp conversion across multiple formats.

Fixed timestamp difference check so that it would not allow
large negative values to count as successes.

  • Property mode set to 100755
File size: 4.8 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"
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 pcap
37do_test ./test-format pcap
38do_test ./test-decode pcap
39
40echo \* Read pcapfile
41do_test ./test-format pcapfile
42do_test ./test-decode pcapfile
43
44echo \* Read pcapfilens
45do_test ./test-format pcapfilens
46do_test ./test-decode pcapfilens
47
48echo \* Read legacyatm
49do_test ./test-format legacyatm
50do_test ./test-decode legacyatm
51
52echo \* Read legacyeth
53do_test ./test-format legacyeth
54do_test ./test-decode legacyeth
55
56echo \* Read legacypos
57do_test ./test-format legacypos
58do_test ./test-decode legacypos
59
60echo \* Read tsh
61do_test ./test-format tsh
62do_test ./test-decode tsh
63
64echo \* Read rawerf
65do_test ./test-format rawerf
66do_test ./test-decode rawerf
67
68
69echo \* Testing pcap-bpf
70do_test ./test-pcap-bpf
71
72echo \* Testing payload length
73do_test ./test-plen
74
75echo \* Testing event framework
76do_test ./test-event
77
78echo \* Testing time conversions
79echo \* ERF
80do_test ./test-time erf
81echo \* pcapfile
82do_test ./test-time pcapfile
83echo \* pcapfilens
84do_test ./test-time pcapfilens
85echo \* legacyatm
86do_test ./test-time legacyatm
87echo \* legacypos
88do_test ./test-time legacypos
89echo \* legacyeth
90do_test ./test-time legacyeth
91echo \* pcap
92do_test ./test-time pcap
93echo \* rawerf
94do_test ./test-time rawerf
95echo \* tsh
96do_test ./test-time tsh
97
98echo \* Testing directions
99do_test ./test-dir
100
101echo \* Testing wireless
102do_test ./test-wireless
103
104echo \* Testing error handling
105do_test ./test-errors
106
107echo \* Testing drop counters for erf
108do_test ./test-drops erf
109
110echo \* Testing drop counters for pcapfile
111do_test ./test-drops pcapfile
112
113echo \* Testing drop counters for duck
114do_test ./test-drops duck
115
116echo \* Testing drop counters for legacyatm
117do_test ./test-drops legacyatm
118
119echo \* Testing drop counters for legacypos
120do_test ./test-drops legacypos
121
122echo \* Testing drop counters for legacyeth
123do_test ./test-drops legacyeth
124
125echo \* Testing drop counters for tsh
126do_test ./test-drops tsh
127
128echo \* Testing larger trace file
129do_test ./test-drops legacylarge
130
131echo \* Testing writing erf
132do_test ./test-write erf
133
134echo \* Testing write pcap
135do_test ./test-write pcap
136
137echo \* Testing write pcapfile
138do_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
142echo \* Conversions
143echo " * erf -> erf"
144rm -f traces/*.out.*
145do_test ./test-convert erf erf
146
147echo " * erf -> pcap"
148do_test ./test-convert erf pcap
149
150echo " * pcap -> erf"
151rm -f traces/*.out.*
152do_test ./test-convert pcap erf
153
154echo " * pcapfile -> erf"
155rm -f traces/*.out.*
156do_test ./test-convert pcapfile erf
157
158echo " * pcapfile -> pcapfile"
159rm -f traces/*.out.*
160do_test ./test-convert pcapfile pcapfile
161
162echo " * pcapfilens -> pcapfile"
163rm -f traces/*.out.*
164do_test ./test-convert pcapfilens pcapfile
165
166echo " * pcapfilens -> erf"
167rm -f traces/*.out.*
168do_test ./test-convert pcapfilens erf
169
170echo " * pcap -> pcapfile"
171rm -f traces/*.out.*
172do_test ./test-convert pcap pcapfile
173
174echo " * erf -> pcapfile"
175rm -f traces/*.out.*
176do_test ./test-convert erf pcapfile
177
178echo " * pcap (sll) -> erf    raw IP"
179rm -f traces/*.out.*
180do_test ./test-convert sll1 erf
181
182echo " * pcap (sll) -> erf    loopback"
183rm -f traces/*.out.*
184do_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
197echo " * legacyeth -> pcapfile"
198rm -f traces/*.out.*
199do_test ./test-convert legacyeth pcapfile
200
201echo " * legacypos -> pcapfile"
202rm -f traces/*.out.*
203do_test ./test-convert legacypos pcapfile
204
205echo " * duck -> duck"
206rm -f traces/*.out.*
207do_test ./test-convert duck duck
208
209echo " * tsh -> pcapfile"
210rm -f traces/*.out.*
211do_test ./test-convert tsh pcapfile
212
213echo " * tsh -> pcap"
214rm -f traces/*.out.*
215do_test ./test-convert tsh pcap
216
217echo " * format autodetection - uncompressed"
218do_test ./test-autodetect traces/5_packets.erf
219echo " * format autodetection - gzip"
220do_test ./test-autodetect traces/5_packets.erf.gz
221echo " * format autodetection - bzip2"
222do_test ./test-autodetect traces/5_packets.erf.bz2
223
224echo
225echo "Tests passed: $OK"
226echo "Tests failed: $FAIL"
Note: See TracBrowser for help on using the repository browser.