From: Chris Hofstaedtler Date: Sat, 31 Aug 2019 10:41:47 +0000 (+0000) Subject: grml2usb: Add smoke autopkgtest for python2 X-Git-Tag: v0.16.7~5^2~1 X-Git-Url: http://git.grml.org/?p=grml2usb.git;a=commitdiff_plain;h=3fd61a430a9f728629866603d10788d00f7e796d grml2usb: Add smoke autopkgtest for python2 Adds an autopkgtest for the python2 variant of grml2usb -- currently the only variant. The test unfortunately needs to be run inside a full machine isolation context, e.g. autopkgtest-virt-qemu. This builds a minimal stub ISO and does not attempt to test full functionality. --- diff --git a/debian/control b/debian/control index 0c5aa38..0382eef 100644 --- a/debian/control +++ b/debian/control @@ -17,7 +17,8 @@ Vcs-Browser: https://git.grml.org/?p=grml2usb.git Package: grml2usb Architecture: amd64 i386 -Depends: mtools, +Depends: kmod, + mtools, python, python-parted, rsync, diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..e4020a0 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,10 @@ +Tests: smoke-grml2usb-py2 +Depends: dosfstools, + kpartx, + isolinux, + python2, + syslinux, + syslinux-common, + xorriso, + @ +Restrictions: needs-root, isolation-machine, breaks-testbed diff --git a/debian/tests/smoke-grml2usb-py2 b/debian/tests/smoke-grml2usb-py2 new file mode 100755 index 0000000..67b45d1 --- /dev/null +++ b/debian/tests/smoke-grml2usb-py2 @@ -0,0 +1,36 @@ +#!/bin/bash +exec 2>&1 +set -ex + +TMPDIR=$(mktemp -d) +LODEV=$(losetup -f) +cleanup() { + kpartx -d "$LODEV" || true + losetup -d "$LODEV" || true + rm -rf "$TMPDIR" +} +trap cleanup EXIT + +mkdir "$TMPDIR"/isoroot "$TMPDIR"/isoroot/boot "$TMPDIR"/isoroot/boot/isolinux +cp /usr/lib/ISOLINUX/isolinux.bin "$TMPDIR"/isoroot/boot/isolinux/ +echo 'FAKE' > "$TMPDIR"/isoroot/grml-version +echo 'LOGO' > "$TMPDIR"/isoroot/boot/logo.16 +touch "$TMPDIR"/isoroot/boot/isolinux/FAKE_default.cfg +touch "$TMPDIR"/isoroot/boot/isolinux/FAKE_grml.cfg +touch "$TMPDIR"/isoroot/boot/isolinux/hidden.cfg +xorriso -as mkisofs -l -r -J -no-pad -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -o "$TMPDIR"/fake.iso "$TMPDIR"/isoroot +xorriso -dev "$TMPDIR"/fake.iso -ls + +dd if=/dev/zero of="$TMPDIR"/blockdev bs=1M count=50 + +sfdisk "$TMPDIR"/blockdev <