2 # SPDX-License-Identifier: GPL-2.0
4 function config_device
{
6 ip link add veth0
type veth peer name veth0b
8 ip link
set veth0 netns at_ns0
9 ip netns
exec at_ns0 ip addr add
172.16.1.100/24 dev veth0
10 ip netns
exec at_ns0 ip addr add
2401:db00
::1/64 dev veth0 nodad
11 ip netns
exec at_ns0 ip link
set dev veth0 up
12 ip addr add
172.16.1.101/24 dev veth0b
13 ip addr add
2401:db00
::2/64 dev veth0b nodad
16 function config_cgroup
{
18 mkdir
-p /tmp
/cgroupv2
19 mount
-t cgroup2 none
/tmp
/cgroupv2
20 mkdir
-p /tmp
/cgroupv
2/foo
21 echo $$
>> /tmp
/cgroupv
2/foo
/cgroup.procs
26 test_cgrp2_sock2
/tmp
/cgroupv
2/foo sock_flags_kern.o
$1
27 [ $?
-ne 0 ] && exit 1
31 if [ -d /tmp
/cgroupv
2/foo
]; then
32 test_cgrp2_sock
-d /tmp
/cgroupv
2/foo
35 ip netns delete at_ns0
51 ping -c1 -w1 172.16.1.100
53 echo "ping failed when it should succeed"
58 ping6
-c1 -w1 2401:db00
::1
60 echo "ping6 succeeded when it should not"
69 ping6
-c1 -w1 2401:db00
::1
71 echo "ping6 failed when it should succeed"
76 ping -c1 -w1 172.16.1.100
78 echo "ping succeeded when it should not"