chiark / gitweb /
test-functions: search for the initrd and kernel according to the BLS
[elogind.git] / test / test-functions
index b9468a458f3e19da2bb9357e05e364af2eb2ee8d..901ff4860541db194a73ff703e10f9840b55f7d0 100644 (file)
@@ -42,6 +42,14 @@ function find_qemu_bin() {
 }
 
 run_qemu() {
+    if [ -f /etc/machine-id ]; then
+        read MACHINE_ID < /etc/machine-id
+        [ -z "$INITRD" ] && [ -e "/boot/$MACHINE_ID/$KERNEL_VER/initrd" ] \
+            && INITRD="/boot/$MACHINE_ID/$KERNEL_VER/initrd"
+        [ -z "$KERNEL_BIN" ] && [ -e "/boot/$MACHINE_ID/$KERNEL_VER/linux" ] \
+            && KERNEL_BIN="/boot/$MACHINE_ID/$KERNEL_VER/linux"
+    fi
+
     [ "$KERNEL_BIN" ] || KERNEL_BIN=/boot/vmlinuz-$KERNEL_VER
     [ "$INITRD" ]     || INITRD=/boot/initramfs-${KERNEL_VER}.img
     [ "$QEMU_SMP" ]   || QEMU_SMP=1
@@ -137,8 +145,8 @@ create_empty_image() {
     LOOPDEV=$(losetup --show -P -f $TESTDIR/rootdisk.img)
     [ -b "$LOOPDEV" ] || return 1
     echo "LOOPDEV=$LOOPDEV" >> $STATEFILE
-    sfdisk -C 9600 -H 2 -S 32 -L "$LOOPDEV" <<EOF
-,4800
+    sfdisk "$LOOPDEV" <<EOF
+,290M
 ,
 EOF
 
@@ -244,9 +252,7 @@ install_debug_tools() {
 install_libnss() {
     # install libnss_files for login
     NSS_LIBS=$(LD_DEBUG=files getent passwd 2>&1 >/dev/null |sed -n '/calling init: .*libnss_/ {s!^.* /!/!; p}')
-    for l in $NSS_LIBS; do
-        dracut_install $l
-    done
+    dracut_install $NSS_LIBS
 }
 
 install_dbus() {