Lines Matching +full:foo +full:- +full:bar

2 # SPDX-License-Identifier: GPL-2.0
7 # Self-tests for IPv4 address extensions: the kernel's ability to accept
31 # Kselftest framework requirement - SKIP code is 4.
49 if [ $1 -eq 0 ]; then
50 printf "TEST: %-60s [ OK ]\n" "${2}"
52 printf "TEST: %-60s [FAIL]\n" "${2}"
61 # foo --- bar
64 # Caller must set up foo-ns and bar-ns namespaces
65 # containing linked veth devices foo and bar,
68 ip -n foo-ns address add $1/$3 dev foo || return 1
69 ip -n foo-ns link set foo up || return 1
70 ip -n bar-ns address add $2/$3 dev bar || return 1
71 ip -n bar-ns link set bar up || return 1
73 ip netns exec foo-ns timeout 2 ping -c 1 $2 || return 1
74 ip netns exec bar-ns timeout 2 ping -c 1 $1 || return 1
76 nettest -B -N bar-ns -O foo-ns -r $1 || return 1
77 nettest -B -N foo-ns -O bar-ns -r $2 || return 1
85 # [foo] <---> [foo1]-[bar1] <---> [bar] /prefix
91 # Caller must set up foo-ns, bar-ns, and router-ns
92 # containing linked veth devices foo-foo1, bar1-bar
93 # (foo in foo-ns, foo1 and bar1 in router-ns, and
94 # bar in bar-ns).
96 ip -n foo-ns address add $1/$5 dev foo || return 1
97 ip -n foo-ns link set foo up || return 1
98 ip -n foo-ns route add default via $2 || return 1
99 ip -n bar-ns address add $4/$5 dev bar || return 1
100 ip -n bar-ns link set bar up || return 1
101 ip -n bar-ns route add default via $3 || return 1
102 ip -n router-ns address add $2/$5 dev foo1 || return 1
103 ip -n router-ns link set foo1 up || return 1
104 ip -n router-ns address add $3/$5 dev bar1 || return 1
105 ip -n router-ns link set bar1 up || return 1
107 echo 1 | ip netns exec router-ns tee /proc/sys/net/ipv4/ip_forward
109 ip netns exec foo-ns timeout 2 ping -c 1 $2 || return 1
110 ip netns exec foo-ns timeout 2 ping -c 1 $4 || return 1
111 ip netns exec bar-ns timeout 2 ping -c 1 $3 || return 1
112 ip netns exec bar-ns timeout 2 ping -c 1 $1 || return 1
114 nettest -B -N bar-ns -O foo-ns -r $1 || return 1
115 nettest -B -N foo-ns -O bar-ns -r $4 || return 1
124 ip netns add foo-ns
125 ip netns add bar-ns
126 ip link add foo netns foo-ns type veth peer name bar netns bar-ns
131 ip netns pids foo-ns | xargs -r kill -9
132 ip netns pids bar-ns | xargs -r kill -9
133 ip netns del foo-ns
134 ip netns del bar-ns
138 [ -n "$expect_failure" ] && test_result=`expr 1 - $test_result`
145 # [foo] <---> [foo1]-[bar1] <---> [bar] /prefix
150 ip netns add foo-ns
151 ip netns add bar-ns
152 ip netns add router-ns
153 ip link add foo netns foo-ns type veth peer name foo1 netns router-ns
154 ip link add bar netns bar-ns type veth peer name bar1 netns router-ns
159 ip netns pids foo-ns | xargs -r kill -9
160 ip netns pids bar-ns | xargs -r kill -9
161 ip netns pids router-ns | xargs -r kill -9
162 ip netns del foo-ns
163 ip netns del bar-ns
164 ip netns del router-ns
169 [ -n "$expect_failure" ] && test_result=`expr 1 - $test_result`