]> git.puffer.fish Git - matthieu/frr.git/commitdiff
topotests: fix "ip vrf exec"
authorLouis Scalbert <louis.scalbert@6wind.com>
Thu, 12 May 2022 08:16:52 +0000 (10:16 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Fri, 27 May 2022 08:32:29 +0000 (10:32 +0200)
"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 <louis.scalbert@6wind.com>
tests/topotests/lib/micronet.py

index d7b680da18faad215b472107408545067cdd3ffe..02f66e9c26cba27be8a8596f0d5c2d6b341e5828 100644 (file)
@@ -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: