|
198 | 198 | # - pmtu_ipv6_route_change
|
199 | 199 | # Same as above but with IPv6
|
200 | 200 |
|
201 |
| -# Kselftest framework requirement - SKIP code is 4. |
202 |
| -ksft_skip=4 |
| 201 | +source ./lib.sh |
203 | 202 |
|
204 | 203 | PAUSE_ON_FAIL=no
|
205 | 204 | VERBOSE=0
|
@@ -268,16 +267,6 @@ tests="
|
268 | 267 | pmtu_ipv4_route_change ipv4: PMTU exception w/route replace 1
|
269 | 268 | pmtu_ipv6_route_change ipv6: PMTU exception w/route replace 1"
|
270 | 269 |
|
271 |
| -NS_A="ns-A" |
272 |
| -NS_B="ns-B" |
273 |
| -NS_C="ns-C" |
274 |
| -NS_R1="ns-R1" |
275 |
| -NS_R2="ns-R2" |
276 |
| -ns_a="ip netns exec ${NS_A}" |
277 |
| -ns_b="ip netns exec ${NS_B}" |
278 |
| -ns_c="ip netns exec ${NS_C}" |
279 |
| -ns_r1="ip netns exec ${NS_R1}" |
280 |
| -ns_r2="ip netns exec ${NS_R2}" |
281 | 270 | # Addressing and routing for tests with routers: four network segments, with
|
282 | 271 | # index SEGMENT between 1 and 4, a common prefix (PREFIX4 or PREFIX6) and an
|
283 | 272 | # identifier ID, which is 1 for hosts (A and B), 2 for routers (R1 and R2).
|
@@ -543,13 +532,17 @@ setup_ip6ip6() {
|
543 | 532 | }
|
544 | 533 |
|
545 | 534 | setup_namespaces() {
|
| 535 | + setup_ns NS_A NS_B NS_C NS_R1 NS_R2 |
546 | 536 | for n in ${NS_A} ${NS_B} ${NS_C} ${NS_R1} ${NS_R2}; do
|
547 |
| - ip netns add ${n} || return 1 |
548 |
| - |
549 | 537 | # Disable DAD, so that we don't have to wait to use the
|
550 | 538 | # configured IPv6 addresses
|
551 | 539 | ip netns exec ${n} sysctl -q net/ipv6/conf/default/accept_dad=0
|
552 | 540 | done
|
| 541 | + ns_a="ip netns exec ${NS_A}" |
| 542 | + ns_b="ip netns exec ${NS_B}" |
| 543 | + ns_c="ip netns exec ${NS_C}" |
| 544 | + ns_r1="ip netns exec ${NS_R1}" |
| 545 | + ns_r2="ip netns exec ${NS_R2}" |
553 | 546 | }
|
554 | 547 |
|
555 | 548 | setup_veth() {
|
@@ -839,7 +832,7 @@ setup_bridge() {
|
839 | 832 | run_cmd ${ns_a} ip link set br0 up
|
840 | 833 |
|
841 | 834 | run_cmd ${ns_c} ip link add veth_C-A type veth peer name veth_A-C
|
842 |
| - run_cmd ${ns_c} ip link set veth_A-C netns ns-A |
| 835 | + run_cmd ${ns_c} ip link set veth_A-C netns ${NS_A} |
843 | 836 |
|
844 | 837 | run_cmd ${ns_a} ip link set veth_A-C up
|
845 | 838 | run_cmd ${ns_c} ip link set veth_C-A up
|
@@ -944,9 +937,7 @@ cleanup() {
|
944 | 937 | done
|
945 | 938 | socat_pids=
|
946 | 939 |
|
947 |
| - for n in ${NS_A} ${NS_B} ${NS_C} ${NS_R1} ${NS_R2}; do |
948 |
| - ip netns del ${n} 2> /dev/null |
949 |
| - done |
| 940 | + cleanup_all_ns |
950 | 941 |
|
951 | 942 | ip link del veth_A-C 2>/dev/null
|
952 | 943 | ip link del veth_A-R1 2>/dev/null
|
|
0 commit comments