From 055af094eaee139af52ea4ee2ce5d82522f47c84 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Wed, 27 Mar 2019 11:29:36 +0100 Subject: [PATCH] coverage.sh: add test auto-mode without unshare capabilities --- coverage.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/coverage.sh b/coverage.sh index 2fd57ea..908acee 100755 --- a/coverage.sh +++ b/coverage.sh @@ -52,7 +52,7 @@ if [ ! -e shared/mmdebstrap ] || [ mmdebstrap -nt shared/mmdebstrap ]; then fi starttime= -total=89 +total=90 i=1 print_header() { @@ -378,6 +378,25 @@ else echo "HAVE_QEMU != yes -- Skipping test..." fi +print_header "mode=auto,variant=apt: test auto-mode without unshare capabilities" +cat << END > shared/test.sh +#!/bin/sh +set -eu +export LC_ALL=C.UTF-8 +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 +{ tar -tf /tmp/debian-chroot.tar.gz; + printf "./etc/ld.so.cache\n./var/cache/ldconfig/\n./etc/.pwd.lock\n"; +} | sort | diff -u tar1.txt - +rm /tmp/debian-chroot.tar.gz +END +if [ "$HAVE_QEMU" = "yes" ]; then + ./run_qemu.sh +else + echo "HAVE_QEMU != yes -- Skipping test..." +fi + print_header "mode=root,variant=apt: fail with missing lz4" cat << END > shared/test.sh #!/bin/sh @@ -1196,8 +1215,6 @@ END fi done -# TODO: test if auto mode picks the right mode - if [ "$HAVE_QEMU" = "yes" ]; then guestfish add-ro shared/cover_db.img : run : mount /dev/sda / : tar-out / - \ | tar -C shared/cover_db --extract