From 49d72f2d4956a7500f52af16aed37da25922e4de Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Thu, 12 May 2022 10:16:52 +0200 Subject: [PATCH] topotests: fix "ip vrf exec" "ip vrf exec" command is not possible in the topotest shell. > root@r1:~# ip vrf exec r1-cust5 bash > mkdir failed for /sys/fs/cgroup/unified: No such file or directory > Failed to setup vrf cgroup2 directory Remount cgroup after remounting sysfs. Signed-off-by: Louis Scalbert --- tests/topotests/lib/micronet.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/topotests/lib/micronet.py b/tests/topotests/lib/micronet.py index d7b680da18..02f66e9c26 100644 --- a/tests/topotests/lib/micronet.py +++ b/tests/topotests/lib/micronet.py @@ -555,8 +555,11 @@ class LinuxNamespace(Commander): self.base_pre_cmd.append("-F") self.set_pre_cmd(self.base_pre_cmd + ["--wd=" + self.cwd]) - # Remount /sys to pickup any changes + # Remount sysfs and cgroup to pickup any changes self.cmd_raises("mount -t sysfs sysfs /sys") + self.cmd_raises( + "mount -o rw,nosuid,nodev,noexec,relatime -t cgroup2 cgroup /sys/fs/cgroup" + ) # Set the hostname to the namespace name if uts and set_hostname: