AT_SETUP([test flow extractor])
AT_CHECK([$PERL `which flowgen.pl` >/dev/null 3>flows 4>pcap])
-OVS_CHECK_LCOV([test-flows <flows 3<pcap], [0], [checked 247 packets, 0 errors
+AT_CHECK([test-flows <flows 3<pcap], [0], [checked 247 packets, 0 errors
])
AT_CLEANUP
AT_SETUP([test TCP/IP checksumming])
-OVS_CHECK_LCOV([test-csum], [0], [ignore])
-AT_CLEANUP
-
-AT_SETUP([test flow classifier])
-AT_KEYWORDS([slow])
-OVS_CHECK_LCOV([test-classifier], [0], [ignore])
+AT_CHECK([test-csum], [0], [....#....#....###................................#................................#
+])
AT_CLEANUP
AT_SETUP([test hash functions])
-OVS_CHECK_LCOV([test-hash], [0], [ignore])
+AT_CHECK([test-hash])
AT_CLEANUP
AT_SETUP([test hash map])
-OVS_CHECK_LCOV([test-hmap], [0], [ignore])
+AT_CHECK([test-hmap], [0], [.........
+])
+AT_CLEANUP
+
+AT_SETUP([test hash index])
+AT_CHECK([test-hindex], [0], [.....................
+])
+AT_CLEANUP
+
+AT_SETUP([test atomic operations])
+AT_CHECK([test-atomic])
AT_CLEANUP
AT_SETUP([test linked lists])
-OVS_CHECK_LCOV([test-list], [0], [ignore])
+AT_CHECK([test-list], [0], [..
+])
+AT_CLEANUP
+
+AT_SETUP([test packet library])
+AT_CHECK([test-packets])
AT_CLEANUP
AT_SETUP([test SHA-1])
-OVS_CHECK_LCOV([test-sha1], [0], [ignore])
+AT_CHECK([test-sha1], [0], [.........
+])
AT_CLEANUP
AT_SETUP([test type properties])
-OVS_CHECK_LCOV([test-type-props], [0], [ignore])
+AT_CHECK([test-type-props])
+AT_CLEANUP
+
+AT_SETUP([test strtok_r bug fix])
+AT_CHECK([test-strtok_r], [0], [NULL NULL
+])
+AT_CLEANUP
+
+AT_SETUP([test byte order conversion])
+AT_KEYWORDS([byte order])
+AT_CHECK([test-byte-order])
+AT_CLEANUP
+
+AT_SETUP([test random number generator])
+AT_CHECK([test-random], [0], [dnl
+average=7fa2014f
+
+bit 0 1
+ 0 4946 5054
+ 1 4939 5061
+ 2 4947 5053
+ 3 4935 5065
+ 4 5004 4996
+ 5 4998 5002
+ 6 5062 4938
+ 7 5009 4991
+ 8 5001 4999
+ 9 5022 4978
+ 10 5006 4994
+ 11 5039 4961
+ 12 4940 5060
+ 13 5048 4952
+ 14 4930 5070
+ 15 4973 5027
+ 16 4954 5046
+ 17 5043 4957
+ 18 5020 4980
+ 19 5104 4896
+ 20 5051 4949
+ 21 5003 4997
+ 22 5110 4890
+ 23 4950 5050
+ 24 5016 4984
+ 25 5019 4981
+ 26 4948 5052
+ 27 4995 5005
+ 28 4995 5005
+ 29 4969 5031
+ 30 5109 4891
+ 31 4984 5016
+(expected values are 5000)
+
+nibble 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ 0 640 589 610 613 588 632 650 613 582 646 627 640 612 650 637 671
+ 1 626 642 663 620 630 609 617 602 615 638 614 644 641 597 598 644
+ 2 667 611 617 613 609 629 642 651 604 641 594 659 651 610 617 585
+ 3 621 662 594 605 618 644 616 613 613 616 611 608 614 660 653 652
+ 4 641 668 621 664 619 624 625 642 624 629 607 566 599 639 618 614
+ 5 666 629 620 621 581 615 598 620 630 651 671 622 628 603 657 588
+ 6 620 640 621 606 603 644 628 633 620 597 653 591 637 658 634 615
+ 7 636 645 679 593 598 609 612 612 623 626 638 669 603 629 606 622
+(expected values are 625)
+])
+AT_CLEANUP
+
+m4_foreach(
+ [testname],
+ [[ctz],
+ [clz],
+ [round_up_pow2],
+ [round_down_pow2],
+ [count_1bits],
+ [log_2_floor],
+ [bitwise_copy],
+ [bitwise_zero],
+ [bitwise_one],
+ [bitwise_is_all_zeros],
+ [ovs_scan]],
+ [AT_SETUP([testname[()] function])
+ AT_KEYWORDS([testname])
+ AT_CHECK([test-util testname], [0], [], [])
+ AT_CLEANUP])
+
+AT_SETUP([test unix socket, short pathname - C])
+AT_CHECK([test-unix-socket x])
+AT_CLEANUP
+
+dnl Unix sockets with long names are problematic because the name has to
+dnl go in a fixed-length field in struct sockaddr_un. Generally the limit
+dnl is about 100 bytes. On Linux, we work around this by indirecting through
+dnl a directory fd using /proc/self/fd/<dirfd>. We do not have a workaround
+dnl for other platforms, so we skip the test there.
+AT_SETUP([test unix socket, long pathname - C])
+dnl Linux has a 108 byte limit; this is 150 bytes long.
+longname=012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+mkdir $longname
+cd $longname
+AT_CHECK([test-unix-socket ../$longname/socket socket])
+AT_CLEANUP
+
+AT_SETUP([test unix socket, short pathname - Python])
+AT_SKIP_IF([test $HAVE_PYTHON = no])
+AT_CHECK([$PYTHON $srcdir/test-unix-socket.py x])
+AT_CLEANUP
+
+dnl Unix sockets with long names are problematic because the name has to
+dnl go in a fixed-length field in struct sockaddr_un. Generally the limit
+dnl is about 100 bytes. On Linux, we work around this by indirecting through
+dnl a directory fd using /proc/self/fd/<dirfd>. We do not have a workaround
+dnl for other platforms, so we skip the test there.
+AT_SETUP([test unix socket, long pathname - Python])
+AT_SKIP_IF([test $HAVE_PYTHON = no])
+dnl Linux has a 108 byte limit; this is 150 bytes long.
+longname=012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+mkdir $longname
+cd $longname
+AT_CHECK([$PYTHON $abs_srcdir/test-unix-socket.py ../$longname/socket socket])
+AT_CLEANUP
+
+AT_SETUP([ovs_assert])
+OVS_LOGDIR=`pwd`; export OVS_LOGDIR
+AT_CHECK([test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert || kill -l $?],
+ [0], [ABRT
+], [stderr])
+
+AT_CHECK([sed 's/\(opened log file\) .*/\1/
+s/|[[^|]]*: /|/' test-util.log], [0], [dnl
+vlog|INFO|opened log file
+util|EMER|assertion false failed in test_assert()
+])
+
+AT_CHECK([sed 's/.*: //
+1q' stderr], [0],
+ [assertion false failed in test_assert()
+])
+
+AT_CLEANUP
+
+AT_SETUP([snprintf])
+AT_CHECK([test-util snprintf])
AT_CLEANUP