]> git.proxmox.com Git - mirror_ovs.git/blame - tests/library.at
test: Reverse the order of commands added by ON_EXIT macro
[mirror_ovs.git] / tests / library.at
CommitLineData
1b233b95
BP
1AT_BANNER([library unit tests])
2
3AT_SETUP([test flow extractor])
4AT_CHECK([$PERL `which flowgen.pl` >/dev/null 3>flows 4>pcap])
e60367e2 5AT_CHECK([ovstest test-flows flows pcap], [0], [checked 247 packets, 0 errors
1b233b95
BP
6])
7AT_CLEANUP
8
9AT_SETUP([test TCP/IP checksumming])
eadd1644 10AT_CHECK([ovstest test-csum], [0], [....#....#....###................................#................................#
7fcfe998 11])
1b233b95
BP
12AT_CLEANUP
13
1b233b95 14AT_SETUP([test hash functions])
eadd1644 15AT_CHECK([ovstest test-hash])
1b233b95
BP
16AT_CLEANUP
17
18AT_SETUP([test hash map])
0e666160 19AT_KEYWORDS([hmap])
eadd1644 20AT_CHECK([ovstest test-hmap], [0], [.........
7fcfe998 21])
1b233b95
BP
22AT_CLEANUP
23
822b7f52 24AT_SETUP([test hash index])
0e666160 25AT_KEYWORDS([hindex])
eadd1644 26AT_CHECK([ovstest test-hindex], [0], [.....................
822b7f52
BP
27])
28AT_CLEANUP
29
0e666160
BP
30AT_SETUP([test cuckoo hash])
31AT_KEYWORDS([cmap])
32AT_CHECK([ovstest test-cmap check 1], [0], [...
33])
34AT_CLEANUP
35
31a3fc6e 36AT_SETUP([test atomic operations])
eadd1644 37AT_CHECK([ovstest test-atomic])
31a3fc6e
BP
38AT_CLEANUP
39
1b233b95 40AT_SETUP([test linked lists])
eadd1644 41AT_CHECK([ovstest test-list], [0], [..
7fcfe998 42])
1b233b95
BP
43AT_CLEANUP
44
f696f12f 45AT_SETUP([test packet library])
eadd1644 46AT_CHECK([ovstest test-packets])
f696f12f
JP
47AT_CLEANUP
48
1b233b95 49AT_SETUP([test SHA-1])
eadd1644 50AT_CHECK([ovstest test-sha1], [0], [.........
7fcfe998 51])
1b233b95
BP
52AT_CLEANUP
53
54AT_SETUP([test type properties])
7fcfe998 55AT_CHECK([test-type-props])
1b233b95 56AT_CLEANUP
78f172aa
BP
57
58AT_SETUP([test strtok_r bug fix])
7fcfe998
BP
59AT_CHECK([test-strtok_r], [0], [NULL NULL
60])
78f172aa 61AT_CLEANUP
965f03d8
BP
62
63AT_SETUP([test byte order conversion])
10a24935 64AT_KEYWORDS([byte order])
eadd1644 65AT_CHECK([ovstest test-byte-order])
965f03d8 66AT_CLEANUP
6e170b4c 67
78f3f316 68AT_SETUP([test random number generator])
eadd1644 69AT_CHECK([ovstest test-random], [0], [dnl
78f3f316
BP
70average=7fa2014f
71
72bit 0 1
73 0 4946 5054
74 1 4939 5061
75 2 4947 5053
76 3 4935 5065
77 4 5004 4996
78 5 4998 5002
79 6 5062 4938
80 7 5009 4991
81 8 5001 4999
82 9 5022 4978
83 10 5006 4994
84 11 5039 4961
85 12 4940 5060
86 13 5048 4952
87 14 4930 5070
88 15 4973 5027
89 16 4954 5046
90 17 5043 4957
91 18 5020 4980
92 19 5104 4896
93 20 5051 4949
94 21 5003 4997
95 22 5110 4890
96 23 4950 5050
97 24 5016 4984
98 25 5019 4981
99 26 4948 5052
100 27 4995 5005
101 28 4995 5005
102 29 4969 5031
103 30 5109 4891
104 31 4984 5016
105(expected values are 5000)
106
107nibble 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
108 0 640 589 610 613 588 632 650 613 582 646 627 640 612 650 637 671
109 1 626 642 663 620 630 609 617 602 615 638 614 644 641 597 598 644
110 2 667 611 617 613 609 629 642 651 604 641 594 659 651 610 617 585
111 3 621 662 594 605 618 644 616 613 613 616 611 608 614 660 653 652
112 4 641 668 621 664 619 624 625 642 624 629 607 566 599 639 618 614
113 5 666 629 620 621 581 615 598 620 630 651 671 622 628 603 657 588
114 6 620 640 621 606 603 644 628 633 620 597 653 591 637 658 634 615
115 7 636 645 679 593 598 609 612 612 623 626 638 669 603 629 606 622
116(expected values are 625)
117])
118AT_CLEANUP
119
8c2296a6
BP
120m4_foreach(
121 [testname],
122 [[ctz],
8c947903 123 [clz],
e93ab553
BP
124 [round_up_pow2],
125 [round_down_pow2],
fb9aefa3 126 [count_1bits],
8c2296a6
BP
127 [log_2_floor],
128 [bitwise_copy],
129 [bitwise_zero],
130 [bitwise_one],
ed2232fc
BP
131 [bitwise_is_all_zeros],
132 [ovs_scan]],
8c2296a6 133 [AT_SETUP([testname[()] function])
a656cb77 134 AT_KEYWORDS([testname])
eadd1644 135 AT_CHECK([ovstest test-util testname], [0], [], [])
8c2296a6 136 AT_CLEANUP])
711e0157 137
cd57233c 138AT_SETUP([test unix socket, short pathname - C])
7882cfb1 139AT_SKIP_IF([test "$IS_WIN32" = "yes"])
eadd1644 140AT_CHECK([ovstest test-unix-socket x])
6e170b4c
BP
141AT_CLEANUP
142
143dnl Unix sockets with long names are problematic because the name has to
144dnl go in a fixed-length field in struct sockaddr_un. Generally the limit
145dnl is about 100 bytes. On Linux, we work around this by indirecting through
146dnl a directory fd using /proc/self/fd/<dirfd>. We do not have a workaround
147dnl for other platforms, so we skip the test there.
cd57233c 148AT_SETUP([test unix socket, long pathname - C])
7882cfb1 149AT_SKIP_IF([test "$IS_WIN32" = "yes"])
6e170b4c 150dnl Linux has a 108 byte limit; this is 150 bytes long.
fabbeb21
BP
151longname=012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
152mkdir $longname
153cd $longname
eadd1644 154AT_CHECK([ovstest test-unix-socket ../$longname/socket socket])
6e170b4c 155AT_CLEANUP
4749f73d 156
cd57233c 157AT_SETUP([test unix socket, short pathname - Python])
7882cfb1 158AT_SKIP_IF([test $HAVE_PYTHON = no || test "$IS_WIN32" = "yes"])
cd57233c
BP
159AT_CHECK([$PYTHON $srcdir/test-unix-socket.py x])
160AT_CLEANUP
161
162dnl Unix sockets with long names are problematic because the name has to
163dnl go in a fixed-length field in struct sockaddr_un. Generally the limit
164dnl is about 100 bytes. On Linux, we work around this by indirecting through
165dnl a directory fd using /proc/self/fd/<dirfd>. We do not have a workaround
166dnl for other platforms, so we skip the test there.
167AT_SETUP([test unix socket, long pathname - Python])
7882cfb1 168AT_SKIP_IF([test $HAVE_PYTHON = no || test "$IS_WIN32" = "yes"])
cd57233c
BP
169dnl Linux has a 108 byte limit; this is 150 bytes long.
170longname=012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
171mkdir $longname
172cd $longname
173AT_CHECK([$PYTHON $abs_srcdir/test-unix-socket.py ../$longname/socket socket])
174AT_CLEANUP
175
4749f73d
BP
176AT_SETUP([ovs_assert])
177OVS_LOGDIR=`pwd`; export OVS_LOGDIR
784acd82
GS
178if test "$IS_WIN32" = "yes"; then
179 exit_status=9
180else
181 # SIGABRT + 128
182 exit_status=134
183fi
184AT_CHECK([ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert],
185 [$exit_status], [], [stderr])
4749f73d
BP
186
187AT_CHECK([sed 's/\(opened log file\) .*/\1/
188s/|[[^|]]*: /|/' test-util.log], [0], [dnl
189vlog|INFO|opened log file
190util|EMER|assertion false failed in test_assert()
191])
192
193AT_CHECK([sed 's/.*: //
1941q' stderr], [0],
195 [assertion false failed in test_assert()
196])
197
198AT_CLEANUP
cde1c287
BP
199
200AT_SETUP([snprintf])
eadd1644 201AT_CHECK([ovstest test-util snprintf])
cde1c287 202AT_CLEANUP
f831a472
K
203
204AT_SETUP([test bitmap functions])
205AT_CHECK([ovstest test-bitmap check], [0], [..
206])
207AT_CLEANUP
acf72f13
TG
208
209AT_SETUP([use of public headers])
210AT_CHECK([test-lib], [0], [])
211AT_CLEANUP