nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0399-Add-few-more-tests.patch

f96e0b
From c89f2b7c9bfa0961058179bdaad17cbc05257387 Mon Sep 17 00:00:00 2001
f96e0b
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
f96e0b
Date: Tue, 30 Apr 2013 17:41:32 +0200
f96e0b
Subject: [PATCH 399/482] 	Add few more tests.
f96e0b
f96e0b
---
f96e0b
 ChangeLog                   |   4 ++
f96e0b
 Makefile.util.def           |  12 ++++
f96e0b
 tests/ahci_test.in          |   3 +-
f96e0b
 tests/cdboot_test.in        |   3 +-
f96e0b
 tests/core_compress_test.in |   2 +-
f96e0b
 tests/ehci_test.in          |   3 +-
f96e0b
 tests/fddboot_test.in       |   5 +-
f96e0b
 tests/grub_cmd_date.in      |  17 +++--
f96e0b
 tests/grub_cmd_set_date.in  |  35 ++++++++++
f96e0b
 tests/grub_cmd_sleep.in     |  20 ++++++
f96e0b
 tests/hddboot_test.in       |   3 +-
f96e0b
 tests/netboot_test.in       |   3 +-
f96e0b
 tests/ohci_test.in          |   3 +-
f96e0b
 tests/partmap_test.in       | 160 +++++++++++++++++++++++++++++++++++++++++++-
f96e0b
 tests/pata_test.in          |   3 +-
f96e0b
 tests/uhci_test.in          |   3 +-
f96e0b
 tests/util/grub-shell.in    |   6 +-
f96e0b
 17 files changed, 265 insertions(+), 20 deletions(-)
f96e0b
 create mode 100644 tests/grub_cmd_set_date.in
f96e0b
 create mode 100644 tests/grub_cmd_sleep.in
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index b924457..642858c 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,5 +1,9 @@
f96e0b
 2013-04-30  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
 
f96e0b
+	Add few more tests.
f96e0b
+
f96e0b
+2013-04-30  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
+
f96e0b
 	* include/grub/arc/arc.h: Account for missing "other" peripheral on
f96e0b
 	ARCS. All users updated.
f96e0b
 
f96e0b
diff --git a/Makefile.util.def b/Makefile.util.def
f96e0b
index 3cfc592..fbd37eb 100644
f96e0b
--- a/Makefile.util.def
f96e0b
+++ b/Makefile.util.def
f96e0b
@@ -702,6 +702,18 @@ script = {
f96e0b
 
f96e0b
 script = {
f96e0b
   testcase;
f96e0b
+  name = grub_cmd_set_date;
f96e0b
+  common = tests/grub_cmd_set_date.in;
f96e0b
+};
f96e0b
+
f96e0b
+script = {
f96e0b
+  testcase;
f96e0b
+  name = grub_cmd_sleep;
f96e0b
+  common = tests/grub_cmd_sleep.in;
f96e0b
+};
f96e0b
+
f96e0b
+script = {
f96e0b
+  testcase;
f96e0b
   name = grub_script_expansion;
f96e0b
   common = tests/grub_script_expansion.in;
f96e0b
 };
f96e0b
diff --git a/tests/ahci_test.in b/tests/ahci_test.in
f96e0b
index fa5314c..e7d26ac 100644
f96e0b
--- a/tests/ahci_test.in
f96e0b
+++ b/tests/ahci_test.in
f96e0b
@@ -20,12 +20,13 @@ grubshell=@builddir@/grub-shell
f96e0b
 . "@builddir@/grub-core/modinfo.sh"
f96e0b
 
f96e0b
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
+    # PLATFORM: Don't mess with real devices when OS is active
f96e0b
     *-emu)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: qemu gets bonito DMA wrong
f96e0b
     mipsel-loongson)
f96e0b
 	exit 0;;
f96e0b
-    # no AHCI on ARC and qemu-mips platforms
f96e0b
+    # PLATFORM: no AHCI on ARC and qemu-mips platforms
f96e0b
     mips*-arc | mips*-qemu_mips)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: No native drivers are available for those
