source: test/do-tests.sh @ bcb2402

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since bcb2402 was bcb2402, checked in by Richard Sanger <rjs51@…>, 7 years ago

Add tests for nanosecond pcap files

  • Property mode set to 100755
File size: 4.3 KB
RevLine 
[7a27af0]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
[99425f8]20do_test ./test-decode2 pcapfile:traces/sll.pcap.gz
[7a27af0]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
[bcb2402]44echo \* Read pcapfilens
45do_test ./test-format pcapfilens
46do_test ./test-decode pcapfilens
47
[7a27af0]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
[376c785]64echo \* Read rawerf
65do_test ./test-format rawerf
66do_test ./test-decode rawerf
67
68
[7a27af0]69echo \* Testing pcap-bpf
70do_test ./test-pcap-bpf
71
[6eeda5b]72echo \* Testing payload length
73do_test ./test-plen
74
[7a27af0]75echo \* Testing event framework
76do_test ./test-event
77
78echo \* Testing time conversions
79do_test ./test-time
80
81echo \* Testing directions
82do_test ./test-dir
83
84echo \* Testing wireless
85do_test ./test-wireless
86
87echo \* Testing error handling
88do_test ./test-errors
89
90echo \* Testing drop counters for erf
91do_test ./test-drops erf
92
93echo \* Testing drop counters for pcapfile
94do_test ./test-drops pcapfile
95
96echo \* Testing drop counters for duck
97do_test ./test-drops duck
98
99echo \* Testing drop counters for legacyatm
100do_test ./test-drops legacyatm
101
102echo \* Testing drop counters for legacypos
103do_test ./test-drops legacypos
104
105echo \* Testing drop counters for legacyeth
106do_test ./test-drops legacyeth
107
108echo \* Testing drop counters for tsh
109do_test ./test-drops tsh
110
[09dd4f1]111echo \* Testing larger trace file
112do_test ./test-drops legacylarge
113
[7a27af0]114echo \* Testing writing erf
115do_test ./test-write erf
116
117echo \* Testing write pcap
118do_test ./test-write pcap
119
120echo \* Testing write pcapfile
121do_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
125echo \* Conversions
126echo " * erf -> erf"
127rm -f traces/*.out.*
128do_test ./test-convert erf erf
129
130echo " * erf -> pcap"
131do_test ./test-convert erf pcap
132
133echo " * pcap -> erf"
134rm -f traces/*.out.*
135do_test ./test-convert pcap erf
136
137echo " * pcapfile -> erf"
138rm -f traces/*.out.*
139do_test ./test-convert pcapfile erf
140
141echo " * pcapfile -> pcapfile"
142rm -f traces/*.out.*
143do_test ./test-convert pcapfile pcapfile
144
145echo " * pcap -> pcapfile"
146rm -f traces/*.out.*
147do_test ./test-convert pcap pcapfile
148
149echo " * erf -> pcapfile"
150rm -f traces/*.out.*
151do_test ./test-convert erf pcapfile
[afaf6e8]152
153echo " * pcap (sll) -> erf    raw IP"
154rm -f traces/*.out.*
155do_test ./test-convert sll1 erf
156
157echo " * pcap (sll) -> erf    loopback"
158rm -f traces/*.out.*
159do_test ./test-convert sll2 erf
160
161
[7a27af0]162#./test-convert rtclient erf
163#./test-convert rtclient pcap
164
165# This doesn't work because pcap doesn't support legacyatm's linktype
166# so the packet is converted to a raw IP packet, which when read
167# back in again doesn't match legacyatm's original packet.
168#echo " * legacyatm -> pcapfile"
169#rm -f traces/*.out.*
170#./test-convert legacyatm pcapfile
171
172echo " * legacyeth -> pcapfile"
173rm -f traces/*.out.*
174do_test ./test-convert legacyeth pcapfile
175
176echo " * legacypos -> pcapfile"
177rm -f traces/*.out.*
178do_test ./test-convert legacypos pcapfile
179
180echo " * duck -> duck"
181rm -f traces/*.out.*
182do_test ./test-convert duck duck
183
184echo " * tsh -> pcapfile"
185rm -f traces/*.out.*
186do_test ./test-convert tsh pcapfile
187
188echo " * tsh -> pcap"
189rm -f traces/*.out.*
190do_test ./test-convert tsh pcap
191
[8bd2bbf]192echo " * format autodetection - uncompressed"
[8782b67]193do_test ./test-autodetect traces/5_packets.erf
[8bd2bbf]194echo " * format autodetection - gzip"
[8782b67]195do_test ./test-autodetect traces/5_packets.erf.gz
[8bd2bbf]196echo " * format autodetection - bzip2"
197do_test ./test-autodetect traces/5_packets.erf.bz2
[8782b67]198
[7a27af0]199echo
200echo "Tests passed: $OK"
201echo "Tests failed: $FAIL"
Note: See TracBrowser for help on using the repository browser.