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