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
48 if [ $1 -eq 0 ]; then
49 printf "TEST: %-60s [ OK ]\n" "${2}"
51 printf "TEST: %-60s [FAIL]\n" "${2}"
60 # foo --- bar
64 # containing linked veth devices foo and bar,
67 ip -n $foo_ns address add $1/$3 dev foo || return 1
68 ip -n $foo_ns link set foo up || return 1
69 ip -n $bar_ns address add $2/$3 dev bar || return 1
70 ip -n $bar_ns link set bar up || return 1
72 ip netns exec $foo_ns timeout 2 ping -c 1 $2 || return 1
73 ip netns exec $bar_ns timeout 2 ping -c 1 $1 || return 1
75 nettest -B -N $bar_ns -O $foo_ns -r $1 || return 1
76 nettest -B -N $foo_ns -O $bar_ns -r $2 || return 1
84 # [foo] <---> [foo1]-[bar1] <---> [bar] /prefix
91 # containing linked veth devices foo-foo1, bar1-bar
92 # (foo in $foo_ns, foo1 and bar1 in $router_ns, and
93 # bar in $bar_ns).
95 ip -n $foo_ns address add $1/$5 dev foo || return 1
96 ip -n $foo_ns link set foo up || return 1
97 ip -n $foo_ns route add default via $2 || return 1
98 ip -n $bar_ns address add $4/$5 dev bar || return 1
99 ip -n $bar_ns link set bar up || return 1
100 ip -n $bar_ns route add default via $3 || return 1
101 ip -n $router_ns address add $2/$5 dev foo1 || return 1
102 ip -n $router_ns link set foo1 up || return 1
103 ip -n $router_ns address add $3/$5 dev bar1 || return 1
104 ip -n $router_ns link set bar1 up || return 1
108 ip netns exec $foo_ns timeout 2 ping -c 1 $2 || return 1
109 ip netns exec $foo_ns timeout 2 ping -c 1 $4 || return 1
110 ip netns exec $bar_ns timeout 2 ping -c 1 $3 || return 1
111 ip netns exec $bar_ns timeout 2 ping -c 1 $1 || return 1
113 nettest -B -N $bar_ns -O $foo_ns -r $1 || return 1
114 nettest -B -N $foo_ns -O $bar_ns -r $4 || return 1
124 ip link add foo netns $foo_ns type veth peer name bar netns $bar_ns
129 ip netns pids $foo_ns | xargs -r kill -9
130 ip netns pids $bar_ns | xargs -r kill -9
135 [ -n "$expect_failure" ] && test_result=`expr 1 - $test_result`
142 # [foo] <---> [foo1]-[bar1] <---> [bar] /prefix
148 ip link add foo netns $foo_ns type veth peer name foo1 netns $router_ns
149 ip link add bar netns $bar_ns type veth peer name bar1 netns $router_ns
154 ip netns pids $foo_ns | xargs -r kill -9
155 ip netns pids $bar_ns | xargs -r kill -9
156 ip netns pids $router_ns | xargs -r kill -9
162 [ -n "$expect_failure" ] && test_result=`expr 1 - $test_result`