]>
Commit | Line | Data |
---|---|---|
1b233b95 BP |
1 | AT_BANNER([library unit tests]) |
2 | ||
3 | AT_SETUP([test flow extractor]) | |
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 | ||
9 | AT_SETUP([test TCP/IP checksumming]) | |
eadd1644 | 10 | AT_CHECK([ovstest test-csum], [0], [....#....#....###................................#................................# |
7fcfe998 | 11 | ]) |
1b233b95 BP |
12 | AT_CLEANUP |
13 | ||
1b233b95 | 14 | AT_SETUP([test hash functions]) |
eadd1644 | 15 | AT_CHECK([ovstest test-hash]) |
1b233b95 BP |
16 | AT_CLEANUP |
17 | ||
18 | AT_SETUP([test hash map]) | |
0e666160 | 19 | AT_KEYWORDS([hmap]) |
eadd1644 | 20 | AT_CHECK([ovstest test-hmap], [0], [......... |
7fcfe998 | 21 | ]) |
1b233b95 BP |
22 | AT_CLEANUP |
23 | ||
822b7f52 | 24 | AT_SETUP([test hash index]) |
0e666160 | 25 | AT_KEYWORDS([hindex]) |
eadd1644 | 26 | AT_CHECK([ovstest test-hindex], [0], [..................... |
822b7f52 BP |
27 | ]) |
28 | AT_CLEANUP | |
29 | ||
0e666160 BP |
30 | AT_SETUP([test cuckoo hash]) |
31 | AT_KEYWORDS([cmap]) | |
32 | AT_CHECK([ovstest test-cmap check 1], [0], [... | |
33 | ]) | |
34 | AT_CLEANUP | |
35 | ||
31a3fc6e | 36 | AT_SETUP([test atomic operations]) |
eadd1644 | 37 | AT_CHECK([ovstest test-atomic]) |
31a3fc6e BP |
38 | AT_CLEANUP |
39 | ||
1b233b95 | 40 | AT_SETUP([test linked lists]) |
eadd1644 | 41 | AT_CHECK([ovstest test-list], [0], [.. |
7fcfe998 | 42 | ]) |
1b233b95 BP |
43 | AT_CLEANUP |
44 | ||
f696f12f | 45 | AT_SETUP([test packet library]) |
eadd1644 | 46 | AT_CHECK([ovstest test-packets]) |
f696f12f JP |
47 | AT_CLEANUP |
48 | ||
1b233b95 | 49 | AT_SETUP([test SHA-1]) |
eadd1644 | 50 | AT_CHECK([ovstest test-sha1], [0], [......... |
7fcfe998 | 51 | ]) |
1b233b95 BP |
52 | AT_CLEANUP |
53 | ||
54 | AT_SETUP([test type properties]) | |
7fcfe998 | 55 | AT_CHECK([test-type-props]) |
1b233b95 | 56 | AT_CLEANUP |
78f172aa BP |
57 | |
58 | AT_SETUP([test strtok_r bug fix]) | |
7fcfe998 BP |
59 | AT_CHECK([test-strtok_r], [0], [NULL NULL |
60 | ]) | |
78f172aa | 61 | AT_CLEANUP |
965f03d8 BP |
62 | |
63 | AT_SETUP([test byte order conversion]) | |
10a24935 | 64 | AT_KEYWORDS([byte order]) |
eadd1644 | 65 | AT_CHECK([ovstest test-byte-order]) |
965f03d8 | 66 | AT_CLEANUP |
6e170b4c | 67 | |
78f3f316 | 68 | AT_SETUP([test random number generator]) |
eadd1644 | 69 | AT_CHECK([ovstest test-random], [0], [dnl |
78f3f316 BP |
70 | average=7fa2014f |
71 | ||
72 | bit 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 | ||
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) | |
117 | ]) | |
118 | AT_CLEANUP | |
119 | ||
8c2296a6 BP |
120 | m4_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 | 138 | AT_SETUP([test unix socket, short pathname - C]) |
7882cfb1 | 139 | AT_SKIP_IF([test "$IS_WIN32" = "yes"]) |
eadd1644 | 140 | AT_CHECK([ovstest test-unix-socket x]) |
6e170b4c BP |
141 | AT_CLEANUP |
142 | ||
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. | |
cd57233c | 148 | AT_SETUP([test unix socket, long pathname - C]) |
7882cfb1 | 149 | AT_SKIP_IF([test "$IS_WIN32" = "yes"]) |
6e170b4c | 150 | dnl Linux has a 108 byte limit; this is 150 bytes long. |
fabbeb21 BP |
151 | longname=012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 |
152 | mkdir $longname | |
153 | cd $longname | |
eadd1644 | 154 | AT_CHECK([ovstest test-unix-socket ../$longname/socket socket]) |
6e170b4c | 155 | AT_CLEANUP |
4749f73d | 156 | |
cd57233c | 157 | AT_SETUP([test unix socket, short pathname - Python]) |
7882cfb1 | 158 | AT_SKIP_IF([test $HAVE_PYTHON = no || test "$IS_WIN32" = "yes"]) |
cd57233c BP |
159 | AT_CHECK([$PYTHON $srcdir/test-unix-socket.py x]) |
160 | AT_CLEANUP | |
161 | ||
162 | dnl Unix sockets with long names are problematic because the name has to | |
163 | dnl go in a fixed-length field in struct sockaddr_un. Generally the limit | |
164 | dnl is about 100 bytes. On Linux, we work around this by indirecting through | |
165 | dnl a directory fd using /proc/self/fd/<dirfd>. We do not have a workaround | |
166 | dnl for other platforms, so we skip the test there. | |
167 | AT_SETUP([test unix socket, long pathname - Python]) | |
7882cfb1 | 168 | AT_SKIP_IF([test $HAVE_PYTHON = no || test "$IS_WIN32" = "yes"]) |
cd57233c BP |
169 | dnl Linux has a 108 byte limit; this is 150 bytes long. |
170 | longname=012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 | |
171 | mkdir $longname | |
172 | cd $longname | |
173 | AT_CHECK([$PYTHON $abs_srcdir/test-unix-socket.py ../$longname/socket socket]) | |
174 | AT_CLEANUP | |
175 | ||
4749f73d BP |
176 | AT_SETUP([ovs_assert]) |
177 | OVS_LOGDIR=`pwd`; export OVS_LOGDIR | |
784acd82 GS |
178 | if test "$IS_WIN32" = "yes"; then |
179 | exit_status=9 | |
180 | else | |
181 | # SIGABRT + 128 | |
182 | exit_status=134 | |
183 | fi | |
184 | AT_CHECK([ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert], | |
185 | [$exit_status], [], [stderr]) | |
4749f73d BP |
186 | |
187 | AT_CHECK([sed 's/\(opened log file\) .*/\1/ | |
188 | s/|[[^|]]*: /|/' test-util.log], [0], [dnl | |
189 | vlog|INFO|opened log file | |
190 | util|EMER|assertion false failed in test_assert() | |
191 | ]) | |
192 | ||
193 | AT_CHECK([sed 's/.*: // | |
194 | 1q' stderr], [0], | |
195 | [assertion false failed in test_assert() | |
196 | ]) | |
197 | ||
198 | AT_CLEANUP | |
cde1c287 BP |
199 | |
200 | AT_SETUP([snprintf]) | |
eadd1644 | 201 | AT_CHECK([ovstest test-util snprintf]) |
cde1c287 | 202 | AT_CLEANUP |
f831a472 K |
203 | |
204 | AT_SETUP([test bitmap functions]) | |
205 | AT_CHECK([ovstest test-bitmap check], [0], [.. | |
206 | ]) | |
207 | AT_CLEANUP | |
acf72f13 TG |
208 | |
209 | AT_SETUP([use of public headers]) | |
210 | AT_CHECK([test-lib], [0], []) | |
211 | AT_CLEANUP |