f96e0b
diff --git a/tests/cdboot_test.in b/tests/cdboot_test.in
f96e0b
index 097964f..1cc9019 100644
f96e0b
--- a/tests/cdboot_test.in
f96e0b
+++ b/tests/cdboot_test.in
f96e0b
@@ -20,9 +20,10 @@ grubshell=@builddir@/grub-shell
f96e0b
 . "@builddir@/grub-core/modinfo.sh"
f96e0b
 
f96e0b
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
+    # PLATFORM: emu is different
f96e0b
     *-emu)
f96e0b
 	exit 0;;
f96e0b
-    # Flash targets
f96e0b
+    # PLATFORM: Flash targets
f96e0b
     i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: currently grub-shell uses only -kernel for loongson
f96e0b
diff --git a/tests/core_compress_test.in b/tests/core_compress_test.in
f96e0b
index bd57f6f..f97c024 100644
f96e0b
--- a/tests/core_compress_test.in
f96e0b
+++ b/tests/core_compress_test.in
f96e0b
@@ -19,8 +19,8 @@ grubshell=@builddir@/grub-shell
f96e0b
 
f96e0b
 . "@builddir@/grub-core/modinfo.sh"
f96e0b
 
f96e0b
-# FIXME: Only mips currently supports configurable core compression
f96e0b
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
+    # FIXME: Only mips currently supports configurable core compression
f96e0b
     *-emu | i386-* | x86_64-* | sparc64-* | ia64-*)
f96e0b
 	exit 0
f96e0b
 	;;
f96e0b
diff --git a/tests/ehci_test.in b/tests/ehci_test.in
f96e0b
index d9999f8..5cfe726 100644
f96e0b
--- a/tests/ehci_test.in
f96e0b
+++ b/tests/ehci_test.in
f96e0b
@@ -20,12 +20,13 @@ grubshell=@builddir@/grub-shell
f96e0b
 . "@builddir@/grub-core/modinfo.sh"
f96e0b
 
f96e0b
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
+    # PLATFORM: Don't mess with real devices when OS is active
f96e0b
     *-emu)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: qemu gets bonito DMA wrong
f96e0b
     mipsel-loongson)
f96e0b
 	exit 0;;
f96e0b
-    # no USB on ARC and qemu-mips platforms
f96e0b
+    # PLATFORM: no USB on ARC and qemu-mips platforms
f96e0b
     mips*-arc | mips*-qemu_mips)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: No native drivers are available for those
f96e0b
diff --git a/tests/fddboot_test.in b/tests/fddboot_test.in
f96e0b
index 0866fdc..a05eb3e 100644
f96e0b
--- a/tests/fddboot_test.in
f96e0b
+++ b/tests/fddboot_test.in
f96e0b
@@ -20,9 +20,10 @@ grubshell=@builddir@/grub-shell
f96e0b
 . "@builddir@/grub-core/modinfo.sh"
f96e0b
 
f96e0b
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
+    # PLATFORM: emu is different
f96e0b
     *-emu)
f96e0b
 	exit 0;;
f96e0b
-    # Flash targets
f96e0b
+    # PLATFORM: Flash targets
f96e0b
     i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: currently grub-shell uses only -kernel for loongson
f96e0b
@@ -40,7 +41,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
     # FIXME: QEMU doesn't emulate SCSI floppies
f96e0b
     mipsel-arc | mips-arc)
f96e0b
 	exit 0;;
f96e0b
-    # powerpc doesn't boot from floppy except OldWorld Macs which we don't support anyway
f96e0b
+    # PLATFORM: powerpc doesn't boot from floppy except OldWorld Macs which we don't support anyway
f96e0b
     powerpc-ieee1275)
f96e0b
 	exit 0;;
f96e0b
 esac
f96e0b
diff --git a/tests/grub_cmd_date.in b/tests/grub_cmd_date.in
f96e0b
index 0417c67..a459353 100644
f96e0b
--- a/tests/grub_cmd_date.in
f96e0b
+++ b/tests/grub_cmd_date.in
f96e0b
@@ -13,8 +13,17 @@ dt=`echo date | @builddir@/grub-shell`
f96e0b
 dtg="$(date -u -d "$dt" +%s)"
f96e0b
 ndt="$(date -u +%s)"
