summaryrefslogtreecommitdiff
path: root/test/test-functions
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-03-14 09:12:29 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-03-14 09:12:29 -0400
commit70e43ee7be6ee8d1e8aa4b2984a72baa25709c2e (patch)
treedf054eed7a081e7a1c6da3edf2a9d3b7a373af1a /test/test-functions
parent51f2174037055da7d974b9f8739a98da7f493432 (diff)
parent91f9f8f1bae7e0f900124d37c45a9abb4d147902 (diff)
Merge pull request #2735 from evverx/fix-2730
Add test for -.mount with Alias=root.mount, bug #2730.
Diffstat (limited to 'test/test-functions')
-rw-r--r--test/test-functions9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test-functions b/test/test-functions
index 6667e0524f..92e1ae9f8d 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -7,6 +7,8 @@ export PATH
LOOKS_LIKE_DEBIAN=$(source /etc/os-release && [[ "$ID" = "debian" || "$ID_LIKE" = "debian" ]] && echo yes)
KERNEL_VER=${KERNEL_VER-$(uname -r)}
KERNEL_MODS="/lib/modules/$KERNEL_VER/"
+QEMU_TIMEOUT="${QEMU_TIMEOUT:-infinity}"
+FSTYPE="${FSTYPE:-ext3}"
if ! ROOTLIBDIR=$(pkg-config --variable=systemdutildir systemd); then
echo "WARNING! Cannot determine rootlibdir from pkg-config, assuming /usr/lib/systemd" >&2
@@ -78,7 +80,7 @@ $KERNEL_APPEND \
-kernel $KERNEL_BIN \
"
- if [ "$INITRD" ]; then
+ if [[ "$INITRD" && "$SKIP_INITRD" != "yes" ]]; then
QEMU_OPTIONS="$QEMU_OPTIONS -initrd $INITRD"
fi
@@ -86,6 +88,9 @@ $KERNEL_APPEND \
QEMU_OPTIONS="$QEMU_OPTIONS -machine accel=kvm -enable-kvm -cpu host"
fi
+ if [[ "$QEMU_TIMEOUT" != "infinity" ]]; then
+ QEMU_BIN="timeout --foreground $QEMU_TIMEOUT $QEMU_BIN"
+ fi
( set -x
$QEMU_BIN $QEMU_OPTIONS -append "$KERNEL_APPEND" $TESTDIR/rootdisk.img ) || return 1
}
@@ -241,7 +246,7 @@ create_empty_image() {
,
EOF
- mkfs.ext3 -L systemd "${LOOPDEV}p1"
+ mkfs -t "$FSTYPE" -L systemd "${LOOPDEV}p1"
}
check_result_nspawn() {