socket-util: Work around Unix domain socket path name limits on Linux.
[sliver-openvswitch.git] / tests / library.at
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])
5 AT_CHECK([test-flows <flows 3<pcap], [0], [checked 247 packets, 0 errors
6 ])
7 AT_CLEANUP
8
9 AT_SETUP([test TCP/IP checksumming])
10 AT_CHECK([test-csum], [0], [ignore])
11 AT_CLEANUP
12
13 AT_SETUP([test hash functions])
14 AT_CHECK([test-hash], [0], [ignore])
15 AT_CLEANUP
16
17 AT_SETUP([test hash map])
18 AT_CHECK([test-hmap], [0], [ignore])
19 AT_CLEANUP
20
21 AT_SETUP([test linked lists])
22 AT_CHECK([test-list], [0], [ignore])
23 AT_CLEANUP
24
25 AT_SETUP([test SHA-1])
26 AT_CHECK([test-sha1], [0], [ignore])
27 AT_CLEANUP
28
29 AT_SETUP([test type properties])
30 AT_CHECK([test-type-props], [0], [ignore])
31 AT_CLEANUP
32
33 AT_SETUP([test strtok_r bug fix])
34 AT_CHECK([test-strtok_r], [0], [ignore])
35 AT_CLEANUP
36
37 AT_SETUP([test byte order conversion])
38 AT_KEYWORDS([byte order])
39 AT_CHECK([test-byte-order], [0], [ignore])
40 AT_CLEANUP
41
42 AT_SETUP([test unix socket -- short pathname])
43 AT_CHECK([test-unix-socket x])
44 AT_CLEANUP
45
46 dnl Unix sockets with long names are problematic because the name has to
47 dnl go in a fixed-length field in struct sockaddr_un.  Generally the limit
48 dnl is about 100 bytes.  On Linux, we work around this by indirecting through
49 dnl a directory fd using /proc/self/fd/<dirfd>.  We do not have a workaround
50 dnl for other platforms, so we skip the test there.
51 AT_SETUP([test unix socket -- long pathname])
52 AT_CHECK([dnl
53     case `uname` in dnl (
54       *[[lL]]inux*)
55         exit 0
56         ;; dnl (
57       *)
58         dnl Magic exit code to tell Autotest to skip this test.
59         exit 77
60         ;;
61     esac
62 ])
63 dnl Linux has a 108 byte limit; this is 150 bytes long.
64 mkdir 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
65 cd 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
66 AT_CHECK([test-unix-socket ../012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/socket socket])
67 AT_CLEANUP