echo"this test modifies the system and should only be run inside a container" >&2
exit1
fi
adduser --gecos user --disabled-password user
sysctl -w kernel.unprivileged_userns_clone=1
runuser -u user -- $CMD --mode=unshare --variant=apt $DEFAULT_DIST /tmp/debian-chroot.tar.gz $mirror
@ -489,6 +498,10 @@ cat << END > shared/test.sh
#!/bin/sh
set -eu
exportLC_ALL=C.UTF-8
if[ ! -e /mmdebstrap-testenv ];then
echo"this test modifies the system and should only be run inside a container" >&2
exit1
fi
adduser --gecos user --disabled-password user
sysctl -w kernel.unprivileged_userns_clone=0
runuser -u user -- $CMD --mode=auto --variant=apt $DEFAULT_DIST /tmp/debian-chroot.tar.gz $mirror
@ -548,6 +561,10 @@ cat << END > shared/test.sh
#!/bin/sh
set -eu
exportLC_ALL=C.UTF-8
if[ ! -e /mmdebstrap-testenv ];then
echo"this test modifies the system and should only be run inside a container" >&2
exit1
fi
mount -t tmpfs -o nodev,nosuid,size=300M tmpfs /tmp
# use --customize-hook to exercise the mounting/unmounting code of block devices in root mode
$CMD --mode=root --variant=apt --customize-hook='mount | grep /dev/full' --customize-hook='test "\$(echo foo | tee /dev/full 2>&1 1>/dev/null)" = "tee: /dev/full: No space left on device"'$DEFAULT_DIST /tmp/debian-chroot.tar $mirror
@ -600,6 +617,10 @@ cat << END > shared/test.sh
#!/bin/sh
set -eu
exportLC_ALL=C.UTF-8
if[ ! -e /mmdebstrap-testenv ];then
echo"this test modifies the system and should only be run inside a container" >&2
exit1
fi
cat << HOSTS >> /etc/hosts
127.0.0.1 deb.debian.org
127.0.0.1 security.debian.org
@ -625,6 +646,10 @@ cat << END > shared/test.sh
#!/bin/sh
set -eu
exportLC_ALL=C.UTF-8
if[ ! -e /mmdebstrap-testenv ];then
echo"this test modifies the system and should only be run inside a container" >&2