]> git.proxmox.com Git - mirror_ovs.git/blame - tests/library.at
db-ctl-base: Add {in} and {not-in} set relational operators.
[mirror_ovs.git] / tests / library.at
CommitLineData
1b233b95
BP
1AT_BANNER([library unit tests])
2
1cece4ad 3AT_SETUP([flow extractor])
1ca0323e 4AT_CHECK([$PYTHON3 $srcdir/flowgen.py >/dev/null])
e60367e2 5AT_CHECK([ovstest test-flows flows pcap], [0], [checked 247 packets, 0 errors
1b233b95
BP
6])
7AT_CLEANUP
8
1cece4ad 9AT_SETUP([TCP/IP checksumming])
0292a0c9 10AT_CHECK([ovstest test-csum], [0], [....#....#....####................................#................................#
7fcfe998 11])
1b233b95
BP
12AT_CLEANUP
13
1cece4ad 14AT_SETUP([hash functions])
eadd1644 15AT_CHECK([ovstest test-hash])
1b233b95
BP
16AT_CLEANUP
17
1cece4ad 18AT_SETUP([hash map])
0e666160 19AT_KEYWORDS([hmap])
4ec3d7c7 20AT_CHECK([ovstest test-hmap], [0], [............
7fcfe998 21])
1b233b95
BP
22AT_CLEANUP
23
1cece4ad 24AT_SETUP([hash index])
0e666160 25AT_KEYWORDS([hindex])
eadd1644 26AT_CHECK([ovstest test-hindex], [0], [.....................
822b7f52
BP
27])
28AT_CLEANUP
29
1cece4ad 30AT_SETUP([cuckoo hash])
0e666160
BP
31AT_KEYWORDS([cmap])
32AT_CHECK([ovstest test-cmap check 1], [0], [...
33])
34AT_CLEANUP
35
956ffcbd 36AT_SETUP([counting cuckoo hash])
1c4dd424
JR
37AT_KEYWORDS([cmap])
38AT_CHECK([ovstest test-ccmap check 1], [0], [...
39])
40AT_CLEANUP
41
1cece4ad 42AT_SETUP([atomic operations])
eadd1644 43AT_CHECK([ovstest test-atomic])
31a3fc6e
BP
44AT_CLEANUP
45
aa1fc801
RBE
46AT_SETUP([test linked lists])
47AT_CHECK([ovstest test-list], [0], [....
7fcfe998 48])
1b233b95
BP
49AT_CLEANUP
50
1cece4ad 51AT_SETUP([packet library])
eadd1644 52AT_CHECK([ovstest test-packets])
f696f12f
JP
53AT_CLEANUP
54
1cece4ad 55AT_SETUP([SHA-1])
37423e4d
IM
56AT_KEYWORDS([sha1])
57AT_CHECK([ovstest test-sha1], [0], [..........
7fcfe998 58])
1b233b95
BP
59AT_CLEANUP
60
6c2705cd
LR
61AT_SETUP([test skiplist])
62AT_KEYWORDS([skiplist])
63AT_CHECK([ovstest test-skiplist], [0], [skiplist insert
64skiplist delete
65skiplist find
66skiplist forward_to
67skiplist random
68
69])
70AT_CLEANUP
71
1cece4ad 72AT_SETUP([type properties])
7fcfe998 73AT_CHECK([test-type-props])
1b233b95 74AT_CLEANUP
78f172aa 75
1cece4ad 76AT_SETUP([strtok_r bug fix])
7fcfe998
BP
77AT_CHECK([test-strtok_r], [0], [NULL NULL
78])
78f172aa 79AT_CLEANUP
965f03d8 80
1cece4ad 81AT_SETUP([byte order conversion])
10a24935 82AT_KEYWORDS([byte order])
eadd1644 83AT_CHECK([ovstest test-byte-order])
965f03d8 84AT_CLEANUP
6e170b4c 85
1cece4ad 86AT_SETUP([random number generator])
eadd1644 87AT_CHECK([ovstest test-random], [0], [dnl
78f3f316
BP
88average=7fa2014f
89
90bit 0 1
91 0 4946 5054
92 1 4939 5061
93 2 4947 5053
94 3 4935 5065
95 4 5004 4996
96 5 4998 5002
97 6 5062 4938
98 7 5009 4991
99 8 5001 4999
100 9 5022 4978
101 10 5006 4994
102 11 5039 4961
103 12 4940 5060
104 13 5048 4952
105 14 4930 5070
106 15 4973 5027
107 16 4954 5046
108 17 5043 4957
109 18 5020 4980
110 19 5104 4896
111 20 5051 4949
112 21 5003 4997
113 22 5110 4890
114 23 4950 5050
115 24 5016 4984
116 25 5019 4981
117 26 4948 5052
118 27 4995 5005
119 28 4995 5005
120 29 4969 5031
121 30 5109 4891
122 31 4984 5016
123(expected values are 5000)
124
125nibble 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
126 0 640 589 610 613 588 632 650 613 582 646 627 640 612 650 637 671
127 1 626 642 663 620 630 609 617 602 615 638 614 644 641 597 598 644
128 2 667 611 617 613 609 629 642 651 604 641 594 659 651 610 617 585
129 3 621 662 594 605 618 644 616 613 613 616 611 608 614 660 653 652
130 4 641 668 621 664 619 624 625 642 624 629 607 566 599 639 618 614
131 5 666 629 620 621 581 615 598 620 630 651 671 622 628 603 657 588
132 6 620 640 621 606 603 644 628 633 620 597 653 591 637 658 634 615
133 7 636 645 679 593 598 609 612 612 623 626 638 669 603 629 606 622
134(expected values are 625)
135])
136AT_CLEANUP
137
8c2296a6
BP
138m4_foreach(
139 [testname],
140 [[ctz],
8c947903 141 [clz],
e93ab553
BP
142 [round_up_pow2],
143 [round_down_pow2],
fb9aefa3 144 [count_1bits],
8c2296a6
BP
145 [log_2_floor],
146 [bitwise_copy],
147 [bitwise_zero],
148 [bitwise_one],
ed2232fc 149 [bitwise_is_all_zeros],
76adea87 150 [bitwise_rscan],
ed2232fc 151 [ovs_scan]],
8c2296a6 152 [AT_SETUP([testname[()] function])
a656cb77 153 AT_KEYWORDS([testname])
eadd1644 154 AT_CHECK([ovstest test-util testname], [0], [], [])
8c2296a6 155 AT_CLEANUP])
711e0157 156
1cece4ad 157AT_SETUP([unix socket, short pathname - C])
7882cfb1 158AT_SKIP_IF([test "$IS_WIN32" = "yes"])
eadd1644 159AT_CHECK([ovstest test-unix-socket x])
6e170b4c
BP
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.
1cece4ad 167AT_SETUP([unix socket, long pathname - C])
7882cfb1 168AT_SKIP_IF([test "$IS_WIN32" = "yes"])
c6bd5e91
BP
169dnl Linux sockaddr_un has a 108-byte limit, so this needs to be longer.
170dnl Linux "ecryptfs" has a 143-byte limit, so we use that many bytes.
171longname=01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
172
173dnl Skip the test if the directory can't be created (presumably the file
174dnl system doesn't support such long names).
175AT_CHECK([mkdir $longname || exit 77])
176
177AT_CHECK([cd $longname && ovstest test-unix-socket ../$longname/socket socket])
6e170b4c 178AT_CLEANUP
4749f73d 179
1ca0323e
BP
180AT_SETUP([unix socket, short pathname - Python3])
181AT_SKIP_IF([test "$IS_WIN32" = "yes"])
182AT_KEYWORDS([python unixsocket])
183AT_CHECK([$PYTHON3 $srcdir/test-unix-socket.py x])
184AT_CLEANUP
cd57233c
BP
185
186dnl Unix sockets with long names are problematic because the name has to
187dnl go in a fixed-length field in struct sockaddr_un. Generally the limit
188dnl is about 100 bytes. On Linux, we work around this by indirecting through
189dnl a directory fd using /proc/self/fd/<dirfd>. We do not have a workaround
190dnl for other platforms, so we skip the test there.
1ca0323e
BP
191AT_SETUP([unix socket, long pathname - Python3])
192AT_SKIP_IF([test "$IS_WIN32" = "yes"])
193AT_KEYWORDS([python unixsocket])
194dnl Linux sockaddr_un has a 108-byte limit, so this needs to be longer.
195dnl Linux "ecryptfs" has a 143-byte limit, so we use that many bytes.
196longname=01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
c6bd5e91 197
1ca0323e
BP
198dnl Skip the test if the directory can't be created (presumably the file
199dnl system doesn't support such long names).
200AT_CHECK([mkdir $longname || exit 77])
201AT_CHECK([cd $longname && $PYTHON3 $abs_srcdir/test-unix-socket.py ../$longname/socket socket])
202AT_CLEANUP
cd57233c 203
4749f73d 204AT_SETUP([ovs_assert])
784acd82
GS
205if test "$IS_WIN32" = "yes"; then
206 exit_status=9
207else
208 # SIGABRT + 128
209 exit_status=134
210fi
211AT_CHECK([ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert],
212 [$exit_status], [], [stderr])
4749f73d
BP
213
214AT_CHECK([sed 's/\(opened log file\) .*/\1/
215s/|[[^|]]*: /|/' test-util.log], [0], [dnl
216vlog|INFO|opened log file
217util|EMER|assertion false failed in test_assert()
218])
219
220AT_CHECK([sed 's/.*: //
2211q' stderr], [0],
222 [assertion false failed in test_assert()
223])
224
225AT_CLEANUP
cde1c287 226
74142432
BP
227AT_SETUP([saturating arithmetic])
228AT_KEYWORDS([sat math sat_math])
229AT_CHECK([ovstest test-util sat_math])
230AT_CLEANUP
231
cde1c287 232AT_SETUP([snprintf])
eadd1644 233AT_CHECK([ovstest test-util snprintf])
cde1c287 234AT_CLEANUP
f831a472 235
1cece4ad 236AT_SETUP([bitmap functions])
f831a472
K
237AT_CHECK([ovstest test-bitmap check], [0], [..
238])
239AT_CLEANUP
acf72f13
TG
240
241AT_SETUP([use of public headers])
242AT_CHECK([test-lib], [0], [])
243AT_CLEANUP
38876d31 244
1cece4ad 245AT_SETUP([ofpbuf module])
38876d31
AW
246AT_CHECK([ovstest test-ofpbuf], [0], [])
247AT_CLEANUP
13b6d087 248
1cece4ad 249AT_SETUP([rcu])
13b6d087
DDP
250AT_CHECK([ovstest test-rcu-quiesce], [0], [])
251AT_CLEANUP
44c82814
JS
252
253AT_SETUP([stopwatch module])
254AT_CHECK([ovstest test-stopwatch], [0], [......
255], [ignore])
256AT_CLEANUP