3 function config_device
{
5 ip link add veth0
type veth peer name veth0b
7 ip link
set veth0 netns at_ns0
8 ip netns
exec at_ns0 ip addr add
172.16.1.100/24 dev veth0
9 ip netns
exec at_ns0 ip addr add
2401:db00
::1/64 dev veth0 nodad
10 ip netns
exec at_ns0 ip link
set dev veth0 up
11 ip addr add
172.16.1.101/24 dev veth0b
12 ip addr add
2401:db00
::2/64 dev veth0b nodad
15 function config_cgroup
{
17 mkdir
-p /tmp
/cgroupv2
18 mount
-t cgroup2 none
/tmp
/cgroupv2
19 mkdir
-p /tmp
/cgroupv
2/foo
20 echo $$
>> /tmp
/cgroupv
2/foo
/cgroup.procs
25 test_cgrp2_sock2
/tmp
/cgroupv
2/foo sock_flags_kern.o
$1
26 [ $?
-ne 0 ] && exit 1
31 ip netns delete at_ns0
47 ping -c1 -w1 172.16.1.100
49 echo "ping failed when it should succeed"
54 ping6
-c1 -w1 2401:db00
::1
56 echo "ping6 succeeded when it should not"
65 ping6
-c1 -w1 2401:db00
::1
67 echo "ping6 failed when it should succeed"
72 ping -c1 -w1 172.16.1.100
74 echo "ping succeeded when it should not"