]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
test suite: allow a user-selected kernel
authorDavid Dillow <dave@thedillows.org>
Fri, 5 Jun 2009 04:18:29 +0000 (00:18 -0400)
committerDavid Dillow <dave@thedillows.org>
Fri, 5 Jun 2009 04:18:29 +0000 (00:18 -0400)
Sometimes it is desirable to allow the user to test with a different
kernel than the one they are currenting running.

test/TEST-10-RAID/test.sh

index 8bbb6e5b148f40e3ea5081ef68ff825dcf5729f1..a6e81ab31364465fb60b0d614f853b4441511445 100755 (executable)
@@ -1,9 +1,11 @@
 #!/bin/bash
 TEST_DESCRIPTION="root filesystem on an encrypted LVM PV"
 
+KVERSION=${KVERSION-$(uname -r)}
+
 test_run() {
     $testdir/run-qemu -hda root.ext2 -m 512M -nographic \
-       -net none -kernel /boot/vmlinuz-$(uname -r) \
+       -net none -kernel /boot/vmlinuz-$KVERSION \
        -append "root=/dev/dracut/root rw quiet console=ttyS0,115200n81" \
        -initrd initramfs.testing
     grep -m 1 -q dracut-root-block-success root.ext2 || return 1
@@ -13,7 +15,7 @@ test_setup() {
     # Create the blank file to use as a root filesystem
     dd if=/dev/zero of=root.ext2 bs=1M count=20
 
-    kernel=$(uname -r)
+    kernel=$KVERSION
     # Create what will eventually be our root filesystem onto an overlay
     (
        initdir=overlay/source
@@ -42,7 +44,7 @@ test_setup() {
     $basedir/dracut -l -i overlay / \
        -m "dash crypt lvm mdraid udev-rules base rootfs-block" \
        -d "ata_piix ext2 sd_mod" \
-       -f initramfs.makeroot || return 1
+       -f initramfs.makeroot $KVERSION || return 1
     rm -rf overlay
     # Invoke KVM and/or QEMU to actually create the target filesystem.
     $testdir/run-qemu -hda root.ext2 -m 512M -nographic -net none \
@@ -60,7 +62,7 @@ test_setup() {
     sudo $basedir/dracut -l -i overlay / \
        -m "dash crypt lvm mdraid udev-rules base rootfs-block" \
        -d "ata_piix ext2 sd_mod" \
-       -f initramfs.testing || return 1
+       -f initramfs.testing $KVERSION || return 1
 }
 
 test_cleanup() {