f96e0b
 
f96e0b
-if [ $pdt -le $dtg ] && [ $dtg -le $ndt ]; then
f96e0b
-    exit 0;
f96e0b
+if [ $pdt -gt $dtg ] || [ $dtg -gt $ndt ]; then
f96e0b
+  echo "Date not in range: $pdt <= $dtg <= $ndt"
f96e0b
+  exit 1
f96e0b
+fi
f96e0b
+
f96e0b
+pdt="$(date -u +%s)"
f96e0b
+dt=`echo 'insmod datehook; echo $YEAR-$MONTH-$DAY $HOUR:$MINUTE:$SECOND' | @builddir@/grub-shell`
f96e0b
+dtg="$(date -u -d "$dt" +%s)"
f96e0b
+ndt="$(date -u +%s)"
f96e0b
+
f96e0b
+if [ $pdt -gt $dtg ] || [ $dtg -gt $ndt ]; then
f96e0b
+  echo "Date not in range: $pdt <= $dtg <= $ndt"
f96e0b
+  exit 1
f96e0b
 fi
f96e0b
-echo "Date not in range: $pdt <= $dtg <= $ndt"
f96e0b
-exit 1
f96e0b
diff --git a/tests/grub_cmd_set_date.in b/tests/grub_cmd_set_date.in
f96e0b
new file mode 100644
f96e0b
index 0000000..c594ae3
f96e0b
--- /dev/null
f96e0b
+++ b/tests/grub_cmd_set_date.in
f96e0b
@@ -0,0 +1,35 @@
f96e0b
+#! /bin/bash
f96e0b
+set -e
f96e0b
+
f96e0b
+. "@builddir@/grub-core/modinfo.sh"
f96e0b
+
f96e0b
+case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
+    # FIXME: OpenBIOS on sparc64 doesn't implement RTC
f96e0b
+    sparc64-ieee1275)
f96e0b
+	exit 0;;
f96e0b
+    # PLATFORM: ARC doesn't provide any way to set time
f96e0b
+    *-arc)
f96e0b
+	exit 0;;
f96e0b
+    # PLATFORM: EMU doesn't provide any way to set time
f96e0b
+    # Even if it did we'd need some kind of sandbox to avoid
f96e0b
+    # modifying real system time.
f96e0b
+    *-emu)
f96e0b
+	exit 0;;
f96e0b
+esac
f96e0b
+
f96e0b
+out=$(cat <
f96e0b
+insmod datehook
f96e0b
+date
f96e0b
+if [ \$YEAR = 2004 -a \$MONTH = 4 -a \$DAY = 4 -a \$HOUR = 20 -a \$MINUTE = 47 ]; then
f96e0b
+  hello
f96e0b
+  halt
f96e0b
+fi
f96e0b
+date 2004-04-04 20:47:00
f96e0b
+reboot
f96e0b
+EOF
f96e0b
+)
f96e0b
+
f96e0b
+if [ "$(echo "$out" | tail -n 1)" != "Hello World" ]; then
f96e0b
+  echo "Test failed: $out"
f96e0b
+  exit 1
f96e0b
+fi
f96e0b
diff --git a/tests/grub_cmd_sleep.in b/tests/grub_cmd_sleep.in
f96e0b
new file mode 100644
f96e0b
index 0000000..1c84fbf
f96e0b
--- /dev/null
f96e0b
+++ b/tests/grub_cmd_sleep.in
f96e0b
@@ -0,0 +1,20 @@
f96e0b
+#! /bin/bash
f96e0b
+set -e
f96e0b
+
f96e0b
+. "@builddir@/grub-core/modinfo.sh"
f96e0b
+
f96e0b
+# FIXME: OpenBIOS on sparc64 doesn't implement RTC
f96e0b
+if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ]; then
f96e0b
+    exit 0
f96e0b
+fi
f96e0b
+
f96e0b
+# Compare RTC with interval timer.
f96e0b
+# Not 100% proper but should check that timer is running ok
f96e0b
+dt=`echo 'date; sleep 10; date' | @builddir@/grub-shell`
f96e0b
+dt1="$(date -u -d "$(echo "$dt" | head -n 1)" +%s)"
f96e0b
+dt2="$(date -u -d "$(echo "$dt" | tail -n 1)" +%s)"
f96e0b
+
f96e0b
+if [ $((dt2 - dt1)) -gt 11 ] || [ $((dt2 - dt1)) -lt 9 ]; then
f96e0b
+  echo "Interval not in range $dt2-$dt1 != 10"
f96e0b
+  exit 1
f96e0b
+fi
f96e0b
diff --git a/tests/hddboot_test.in b/tests/hddboot_test.in
f96e0b
index 34257a3..2cbbf97 100644
f96e0b
--- a/tests/hddboot_test.in
f96e0b
+++ b/tests/hddboot_test.in
f96e0b
@@ -20,9 +20,10 @@ grubshell=@builddir@/grub-shell
f96e0b
 . "@builddir@/grub-core/modinfo.sh"
