From 3aef4dcc6733bd1ec0bf67cf15177154fd0b8ff8 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Tue, 21 Jan 2020 13:32:05 +0100 Subject: [PATCH] coverage.sh: add test comparing variant=debootstrap tarball for mode=root with mode=unshare --- coverage.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/coverage.sh b/coverage.sh index 745a9ad..92c719d 100755 --- a/coverage.sh +++ b/coverage.sh @@ -72,7 +72,7 @@ if [ ! -e shared/taridshift ] || [ taridshift -nt shared/taridshift ]; then fi starttime= -total=137 +total=138 skipped=0 runtests=0 i=1 @@ -370,6 +370,31 @@ else skipped=$((skipped+1)) fi +print_header "mode=unshare/root,variant=debootstrap: check for bit-by-bit identical output" +cat << END > shared/test.sh +#!/bin/sh +set -eu +export LC_ALL=C.UTF-8 +if [ ! -e /mmdebstrap-testenv ]; then + echo "this test modifies the system and should only be run inside a container" >&2 + exit 1 +fi +adduser --gecos user --disabled-password user +sysctl -w kernel.unprivileged_userns_clone=1 +export SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH +$CMD --mode=root --variant=debootstrap $DEFAULT_DIST /tmp/debian-chroot-root.tar $mirror +runuser -u user -- $CMD --mode=unshare --variant=debootstrap $DEFAULT_DIST /tmp/debian-chroot-unshare.tar $mirror +cmp /tmp/debian-chroot-root.tar /tmp/debian-chroot-unshare.tar +rm /tmp/debian-chroot-root.tar /tmp/debian-chroot-unshare.tar +END +if [ "$HAVE_QEMU" = "yes" ]; then + ./run_qemu.sh + runtests=$((runtests+1)) +else + echo "HAVE_QEMU != yes -- Skipping test..." >&2 + skipped=$((skipped+1)) +fi + print_header "mode=unshare,variant=apt: test taridshift utility" cat << END > shared/test.sh #!/bin/sh