]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
tests: Fix sysfs test
authorStéphane Graber <stgraber@ubuntu.com>
Sun, 13 Mar 2022 03:35:37 +0000 (22:35 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Sun, 13 Mar 2022 03:35:39 +0000 (22:35 -0500)
For the sysfs test to be useful, we need /sys/devices/system/cpu/ to
actually be mounted.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
tests/test_sysfs.in

index 6fd1ba9921ed903b3a87ad3f106ea19012f1e238..4ef051da3ce5fc951b652741a4f218f19a9ffba8 100755 (executable)
@@ -21,8 +21,11 @@ fi
 
 echo "==> Setting up memory/cpuset cgroup in lxcfs_test_proc"
 [ ! -d /sys/devices/system/cpu ] && exit 0
+mount -o bind "${LXCFSDIR}/sys/devices/system/cpu" "/sys/devices/system/cpu"
 num_cpus="$(getconf _NPROCESSORS_CONF)"
+umount -l "/sys/devices/system/cpu"
+
 echo "Detected ${num_cpus} cpus"
-[ "${num_cpus}" != "0" ] 
+[ "${num_cpus}" != "0" ]
 
 PASS=1