f96e0b
 
f96e0b
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
+    # PLATFORM: emu is different
f96e0b
     *-emu)
f96e0b
 	exit 0;;
f96e0b
-    # Flash targets
f96e0b
+    # PLATFORM: Flash targets
f96e0b
     i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: currently grub-shell uses only -kernel for loongson
f96e0b
diff --git a/tests/netboot_test.in b/tests/netboot_test.in
f96e0b
index aeb1db0..c757023 100644
f96e0b
--- a/tests/netboot_test.in
f96e0b
+++ b/tests/netboot_test.in
f96e0b
@@ -20,9 +20,10 @@ grubshell=@builddir@/grub-shell
f96e0b
 . "@builddir@/grub-core/modinfo.sh"
f96e0b
 
f96e0b
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
+    # PLATFORM: emu is different
f96e0b
     *-emu)
f96e0b
 	exit 0;;
f96e0b
-    # Flash targets
f96e0b
+    # PLATFORM: Flash targets
f96e0b
     i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: currently grub-shell uses only -kernel for loongson
f96e0b
diff --git a/tests/ohci_test.in b/tests/ohci_test.in
f96e0b
index d6c1e0c..f841bd2 100644
f96e0b
--- a/tests/ohci_test.in
f96e0b
+++ b/tests/ohci_test.in
f96e0b
@@ -20,12 +20,13 @@ grubshell=@builddir@/grub-shell
f96e0b
 . "@builddir@/grub-core/modinfo.sh"
f96e0b
 
f96e0b
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
+    # PLATFORM: Don't mess with real devices when OS is active
f96e0b
     *-emu)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: qemu gets bonito DMA wrong
f96e0b
     mipsel-loongson)
f96e0b
 	exit 0;;
f96e0b
-    # no USB on ARC and qemu-mips platforms
f96e0b
+    # PLATFORM: no USB on ARC and qemu-mips platforms
f96e0b
     mips*-arc | mips*-qemu_mips)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: No native drivers are available for those
f96e0b
diff --git a/tests/partmap_test.in b/tests/partmap_test.in
f96e0b
index 2d4b54e..5be7b9d 100644
f96e0b
--- a/tests/partmap_test.in
f96e0b
+++ b/tests/partmap_test.in
f96e0b
@@ -253,13 +253,19 @@ ${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M mkpart
f96e0b
 list_parts part_sun "${imgfile}" "${outfile}"
f96e0b
 check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4 $disk,sun5 $disk,sun6 $disk,sun7
f96e0b
 
f96e0b
+# 7 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M mkpart 30M 40M mkpart 40M 50M mkpart 50M 60M mkpart 60M 70M
f96e0b
+list_parts part_sun "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,sun1 $disk,sun2 $disk,sun4 $disk,sun5 $disk,sun6 $disk,sun7 $disk,sun8
f96e0b
+
f96e0b
 
f96e0b
 #
f96e0b
 # Apple partition types
f96e0b
 #
f96e0b
 # Partition table itself is part of some partition, so there is always
f96e0b
-# a partition by default.  But I don't understand why GRUB displays
f96e0b
-# two partitions by default :-(
f96e0b
+# a partition by default.  Furthermore free space is also a partition,
f96e0b
+# so there is always at least 2 partitions
f96e0b
 #
f96e0b
 
f96e0b
 echo "Checking APPLE partition types..."
f96e0b
@@ -305,3 +311,153 @@ create_disk_image "${imgfile}" 128
f96e0b
 ${parted} -a none -s "${imgfile}" mklabel mac mkpart a 1M 10M mkpart b 10M 20M mkpart c 20M 30M mkpart d 30M 40M mkpart e 40M 50M mkpart f 50M 60M
f96e0b
 list_parts part_apple "${imgfile}" "${outfile}"
f96e0b
 check_output "${outfile}" $disk $disk,apple1 $disk,apple2 $disk,apple4 $disk,apple5 $disk,apple6 $disk,apple7 $disk,apple8
f96e0b
+
f96e0b
+#
f96e0b
+# DVH partition types
f96e0b
+#
f96e0b
+# Partition #11 is reserved for whole disk by parted.
f96e0b
+# Parted also aliases #9 as whole disk
f96e0b
+#
f96e0b
+
f96e0b
+echo "Checking DVH partition types..."
f96e0b
+
f96e0b
+# 0 parts
f96e0b
+create_disk_image "${imgfile}" 64
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk
f96e0b
+
f96e0b
+# 1 parts
f96e0b
+create_disk_image "${imgfile}" 64
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M 
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1
f96e0b
+
f96e0b
+# 2 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2
f96e0b
+
f96e0b
+# 3 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3
f96e0b
+
f96e0b
+# 4 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4
f96e0b
+
f96e0b
+# 5 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5
f96e0b
+
f96e0b
+# 6 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6
f96e0b
+
f96e0b
+# 7 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7
f96e0b
+
f96e0b
+# 8 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8
f96e0b
+
f96e0b
+# 9 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8  $disk,dvh10
f96e0b
+
f96e0b
+# 10 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M mkpart primary 90M 100M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10 $disk,dvh12
f96e0b
+
f96e0b
+# 11 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M mkpart primary 90M 100M mkpart primary 100M 110M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10 $disk,dvh12 $disk,dvh13
f96e0b
+
f96e0b
+# 12 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M mkpart primary 90M 100M mkpart primary 100M 110M mkpart primary 110M 120M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10 $disk,dvh12 $disk,dvh13 $disk,dvh14
f96e0b
+
f96e0b
+# 13 parts
f96e0b
+create_disk_image "${imgfile}" 135
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M mkpart primary 90M 100M mkpart primary 100M 110M mkpart primary 110M 120M mkpart primary 120M 130M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10 $disk,dvh12 $disk,dvh13 $disk,dvh14 $disk,dvh15
f96e0b
+
f96e0b
+# 14 parts
f96e0b
+create_disk_image "${imgfile}" 145
f96e0b
+${parted} -a none -s "${imgfile}" mklabel dvh mkpart primary 3M 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M mkpart primary 40M 50M mkpart primary 50M 60M mkpart primary 60M 70M mkpart primary 70M 80M mkpart primary 80M 90M mkpart primary 90M 100M mkpart primary 100M 110M mkpart primary 110M 120M mkpart primary 120M 130M mkpart primary 130M 140M
f96e0b
+list_parts part_dvh "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,dvh1 $disk,dvh2 $disk,dvh3 $disk,dvh4 $disk,dvh5 $disk,dvh6 $disk,dvh7 $disk,dvh8 $disk,dvh10 $disk,dvh12 $disk,dvh13 $disk,dvh14 $disk,dvh15 $disk,dvh16
f96e0b
+
f96e0b
+echo "Checking AMIGA partition types..."
f96e0b
+
f96e0b
+# 0 parts
f96e0b
+create_disk_image "${imgfile}" 64
f96e0b
+${parted} -a none -s "${imgfile}" mklabel amiga
f96e0b
+list_parts part_amiga "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk
f96e0b
+
f96e0b
+# 1 parts
f96e0b
+create_disk_image "${imgfile}" 64
f96e0b
+${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M 
f96e0b
+list_parts part_amiga "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,amiga1
f96e0b
+
f96e0b
+# 2 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M
f96e0b
+list_parts part_amiga "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2
f96e0b
+
f96e0b
+# 3 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M
f96e0b
+list_parts part_amiga "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3
f96e0b
+
f96e0b
+# 4 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M mkpart x 30M 40M
f96e0b
+list_parts part_amiga "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4
f96e0b
+
f96e0b
+# 5 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M mkpart x 30M 40M mkpart x 40M 50M
f96e0b
+list_parts part_amiga "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4 $disk,amiga5
f96e0b
+
f96e0b
+# 6 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M mkpart x 30M 40M mkpart x 40M 50M mkpart x 50M 60M
f96e0b
+list_parts part_amiga "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4 $disk,amiga5 $disk,amiga6
f96e0b
+
f96e0b
+# 7 parts
f96e0b
+create_disk_image "${imgfile}" 128
f96e0b
+${parted} -a none -s "${imgfile}" mklabel amiga mkpart x 0 10M mkpart x 10M 20M mkpart x 20M 30M mkpart x 30M 40M mkpart x 40M 50M mkpart x 50M 60M mkpart x 60M 70M
f96e0b
+list_parts part_amiga "${imgfile}" "${outfile}"
f96e0b
+check_output "${outfile}" $disk $disk,amiga1 $disk,amiga2 $disk,amiga3 $disk,amiga4 $disk,amiga5 $disk,amiga6 $disk,amiga7
f96e0b
+
f96e0b
diff --git a/tests/pata_test.in b/tests/pata_test.in
f96e0b
index 3671300..07d17b7 100644
f96e0b
--- a/tests/pata_test.in
f96e0b
+++ b/tests/pata_test.in
f96e0b
@@ -23,9 +23,10 @@ disk=hda
f96e0b
 indisk=ata0
f96e0b
 
f96e0b
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
+    # PLATFORM: Don't mess with real devices when OS is active
f96e0b
     *-emu)
f96e0b
 	exit 0;;
f96e0b
-    # no ATA on ARC platforms (they use SCSI)
f96e0b
+    # PLATFORM: no ATA on ARC platforms (they use SCSI)
f96e0b
     *-arc)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: No native drivers are available for those
