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
41 if [ $1 -eq 0 ]; then
42 printf "TEST: %-60s [ OK ]\n" "${2}"
44 printf "TEST: %-60s [FAIL]\n" "${2}"
53 # foo --- bar
57 # containing linked veth devices foo and bar,
60 ip -n $foo_ns address add $1/$3 dev foo || return 1
61 ip -n $foo_ns link set foo up || return 1
62 ip -n $bar_ns address add $2/$3 dev bar || return 1
63 ip -n $bar_ns link set bar up || return 1
65 ip netns exec $foo_ns timeout 2 ping -c 1 $2 || return 1
66 ip netns exec $bar_ns timeout 2 ping -c 1 $1 || return 1
68 nettest -B -N $bar_ns -O $foo_ns -r $1 || return 1
69 nettest -B -N $foo_ns -O $bar_ns -r $2 || return 1
77 # [foo] <---> [foo1]-[bar1] <---> [bar] /prefix
84 # containing linked veth devices foo-foo1, bar1-bar
85 # (foo in $foo_ns, foo1 and bar1 in $router_ns, and
86 # bar in $bar_ns).
88 ip -n $foo_ns address add $1/$5 dev foo || return 1
89 ip -n $foo_ns link set foo up || return 1
90 ip -n $foo_ns route add default via $2 || return 1
91 ip -n $bar_ns address add $4/$5 dev bar || return 1
92 ip -n $bar_ns link set bar up || return 1
93 ip -n $bar_ns route add default via $3 || return 1
94 ip -n $router_ns address add $2/$5 dev foo1 || return 1
95 ip -n $router_ns link set foo1 up || return 1
96 ip -n $router_ns address add $3/$5 dev bar1 || return 1
97 ip -n $router_ns link set bar1 up || return 1
101 ip netns exec $foo_ns timeout 2 ping -c 1 $2 || return 1
102 ip netns exec $foo_ns timeout 2 ping -c 1 $4 || return 1
103 ip netns exec $bar_ns timeout 2 ping -c 1 $3 || return 1
104 ip netns exec $bar_ns timeout 2 ping -c 1 $1 || return 1
106 nettest -B -N $bar_ns -O $foo_ns -r $1 || return 1
107 nettest -B -N $foo_ns -O $bar_ns -r $4 || return 1
117 ip link add foo netns $foo_ns type veth peer name bar netns $bar_ns
122 ip netns pids $foo_ns | xargs -r kill -9
123 ip netns pids $bar_ns | xargs -r kill -9
128 [ -n "$expect_failure" ] && test_result=`expr 1 - $test_result`
135 # [foo] <---> [foo1]-[bar1] <---> [bar] /prefix
141 ip link add foo netns $foo_ns type veth peer name foo1 netns $router_ns
142 ip link add bar netns $bar_ns type veth peer name bar1 netns $router_ns
147 ip netns pids $foo_ns | xargs -r kill -9
148 ip netns pids $bar_ns | xargs -r kill -9
149 ip netns pids $router_ns | xargs -r kill -9
155 [ -n "$expect_failure" ] && test_result=`expr 1 - $test_result`