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