source: test/do-tests.sh @ e111394

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since e111394 was 7a27af0, checked in by Perry Lorier <perry@…>, 11 years ago

Move tests out of the Makefile and into a seperate shell script

  • Property mode set to 100755
File size: 3.5 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
20
21echo 802.1x decoder
22do_test ./test-decode2 pcap:traces/8021x.pcap
23
24echo MPLS Decoder
25do_test ./test-decode2 pcap:traces/10_mpls_ip.pcap
26
27echo Radius Decoder
28do_test ./test-decode2 pcap:traces/radius.pcap
29
30rm -f traces/*.out.*
31echo \* Read erf
32do_test ./test-format erf
33do_test ./test-decode erf
34
35echo \* Read pcap
36do_test ./test-format pcap
37do_test ./test-decode pcap
38
39echo \* Read pcapfile
40do_test ./test-format pcapfile
41do_test ./test-decode pcapfile
42
43echo \* Read legacyatm
44do_test ./test-format legacyatm
45do_test ./test-decode legacyatm
46
47echo \* Read legacyeth
48do_test ./test-format legacyeth
49do_test ./test-decode legacyeth
50
51echo \* Read legacypos
52do_test ./test-format legacypos
53do_test ./test-decode legacypos
54
55echo \* Read tsh
56do_test ./test-format tsh
57do_test ./test-decode tsh
58
59echo \* Testing pcap-bpf
60do_test ./test-pcap-bpf
61
62echo \* Testing event framework
63do_test ./test-event
64
65echo \* Testing time conversions
66do_test ./test-time
67
68echo \* Testing directions
69do_test ./test-dir
70
71echo \* Testing wireless
72do_test ./test-wireless
73
74echo \* Testing error handling
75do_test ./test-errors
76
77echo \* Testing drop counters for erf
78do_test ./test-drops erf
79
80echo \* Testing drop counters for pcapfile
81do_test ./test-drops pcapfile
82
83echo \* Testing drop counters for duck
84do_test ./test-drops duck
85
86echo \* Testing drop counters for legacyatm
87do_test ./test-drops legacyatm
88
89echo \* Testing drop counters for legacypos
90do_test ./test-drops legacypos
91
92echo \* Testing drop counters for legacyeth
93do_test ./test-drops legacyeth
94
95echo \* Testing drop counters for tsh
96do_test ./test-drops tsh
97
98echo \* Testing writing erf
99do_test ./test-write erf
100
101echo \* Testing write pcap
102do_test ./test-write pcap
103
104echo \* Testing write pcapfile
105do_test ./test-write pcapfile
106
107# Not all types are convertable, for instance libtrace doesn't
108# do rtclient output, and erf doesn't support 802.11
109echo \* Conversions
110echo " * erf -> erf"
111rm -f traces/*.out.*
112do_test ./test-convert erf erf
113
114echo " * erf -> pcap"
115do_test ./test-convert erf pcap
116
117echo " * pcap -> erf"
118rm -f traces/*.out.*
119do_test ./test-convert pcap erf
120
121echo " * pcapfile -> erf"
122rm -f traces/*.out.*
123do_test ./test-convert pcapfile erf
124
125echo " * pcapfile -> pcapfile"
126rm -f traces/*.out.*
127do_test ./test-convert pcapfile pcapfile
128
129echo " * pcap -> pcapfile"
130rm -f traces/*.out.*
131do_test ./test-convert pcap pcapfile
132
133echo " * erf -> pcapfile"
134rm -f traces/*.out.*
135do_test ./test-convert erf pcapfile
136#./test-convert rtclient erf
137#./test-convert rtclient pcap
138
139# This doesn't work because pcap doesn't support legacyatm's linktype
140# so the packet is converted to a raw IP packet, which when read
141# back in again doesn't match legacyatm's original packet.
142#echo " * legacyatm -> pcapfile"
143#rm -f traces/*.out.*
144#./test-convert legacyatm pcapfile
145
146echo " * legacyeth -> pcapfile"
147rm -f traces/*.out.*
148do_test ./test-convert legacyeth pcapfile
149
150echo " * legacypos -> pcapfile"
151rm -f traces/*.out.*
152do_test ./test-convert legacypos pcapfile
153
154echo " * duck -> duck"
155rm -f traces/*.out.*
156do_test ./test-convert duck duck
157
158echo " * tsh -> pcapfile"
159rm -f traces/*.out.*
160do_test ./test-convert tsh pcapfile
161
162echo " * tsh -> pcap"
163rm -f traces/*.out.*
164do_test ./test-convert tsh pcap
165
166echo
167echo "Tests passed: $OK"
168echo "Tests failed: $FAIL"
Note: See TracBrowser for help on using the repository browser.