The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxcfs/pull/370
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From 929c6bc4aeaae690995a44af69bf0e1ea23195e9 Mon Sep 17 00:00:00 2001 From: Christian Brauner <christian.brau...@ubuntu.com> Date: Sat, 14 Mar 2020 21:27:02 +0100 Subject: [PATCH] test_sigusr2: improve tests Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- tests/test_sigusr2.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/test_sigusr2.sh b/tests/test_sigusr2.sh index 8637916..887fff0 100755 --- a/tests/test_sigusr2.sh +++ b/tests/test_sigusr2.sh @@ -19,9 +19,20 @@ if ! mountpoint -q ${LXCFSDIR}; then exit 1 fi -[ ! -d /sys/fs/cgroup/cpuset ] && exit 0 +echo "==> Setting up memory cgroup in lxcfs_test_proc" +[ ! -d /sys/fs/cgroup/memory ] && exit 0 -# Test cpuinfo -[ "$(grep "^processor" ${LXCFSDIR}/proc/cpuinfo | wc -l)" = "$(grep "^processor" /proc/cpuinfo | wc -l)" ] +initmemory=`awk -F: '/memory/ { print $3 }' /proc/1/cgroup` +mempath=/sys/fs/cgroup/memory/${initmemory} +rmdir ${mempath}/lxcfs_test_proc 2>/dev/null || true +mkdir ${mempath}/lxcfs_test_proc +echo 1 > ${mempath}/lxcfs_test_proc/tasks + +echo $((64*1024*1024)) > ${mempath}/lxcfs_test_proc/memory.limit_in_bytes +echo 0 > ${cpupath}/lxcfs_test_proc/cpuset.cpus + +# Test meminfo +echo "==> Testing /proc/meminfo" +[ "$(grep -q "^MemTotal.*kB$" ${LXCFSDIR}/proc/meminfo)" = "$(grep -q "^MemTotal.*kB$" /proc/meminfo)" ] PASS=1
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel