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