f96e0b
diff --git a/tests/uhci_test.in b/tests/uhci_test.in
f96e0b
index ec6731c..3dea51c 100644
f96e0b
--- a/tests/uhci_test.in
f96e0b
+++ b/tests/uhci_test.in
f96e0b
@@ -20,12 +20,13 @@ grubshell=@builddir@/grub-shell
f96e0b
 . "@builddir@/grub-core/modinfo.sh"
f96e0b
 
f96e0b
 case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
+    # PLATFORM: Don't mess with real devices when OS is active
f96e0b
     *-emu)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: qemu gets bonito DMA wrong
f96e0b
     mipsel-loongson)
f96e0b
 	exit 0;;
f96e0b
-    # no USB on ARC and qemu-mips platforms
f96e0b
+    # PLATFORM: no USB on ARC and qemu-mips platforms
f96e0b
     mips*-arc | mips*-qemu_mips)
f96e0b
 	exit 0;;
f96e0b
     # FIXME: No native drivers are available for those
f96e0b
diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in
f96e0b
index 5b20ca3..1d7dfb8 100644
f96e0b
--- a/tests/util/grub-shell.in
f96e0b
+++ b/tests/util/grub-shell.in
f96e0b
@@ -103,7 +103,8 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
 	boot=cd
f96e0b
 	qemu=qemu-system-mips64
f96e0b
 	qemuopts="$qemuopts -M indy"
f96e0b
-	console=console
f96e0b
+	serial_port=arc/serial0/line0
f96e0b
+	console=
f96e0b
 	trim=1
f96e0b
 	;;
f96e0b
     mipsel-arc)
f96e0b
@@ -124,9 +125,8 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
f96e0b
     mipsel-loongson)
f96e0b
 	boot=mipsel_fulong2e
f96e0b
 	qemu=qemu-system-mips64el
f96e0b
-	qemuopts="$qemuopts -no-reboot -M fulong2e"
f96e0b
+	qemuopts="$qemuopts -M fulong2e"
f96e0b
 	console=
f96e0b
-	halt_cmd=reboot
f96e0b
 	trim=1
f96e0b
 	;;
f96e0b
     i386-coreboot)
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b