RUNTEST ${dirname}/test_readdir
TESTCASE="test_proc"
RUNTEST ${dirname}/test_proc
+TESTCASE="test_sysfs"
+RUNTEST ${dirname}/test_sysfs
TESTCASE="test_cgroup"
RUNTEST ${dirname}/test_cgroup
TESTCASE="test_read_proc.sh"
'@OUTPUT@',
])
+test_programs += custom_target(
+ 'test_sysfs',
+ build_by_default: want_tests != false,
+ input: 'test_sysfs.in',
+ output: 'test_sysfs',
+ command: [
+ meson_render_jinja2,
+ config_h,
+ '@INPUT@',
+ '@OUTPUT@',
+ ])
+
test_programs += custom_target(
'test_read_proc.sh',
build_by_default: want_tests != false,
--- /dev/null
+#!/bin/sh
+# SPDX-License-Identifier: LGPL-2.1+
+
+set -eu
+[ -n "${DEBUG:-}" ] && set -x
+
+PASS=0
+
+cleanup() {
+ [ "$PASS" = "1" ] || (echo FAIL && exit 1)
+}
+
+trap cleanup EXIT HUP INT TERM
+
+LXCFSDIR=${LXCFSDIR:-/var/lib/lxcfs}
+
+if ! mountpoint -q ${LXCFSDIR}; then
+ echo "lxcfs isn't mounted on ${LXCFSDIR}"
+ exit 1
+fi
+
+echo "==> Setting up memory/cpuset cgroup in lxcfs_test_proc"
+[ ! -d /sys/devices/system/cpu ] && exit 0
+num_cpus="$(getconf _NPROCESSORS_CONF)"
+echo "Detected ${num_cpus} cpus"
+[ "${num_cpus}" != "0" ]
+
+PASS=1