3 .
"${TEST_SCRIPTS_DIR}/unit.sh"
5 out_file
="${TEST_VAR_DIR}/cunit/packet.out"
12 test_cleanup remove_file
14 d
=$
(dirname "$out_file")
17 ########################################
20 unit_test system_socket_test types
24 $VALGRIND system_socket_test arp
"$@" >"$out_file" ||
exit $?
25 od -A x
-t x1
"$out_file"
31 if [ "$os" = "Linux" ] ; then
32 unit_test_notrace arp_run
"$@"
34 ok
"PACKETSOCKET not supported"
35 unit_test system_socket_test arp
"$@"
40 000000 ff ff ff ff ff ff 12 34 56 78 9a bc 08 06 00 01
41 000010 08 00 06 04 00 01 12 34 56 78 9a bc c0 a8 01 19
42 000020 00 00 00 00 00 00 c0 a8 01 19 00 00 00 00 00 00
43 000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
46 arp_test
"192.168.1.25" "12:34:56:78:9a:bc"
49 000000 ff ff ff ff ff ff 12 34 56 78 9a bc 08 06 00 01
50 000010 08 00 06 04 00 02 12 34 56 78 9a bc c0 a8 01 19
51 000020 12 34 56 78 9a bc c0 a8 01 19 00 00 00 00 00 00
52 000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
55 arp_test
"192.168.1.25" "12:34:56:78:9a:bc" reply
58 000000 33 33 00 00 00 01 12 34 56 78 9a bc 86 dd 60 00
59 000010 00 00 00 20 3a ff fe 80 00 00 00 00 00 00 6a f7
60 000020 28 ff fe fa d1 36 ff 02 00 00 00 00 00 00 00 00
61 000030 00 00 00 00 00 01 88 00 8d e4 20 00 00 00 fe 80
62 000040 00 00 00 00 00 00 6a f7 28 ff fe fa d1 36 02 01
63 000050 12 34 56 78 9a bc
66 arp_test
"fe80::6af7:28ff:fefa:d136" "12:34:56:78:9a:bc"
70 $VALGRIND system_socket_test tcp
"$@" >"$out_file" ||
exit $?
71 od -A x
-t x1
"$out_file"
76 unit_test_notrace tcp_run
"$@"
80 000000 45 00 00 08 00 00 00 00 ff 06 00 00 c0 a8 01 19
81 000010 c0 a8 02 4b 01 bd d4 31 00 00 00 00 00 00 00 00
82 000020 50 10 04 d2 50 5f 00 00
85 tcp_test
"192.168.1.25:445" "192.168.2.75:54321" 0 0 0
88 000000 45 00 00 08 00 00 00 00 ff 06 00 00 c0 a8 01 19
89 000010 c0 a8 02 4b 01 bd d4 31 00 00 00 00 00 00 00 00
90 000020 50 14 04 d2 50 5b 00 00
93 tcp_test
"192.168.1.25:445" "192.168.2.75:54321" 0 0 1
96 000000 45 00 00 08 00 00 00 00 ff 06 00 00 c0 a8 01 19
97 000010 c0 a8 02 4b 01 bd d4 31 39 30 00 00 a0 5b 00 00
98 000020 50 14 04 d2 76 cf 00 00
101 tcp_test
"192.168.1.25:445" "192.168.2.75:54321" 12345 23456 1
104 000000 60 00 00 00 00 14 06 40 fe 80 00 00 00 00 00 00
105 000010 6a f7 28 ff fe fa d1 36 fe 80 00 00 00 00 00 00
106 000020 6a f7 28 ff fe fb d1 37 01 bd d4 31 00 00 00 00
107 000030 00 00 00 00 50 10 04 d2 0f c0 00 00
110 tcp_test
"fe80::6af7:28ff:fefa:d136:445" "fe80::6af7:28ff:fefb:d137:54321" 0 0 0
113 000000 60 00 00 00 00 14 06 40 fe 80 00 00 00 00 00 00
114 000010 6a f7 28 ff fe fa d1 36 fe 80 00 00 00 00 00 00
115 000020 6a f7 28 ff fe fb d1 37 01 bd d4 31 00 00 00 00
116 000030 00 00 00 00 50 14 04 d2 0f bc 00 00
119 tcp_test
"fe80::6af7:28ff:fefa:d136:445" "fe80::6af7:28ff:fefb:d137:54321" 0 0 1
122 000000 60 00 00 00 00 14 06 40 fe 80 00 00 00 00 00 00
123 000010 6a f7 28 ff fe fa d1 36 fe 80 00 00 00 00 00 00
124 000020 6a f7 28 ff fe fb d1 37 01 bd d4 31 39 30 00 00
125 000030 a0 5b 00 00 50 14 04 d2 36 30 00 00
128 tcp_test
"fe80::6af7:28ff:fefa:d136:445" \
129 "fe80::6af7:28ff:fefb:d137:54321" 12345 23456 1