1 AT_BANNER([library unit tests])
3 AT_SETUP([test flow extractor])
4 AT_CHECK([$PERL `which flowgen.pl` >/dev/null 3>flows 4>pcap])
5 AT_CHECK([ovstest test-flows flows pcap], [0], [checked 247 packets, 0 errors
9 AT_SETUP([test TCP/IP checksumming])
10 AT_CHECK([ovstest test-csum], [0], [....#....#....####................................#................................#
14 AT_SETUP([test hash functions])
15 AT_CHECK([ovstest test-hash])
18 AT_SETUP([test hash map])
20 AT_CHECK([ovstest test-hmap], [0], [.........
24 AT_SETUP([test hash index])
26 AT_CHECK([ovstest test-hindex], [0], [.....................
30 AT_SETUP([test cuckoo hash])
32 AT_CHECK([ovstest test-cmap check 1], [0], [...
36 AT_SETUP([test atomic operations])
37 AT_CHECK([ovstest test-atomic])
40 AT_SETUP([test linked lists])
41 AT_CHECK([ovstest test-list], [0], [...
45 AT_SETUP([test packet library])
46 AT_CHECK([ovstest test-packets])
49 AT_SETUP([test SHA-1])
50 AT_CHECK([ovstest test-sha1], [0], [.........
54 AT_SETUP([test type properties])
55 AT_CHECK([test-type-props])
58 AT_SETUP([test strtok_r bug fix])
59 AT_CHECK([test-strtok_r], [0], [NULL NULL
63 AT_SETUP([test byte order conversion])
64 AT_KEYWORDS([byte order])
65 AT_CHECK([ovstest test-byte-order])
68 AT_SETUP([test random number generator])
69 AT_CHECK([ovstest test-random], [0], [dnl
105 (expected values are 5000)
107 nibble 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)
131 [bitwise_is_all_zeros],
133 [AT_SETUP([testname[()] function])
134 AT_KEYWORDS([testname])
135 AT_CHECK([ovstest test-util testname], [0], [], [])
138 AT_SETUP([test unix socket, short pathname - C])
139 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
140 AT_CHECK([ovstest test-unix-socket x])
143 dnl Unix sockets with long names are problematic because the name has to
144 dnl go in a fixed-length field in struct sockaddr_un. Generally the limit
145 dnl is about 100 bytes. On Linux, we work around this by indirecting through
146 dnl a directory fd using /proc/self/fd/<dirfd>. We do not have a workaround
147 dnl for other platforms, so we skip the test there.
148 AT_SETUP([test unix socket, long pathname - C])
149 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
150 dnl Linux sockaddr_un has a 108-byte limit, so this needs to be longer.
151 dnl Linux "ecryptfs" has a 143-byte limit, so we use that many bytes.
152 longname=01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
154 dnl Skip the test if the directory can't be created (presumably the file
155 dnl system doesn't support such long names).
156 AT_CHECK([mkdir $longname || exit 77])
158 AT_CHECK([cd $longname && ovstest test-unix-socket ../$longname/socket socket])
161 m4_define([UNIX_SOCKET_SHORT_PATHNAME_PYN],
162 [AT_SETUP([test unix socket, short pathname - $1])
163 AT_SKIP_IF([test $2 = no || test "$IS_WIN32" = "yes"])
164 AT_KEYWORDS([python unixsocket])
165 AT_CHECK([$3 $srcdir/test-unix-socket.py x])
168 UNIX_SOCKET_SHORT_PATHNAME_PYN([Python2], [$HAVE_PYTHON], [$PYTHON])
169 UNIX_SOCKET_SHORT_PATHNAME_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
171 dnl Unix sockets with long names are problematic because the name has to
172 dnl go in a fixed-length field in struct sockaddr_un. Generally the limit
173 dnl is about 100 bytes. On Linux, we work around this by indirecting through
174 dnl a directory fd using /proc/self/fd/<dirfd>. We do not have a workaround
175 dnl for other platforms, so we skip the test there.
176 m4_define([UNIX_SOCKET_LONG_PATHNAME_PYN],
177 [AT_SETUP([test unix socket, long pathname - $1])
178 AT_SKIP_IF([test $2 = no || test "$IS_WIN32" = "yes"])
179 AT_KEYWORDS([python unixsocket])
180 dnl Linux sockaddr_un has a 108-byte limit, so this needs to be longer.
181 dnl Linux "ecryptfs" has a 143-byte limit, so we use that many bytes.
182 longname=01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
184 dnl Skip the test if the directory can't be created (presumably the file
185 dnl system doesn't support such long names).
186 AT_CHECK([mkdir $longname || exit 77])
187 AT_CHECK([cd $longname && $3 $abs_srcdir/test-unix-socket.py ../$longname/socket socket])
190 UNIX_SOCKET_LONG_PATHNAME_PYN([Python2], [$HAVE_PYTHON], [$PYTHON])
191 UNIX_SOCKET_LONG_PATHNAME_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
193 AT_SETUP([ovs_assert])
194 if test "$IS_WIN32" = "yes"; then
200 AT_CHECK([ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert],
201 [$exit_status], [], [stderr])
203 AT_CHECK([sed 's/\(opened log file\) .*/\1/
204 s/|[[^|]]*: /|/' test-util.log], [0], [dnl
205 vlog|INFO|opened log file
206 util|EMER|assertion false failed in test_assert()
209 AT_CHECK([sed 's/.*: //
211 [assertion false failed in test_assert()
217 AT_CHECK([ovstest test-util snprintf])
220 AT_SETUP([test bitmap functions])
221 AT_CHECK([ovstest test-bitmap check], [0], [..
225 AT_SETUP([use of public headers])
226 AT_CHECK([test-lib], [0], [])
229 AT_SETUP([test ofpbuf module])
230 AT_CHECK([ovstest test-ofpbuf], [0], [])