TEST-13-NSPAWN: the host kernel may not support /proc/kcore

This commit is contained in:
Yu Watanabe
2025-12-07 09:09:03 +09:00
parent 3672e24e75
commit 45014d97dd
+12 -2
View File
@@ -39,6 +39,12 @@ create_dummy_container "$OCI/rootfs"
mkdir -p "$OCI/rootfs/opt/var"
mkdir -p "$OCI/rootfs/opt/readonly"
if [[ -e /proc/kcore ]]; then
HAVE_PROC_KCORE=1
else
HAVE_PROC_KCORE=0
fi
# Let's start with a simple config
cat >"$OCI/config.json" <<EOF
{
@@ -376,8 +382,12 @@ test -b "$DEV"
[[ "\$(stat -c '%t:%T' "$DEV")" == 4:2 ]]
# Linux - maskedPaths
test -e /proc/kcore
cat /proc/kcore && exit 1
if [[ "$HAVE_PROC_KCORE" == 1 ]]; then
test -e /proc/kcore
cat /proc/kcore && exit 1
else
test ! -e /proc/kcore
fi
test ! -e /root/nonexistent
# Linux - readonlyPaths