summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDjalal Harouni <tixxdz@opendz.org>2016-11-11 11:07:40 +0100
committerGitHub <noreply@github.com>2016-11-11 11:07:40 +0100
commit00abd62ab53043f4536719b927962fdadcd67092 (patch)
treecfdb49ccd4493a7c2e12929625422a9518f88bb4
parent9faed222fc92c53b6439f52857403a522cf31bd9 (diff)
parente1a2731868cdf72cbc54129bf5dd60554e9df7c6 (diff)
Merge pull request #4647 from evverx/arch-testsuite
tests: fix kernel/initrd searching (Arch)
-rw-r--r--test/test-functions23
1 files changed, 20 insertions, 3 deletions
diff --git a/test/test-functions b/test/test-functions
index 2a21a64c5c..9845b2e5dd 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -5,6 +5,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
LOOKS_LIKE_DEBIAN=$(source /etc/os-release && [[ "$ID" = "debian" || "$ID_LIKE" = "debian" ]] && echo yes)
+LOOKS_LIKE_ARCH=$(source /etc/os-release && [[ "$ID" = "arch" ]] && echo yes)
KERNEL_VER=${KERNEL_VER-$(uname -r)}
KERNEL_MODS="/lib/modules/$KERNEL_VER/"
QEMU_TIMEOUT="${QEMU_TIMEOUT:-infinity}"
@@ -58,11 +59,27 @@ run_qemu() {
&& KERNEL_BIN="/boot/$MACHINE_ID/$KERNEL_VER/linux"
fi
+ if [[ ! "$KERNEL_BIN" ]]; then
+ if [[ "$LOOKS_LIKE_ARCH" ]]; then
+ KERNEL_BIN=/boot/vmlinuz-linux
+ else
+ KERNEL_BIN=/boot/vmlinuz-$KERNEL_VER
+ fi
+ fi
+
default_fedora_initrd=/boot/initramfs-${KERNEL_VER}.img
default_debian_initrd=/boot/initrd.img-${KERNEL_VER}
- [ "$KERNEL_BIN" ] || KERNEL_BIN=/boot/vmlinuz-$KERNEL_VER
- [ "$INITRD" ] || { [ -e "$default_fedora_initrd" ] && INITRD=$default_fedora_initrd; }
- [ "$INITRD" ] || { [ "$LOOKS_LIKE_DEBIAN" ] && [ -e "$default_debian_initrd" ] && INITRD=$default_debian_initrd; }
+ default_arch_initrd=/boot/initramfs-linux.img
+ if [[ ! "$INITRD" ]]; then
+ if [[ -e "$default_fedora_initrd" ]]; then
+ INITRD="$default_fedora_initrd"
+ elif [[ "$LOOKS_LIKE_DEBIAN" && -e "$default_debian_initrd" ]]; then
+ INITRD="$default_debian_initrd"
+ elif [[ "$LOOKS_LIKE_ARCH" && -e "$default_arch_initrd" ]]; then
+ INITRD="$default_arch_initrd"
+ fi
+ fi
+
[ "$QEMU_SMP" ] || QEMU_SMP=1
find_qemu_bin || return 1