TEST-01-BASIC: add watchdog
authorHarald Hoyer <harald@redhat.com>
Mon, 18 Jun 2012 17:20:16 +0000 (19:20 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 18 Jun 2012 18:05:25 +0000 (20:05 +0200)
test/TEST-01-BASIC/test-init.sh
test/TEST-01-BASIC/test.sh

index f8d6693..5fc02d9 100755 (executable)
@@ -1,10 +1,11 @@
 #!/bin/sh
+>/dev/watchdog
 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
 strstr() { [ "${1#*$2*}" != "$1" ]; }
 CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
 plymouth --quit
 exec >/dev/console 2>&1
-echo "dracut-root-block-success" >/dev/sda1
+echo "dracut-root-block-success" >/dev/sdb
 export TERM=linux
 export PS1='initramfs-test:\w\$ '
 [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab
index 46e75c7..6c39d7b 100755 (executable)
@@ -7,13 +7,16 @@ KVERSION=${KVERSION-$(uname -r)}
 #DEBUGFAIL="rd.shell rd.break"
 
 test_run() {
+    dd if=/dev/zero of=$TESTDIR/result bs=1M count=1
     $testdir/run-qemu \
        -hda $TESTDIR/root.ext3 \
+       -hdb $TESTDIR/result \
        -m 256M -nographic \
        -net none -kernel /boot/vmlinuz-$KVERSION \
+       -watchdog ib700 -watchdog-action poweroff \
        -append "root=LABEL=dracut rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \
-       -initrd $TESTDIR/initramfs.testing
-    grep -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1
+       -initrd $TESTDIR/initramfs.testing || return 1
+    grep -m 1 -q dracut-root-block-success $TESTDIR/result || return 1
 }
 
 test_setup() {
@@ -81,8 +84,8 @@ test_setup() {
        inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
     )
     sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
-       -a "debug" \
-       -d "piix ide-gd_mod ata_piix ext3 sd_mod" \
+       -a "debug watchdog" \
+       -d "piix ide-gd_mod ata_piix ext3 sd_mod ib700wdt" \
        -f $TESTDIR/initramfs.testing $KVERSION || return 1
 
 #      -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm"