Lines Matching +full:pass +full:- +full:1

2 # SPDX-License-Identifier: GPL-2.0
5 # TOPO: CLIENT_NS1 (veth1) <---> (veth1) -> vrf_s1
7 # CLIENT_NS2 (veth1) <---> (veth2) -> vrf_s2
9 CLIENT_NS1="client-ns1"
10 CLIENT_NS2="client-ns2"
12 CLIENT_IP6="2000::1"
15 SERVER_NS="server-ns"
27 ip net exec $CLIENT_NS1 sysctl -w net.ipv6.conf.default.accept_dad=0 2>&1 >/dev/null
28 ip net exec $CLIENT_NS2 sysctl -w net.ipv6.conf.default.accept_dad=0 2>&1 >/dev/null
29 ip net exec $SERVER_NS sysctl -w net.ipv6.conf.default.accept_dad=0 2>&1 >/dev/null
31 ip -n $SERVER_NS link add veth1 type veth peer name veth1 netns $CLIENT_NS1
32 ip -n $SERVER_NS link add veth2 type veth peer name veth1 netns $CLIENT_NS2
34 ip -n $CLIENT_NS1 link set veth1 up
35 ip -n $CLIENT_NS1 addr add $CLIENT_IP4/24 dev veth1
36 ip -n $CLIENT_NS1 addr add $CLIENT_IP6/24 dev veth1
38 ip -n $CLIENT_NS2 link set veth1 up
39 ip -n $CLIENT_NS2 addr add $CLIENT_IP4/24 dev veth1
40 ip -n $CLIENT_NS2 addr add $CLIENT_IP6/24 dev veth1
42 ip -n $SERVER_NS link add dummy1 type dummy
43 ip -n $SERVER_NS link set dummy1 up
44 ip -n $SERVER_NS link add vrf-1 type vrf table 10
45 ip -n $SERVER_NS link add vrf-2 type vrf table 20
46 ip -n $SERVER_NS link set vrf-1 up
47 ip -n $SERVER_NS link set vrf-2 up
48 ip -n $SERVER_NS link set veth1 master vrf-1
49 ip -n $SERVER_NS link set veth2 master vrf-2
51 ip -n $SERVER_NS addr add $SERVER_IP4/24 dev dummy1
52 ip -n $SERVER_NS addr add $SERVER_IP4/24 dev veth1
53 ip -n $SERVER_NS addr add $SERVER_IP4/24 dev veth2
54 ip -n $SERVER_NS addr add $SERVER_IP6/24 dev dummy1
55 ip -n $SERVER_NS addr add $SERVER_IP6/24 dev veth1
56 ip -n $SERVER_NS addr add $SERVER_IP6/24 dev veth2
58 ip -n $SERVER_NS link set veth1 up
59 ip -n $SERVER_NS link set veth2 up
60 ip -n $SERVER_NS route add table 10 $CLIENT_IP4 dev veth1 src $SERVER_IP4
61 ip -n $SERVER_NS route add table 20 $CLIENT_IP4 dev veth2 src $SERVER_IP4
62 ip -n $SERVER_NS route add $CLIENT_IP4 dev veth1 src $SERVER_IP4
63 ip -n $SERVER_NS route add table 10 $CLIENT_IP6 dev veth1 src $SERVER_IP6
64 ip -n $SERVER_NS route add table 20 $CLIENT_IP6 dev veth2 src $SERVER_IP6
65 ip -n $SERVER_NS route add $CLIENT_IP6 dev veth1 src $SERVER_IP6
69 ip netns exec $SERVER_NS pkill sctp_hello 2>&1 >/dev/null
76 local IFACE=$1
79 until ip netns exec $SERVER_NS ss -lS src $SERVER_IP:$SERVER_PORT | \
80 grep LISTEN | grep "$IFACE" 2>&1 >/dev/null; do
87 local CLIENT_NS=$1
90 ip netns exec $SERVER_NS pkill sctp_hello 2>&1 >/dev/null
92 $SERVER_PORT $IFACE 2>&1 >/dev/null &
96 $SERVER_IP $SERVER_PORT $CLIENT_IP $CLIENT_PORT 2>&1 >/dev/null
102 local IFACE1=$1
105 ip netns exec $SERVER_NS pkill sctp_hello 2>&1 >/dev/null
107 $SERVER_PORT $IFACE1 2>&1 >/dev/null &
111 $SERVER_PORT $IFACE2 2>&1 >/dev/null &
115 $SERVER_IP $SERVER_PORT $CLIENT_IP $CLIENT_PORT 2>&1 >/dev/null && \
117 $SERVER_IP $SERVER_PORT $CLIENT_IP $CLIENT_PORT 2>&1 >/dev/null
123 ip netns exec $SERVER_NS sysctl -w net.sctp.l3mdev_accept=1 2>&1 >/dev/null
124 echo -n "TEST 01: nobind, connect from client 1, l3mdev_accept=1, Y "
126 echo "[PASS]"
128 echo -n "TEST 02: nobind, connect from client 2, l3mdev_accept=1, N "
130 echo "[PASS]"
132 ip netns exec $SERVER_NS sysctl -w net.sctp.l3mdev_accept=0 2>&1 >/dev/null
133 echo -n "TEST 03: nobind, connect from client 1, l3mdev_accept=0, N "
135 echo "[PASS]"
137 echo -n "TEST 04: nobind, connect from client 2, l3mdev_accept=0, N "
139 echo "[PASS]"
141 echo -n "TEST 05: bind veth2 in server, connect from client 1, N "
143 echo "[PASS]"
145 echo -n "TEST 06: bind veth1 in server, connect from client 1, Y "
147 echo "[PASS]"
149 echo -n "TEST 07: bind vrf-1 in server, connect from client 1, Y "
150 do_test $CLIENT_NS1 vrf-1 || { echo "[FAIL]"; return $RET; }
151 echo "[PASS]"
153 echo -n "TEST 08: bind vrf-2 in server, connect from client 1, N "
154 do_test $CLIENT_NS1 vrf-2 && { echo "[FAIL]"; return $RET; }
155 echo "[PASS]"
157 echo -n "TEST 09: bind vrf-2 in server, connect from client 2, Y "
158 do_test $CLIENT_NS2 vrf-2 || { echo "[FAIL]"; return $RET; }
159 echo "[PASS]"
161 echo -n "TEST 10: bind vrf-1 in server, connect from client 2, N "
162 do_test $CLIENT_NS2 vrf-1 && { echo "[FAIL]"; return $RET; }
163 echo "[PASS]"
165 echo -n "TEST 11: bind vrf-1 & 2 in server, connect from client 1 & 2, Y "
166 do_testx vrf-1 vrf-2 || { echo "[FAIL]"; return $RET; }
167 echo "[PASS]"
169 echo -n "TEST 12: bind vrf-2 & 1 in server, connect from client 1 & 2, N "
170 do_testx vrf-2 vrf-1 || { echo "[FAIL]"; return $RET; }
171 echo "[PASS]"
176 CLIENT_IP=$CLIENT_IP4 SERVER_IP=$SERVER_IP4 AF="-4" testup && echo "***v4 Tests Done***" &&
177 CLIENT_IP=$CLIENT_IP6 SERVER_IP=$SERVER_IP6 AF="-6" testup && echo "***v6 Tests Done***"