diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2016-02-24 18:22:06 +0000 |
---|---|---|
committer | Evgeny Vereshchagin <evvers@ya.ru> | 2016-03-01 03:12:24 +0000 |
commit | 91f9f8f1bae7e0f900124d37c45a9abb4d147902 (patch) | |
tree | 00db40a152b74d7ea56776d03a5a0e7d73fe515d /test/test-functions | |
parent | 97a437d24cc97bc7132d3d3696b4c41e5a93edca (diff) |
tests: add test for https://github.com/systemd/systemd/issues/2730
Diffstat (limited to 'test/test-functions')
-rw-r--r-- | test/test-functions | 9 |
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() { |