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 <louis.scalbert@6wind.com>
This commit is contained in:
Louis Scalbert 2022-05-12 10:16:52 +02:00
parent 026f28e8ca
commit 49d72f2d49

View 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: