From b2b68f02058e0798ec3a16a4fad337a710892f5c Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Sat, 31 Aug 2019 13:17:22 +0000 Subject: [PATCH] grml2usb: add python3 test variant --- debian/tests/control | 11 +++++++++++ debian/tests/smoke-grml2usb-py3 | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100755 debian/tests/smoke-grml2usb-py3 diff --git a/debian/tests/control b/debian/tests/control index e4020a0..c6aeeed 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -8,3 +8,14 @@ Depends: dosfstools, xorriso, @ Restrictions: needs-root, isolation-machine, breaks-testbed + +Tests: smoke-grml2usb-py3 +Depends: dosfstools, + kpartx, + isolinux, + python2, + syslinux, + syslinux-common, + xorriso, + @ +Restrictions: needs-root, isolation-machine, breaks-testbed diff --git a/debian/tests/smoke-grml2usb-py3 b/debian/tests/smoke-grml2usb-py3 new file mode 100755 index 0000000..d91a60b --- /dev/null +++ b/debian/tests/smoke-grml2usb-py3 @@ -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 <