* [PATCH] Testcase for checking msdos and gpt partitions logic
@ 2010-03-16 9:56 BVK Chaitanya
2010-03-16 17:22 ` BVK Chaitanya
2010-04-07 11:11 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 2 replies; 4+ messages in thread
From: BVK Chaitanya @ 2010-03-16 9:56 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 284 bytes --]
Hi,
Attached patch adds a testcase for checking msdos and gpt partition
modules, part_msdos and part_gpt. This testcase uses parted tool to
create disk images with different partitions and uses grub-shell to
check whether grub is able to recognize them or not.
--
bvk.chaitanya
[-- Attachment #2: partmap-test.patch.txt --]
[-- Type: text/plain, Size: 9661 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: bvk.groups@gmail.com-20100316170632-ezfxl7ar6a32v8g1
# target_branch: file:///home/bvk/work/grub2/mainline/
# testament_sha1: 310d6d70b5a1bbb1280b6f9a0a948fbc3fd03905
# timestamp: 2010-03-16 22:36:36 +0530
# base_revision_id: bvk.groups@gmail.com-20100314170717-\
# q8ppihzgyjyifcke
#
# Begin patch
=== modified file 'conf/tests.rmk'
--- conf/tests.rmk 2010-01-22 13:37:27 +0000
+++ conf/tests.rmk 2010-03-16 17:06:32 +0000
@@ -50,6 +50,9 @@
check_SCRIPTS += grub_script_vars1
grub_script_vars1_SOURCES = tests/grub_script_vars1.in
+check_SCRIPTS += partmap_test
+partmap_test_SOURCES = tests/partmap_test.in
+
# List of tests to execute on "make check"
# SCRIPTED_TESTS = example_scripted_test
# SCRIPTED_TESTS += example_grub_script_test
@@ -59,6 +62,7 @@
SCRIPTED_TESTS = grub_script_echo1
SCRIPTED_TESTS += grub_script_echo_keywords
SCRIPTED_TESTS += grub_script_vars1
+SCRIPTED_TESTS += partmap_test
# dependencies between tests and testing-tools
$(SCRIPTED_TESTS): grub-shell grub-shell-tester
=== added file 'tests/partmap_test.in'
--- tests/partmap_test.in 1970-01-01 00:00:00 +0000
+++ tests/partmap_test.in 2010-03-16 17:06:32 +0000
@@ -0,0 +1,141 @@
+#! /bin/sh -e
+
+parted=/sbin/parted
+grubshell=@builddir@/grub-shell
+
+create_disk_image () {
+ name=$1
+ size=$2
+ qemu-img create ${name} ${size} >/dev/null
+}
+
+check_output () {
+ outfile=$1
+ shift
+
+ for id in $@; do
+ if ! grep "($id)" ${outfile} >/dev/null
+ then
+ echo "disk/partiton not found: $id (in ${$outfile})"
+ exit 1
+ fi
+ done
+}
+
+imgfile=`mktemp`
+outfile=`mktemp`
+
+#
+# msdos partition types
+#
+
+echo "Checking MSDOS partition types..."
+
+# 0 primary
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel msdos
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0
+
+# 1 primary
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M >/dev/null
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1
+
+# 2 primary
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2
+
+# 3 primary
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart primary 20M 30M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3
+
+# 4 primary
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3 hd0,4
+
+# 1 primary, 1 extended
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100%
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1
+
+# 1 primary, 1 extended, 1 logical
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,5
+
+# 1 primary, 1 extended, 2 logical
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M mkpart logical 30M 40M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,5 hd0,6
+
+# 1 primary, 1 extended, 3 logical
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M mkpart logical 30M 40M mkpart logical 40M 50M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,5 hd0,6 hd0,7
+
+# 1 primary, 1 extended, 4 logical
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M mkpart logical 30M 40M mkpart logical 40M 50M mkpart logical 50M 60M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,5 hd0,6 hd0,7 hd0,8
+
+
+#
+# GPT partition types
+#
+
+# 0 parts
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel gpt
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0
+
+# 1 parts
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M >/dev/null
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1
+
+# 2 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2
+
+# 3 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 3 20M 30M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3
+
+# 4 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 4 20M 30M mkpart 5 30M 40M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3 hd0,4
+
+# 5 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 3 20M 30M mkpart 4 30M 40M mkpart 5 40M 50M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3 hd0,4 hd0,5
+
+# 6 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 3 20M 30M mkpart 4 30M 40M mkpart 5 40M 50M mkpart 6 50M 60M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3 hd0,4 hd0,5 hd0,6
+
+
# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWRhPZVIABXhfgEAwfm///16q
3wD///9+YAhrvr7cuVtkDSt697wdOkqkKAQaSE8pk00NAGIGgAAANNqGgAElCE9GmmpT2npKbKaZ
lAPRMT1BjU9T1AD1PUDjJk00wmRkDAjE0YIwg0aYABBJBJKeyKe1GTU9CfoUfqjankRkABoGhpiB
FJIyMlPUZjKnp6o/RRso8p7RQADIAABFIQEGmmgJkaNBSfqntTUeUep6TRp+qDQG1FFSAMChO2mG
MKbiOy2ppikHGXZDyodDwOdV8MyVP0xtgCVllV23fb/S6w/RQkEB3sQDFzW4nVCyRQDa0cd+gHIG
JS4M2NFNcQljy17Mlbs7cNH42xW2Z7UDgwhV0IH3/zyOn64+yBegbkD3QJCHXBA7Jyz8fzKICpAS
gOqEBBs/Ohu9qZDAPDLxFuK8IXDReM695NVMBCzq7aJSyo00pTSUnaS6q6RfJnUpdc3XFHrXZaQU
WxssJtlURIJVNJnhU0iSqqoKLglB10M2GJ4zbZ987NkbkMDQU/mdN6WbPFAXpKwCYsoNmMUwwOjh
Ape98RGlAWoBo7wT1CByQhTHPCG/od1JH9rOeP1Mcdu3LdtrrpM5QQyMavQFtkA6pzGRAOwzMzMM
mDf3T7W0IDH0YzTY8ZHMt9loIl3QzC5QEyc9fQ6BGiBFqZSC+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pYhaAxp0TJqE6zUBRSgRAhkgEa
rN+svM23mcyDs530ORJk3Hb5fdYVv6ex5Gk8+BJAkgQIQIEZcaN8XS3AVb/fUB3HQBoCP3C/FGoD
esXo8Of7IG7suS/LqJTDL21KrsQM86hgnULIwmBQrbsoz0x4OgWNPxyxVoSKO7Lzu9v4Pcj8sQAb
xDSK5i/HsUHnq/OJPkeiVxV586XtqZoOSSUNubCm2d4w2E55tLroakaJuVcphCBD4kPt2JK1RDQm
AvVA8UYC4KSwAhlYgZp+aAohLkCFRMcsUOiUoQLReMIFQhwRxCG1HSBIV1tTbMShEefA40EPsXcE
CzQXNYO4SaheFiQwQQ0Pv62lSY2CWMy+2gzgPYJNm7y71CerFA2C8hdhcBd8KeSBaYIGctSHu9Jt
wp65CFdqO7nvUD14iG/bt/MksjjyggPABfogc8+dArZxXBLyRGGZcTzbgrDk65xWmSPfVoQNIhr8
uc7XpxkgdnC44WMAeE077lCi6MNuLdy2Ct797lSlyNV4KlkAkpqEkGUJBMrWWpAicCZIECYFVIRI
QLUZenZTiKRqzdSqeeDSSyEN2hLConz+ZUoaXxjQpmSEjrqxjmIW48hHZAlYwCQB42BVUgSqWhAn
qE7IrnAhRQ7ECniVCaclq3dThE07OWIofs044bDFkjBimttEIos0yQJTCrOHMQoob+cIFYb898I3
iEALwDiBWyS1X5e095eBJXIq7IMXS1toV53EQQBvY0G5RWBA2EwhagWIElQP+LuSKcKEgMJ7KpA=
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Testcase for checking msdos and gpt partitions logic
2010-03-16 9:56 [PATCH] Testcase for checking msdos and gpt partitions logic BVK Chaitanya
@ 2010-03-16 17:22 ` BVK Chaitanya
2010-04-07 11:15 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-07 11:11 ` Vladimir 'φ-coder/phcoder' Serbinenko
1 sibling, 1 reply; 4+ messages in thread
From: BVK Chaitanya @ 2010-03-16 17:22 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 83 bytes --]
This new patch has checks for sun and apple partition types.
--
bvk.chaitanya
[-- Attachment #2: partmap-test.patch.txt --]
[-- Type: text/plain, Size: 15018 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: bvk.groups@gmail.com-20100316210427-i99kah8gbr4l4iqn
# target_branch: file:///home/bvk/work/grub2/mainline/
# testament_sha1: 12ce4233169a3be0392e18848dd0babe4ecba40f
# timestamp: 2010-03-17 03:07:22 +0530
# base_revision_id: bvk.groups@gmail.com-20100314170717-\
# q8ppihzgyjyifcke
#
# Begin patch
=== modified file 'conf/tests.rmk'
--- conf/tests.rmk 2010-01-22 13:37:27 +0000
+++ conf/tests.rmk 2010-03-16 17:06:32 +0000
@@ -50,6 +50,9 @@
check_SCRIPTS += grub_script_vars1
grub_script_vars1_SOURCES = tests/grub_script_vars1.in
+check_SCRIPTS += partmap_test
+partmap_test_SOURCES = tests/partmap_test.in
+
# List of tests to execute on "make check"
# SCRIPTED_TESTS = example_scripted_test
# SCRIPTED_TESTS += example_grub_script_test
@@ -59,6 +62,7 @@
SCRIPTED_TESTS = grub_script_echo1
SCRIPTED_TESTS += grub_script_echo_keywords
SCRIPTED_TESTS += grub_script_vars1
+SCRIPTED_TESTS += partmap_test
# dependencies between tests and testing-tools
$(SCRIPTED_TESTS): grub-shell grub-shell-tester
=== added file 'tests/partmap_test.in'
--- tests/partmap_test.in 1970-01-01 00:00:00 +0000
+++ tests/partmap_test.in 2010-03-16 21:04:27 +0000
@@ -0,0 +1,245 @@
+#! /bin/sh -e
+
+parted=/sbin/parted
+grubshell=@builddir@/grub-shell
+
+create_disk_image () {
+ name=$1
+ size=$2
+ qemu-img create ${name} ${size} >/dev/null
+}
+
+check_output () {
+ outfile=$1
+ shift
+
+ for disk in $@; do
+ if ! grep "($disk)" ${outfile} >/dev/null
+ then
+ echo "($disk): disk/partiton not found"
+ exit 1
+ fi
+ done
+}
+
+imgfile=`mktemp`
+outfile=`mktemp`
+
+#
+# MSDOS partition types
+#
+
+echo "Checking MSDOS partition types..."
+
+# 0 primary
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel msdos
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0
+
+# 1 primary
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M >/dev/null
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1
+
+# 2 primary
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2
+
+# 3 primary
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart primary 20M 30M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3
+
+# 4 primary
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart primary 20M 30M mkpart primary 30M 40M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3 hd0,4
+
+# 1 primary, 1 extended
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100%
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1
+
+# 1 primary, 1 extended, 1 logical
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,5
+
+# 1 primary, 1 extended, 2 logical
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M mkpart logical 30M 40M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,5 hd0,6
+
+# 1 primary, 1 extended, 3 logical
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M mkpart logical 30M 40M mkpart logical 40M 50M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,5 hd0,6 hd0,7
+
+# 1 primary, 1 extended, 4 logical
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel msdos mkpart primary 0 10M mkpart primary 10M 20M mkpart extended 20M 100% mkpart logical 20M 30M mkpart logical 30M 40M mkpart logical 40M 50M mkpart logical 50M 60M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_msdos | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,5 hd0,6 hd0,7 hd0,8
+
+
+#
+# GPT partition types
+#
+
+echo "Checking GPT partition types..."
+
+# 0 parts
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel gpt
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0
+
+# 1 parts
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M >/dev/null
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1
+
+# 2 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2
+
+# 3 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 3 20M 30M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3
+
+# 4 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 4 20M 30M mkpart 5 30M 40M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3 hd0,4
+
+# 5 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 3 20M 30M mkpart 4 30M 40M mkpart 5 40M 50M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3 hd0,4 hd0,5
+
+# 6 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel gpt mkpart 1 0 10M mkpart 2 10M 20M mkpart 3 20M 30M mkpart 4 30M 40M mkpart 5 40M 50M mkpart 6 50M 60M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_gpt | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3 hd0,4 hd0,5 hd0,6
+
+
+#
+# SUN partition types
+#
+# It seems partition #3 is reserved for whole disk by parted.
+#
+
+echo "Checking SUN partition types..."
+
+# 0 parts
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel sun
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_sun | tee ${outfile}
+check_output ${outfile} hd0
+
+# 1 parts
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel sun mkpart 0 10M >/dev/null
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_sun | tee ${outfile}
+check_output ${outfile} hd0 hd0,1
+
+# 2 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel sun mkpart 0 10M mkpart 10M 20M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_sun | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2
+
+# 3 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_sun | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,4
+
+# 4 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M mkpart 30M 40M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_sun | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,4 hd0,5
+
+# 5 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M mkpart 30M 40M mkpart 40M 50M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_sun | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,4 hd0,5 hd0,6
+
+# 6 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel sun mkpart 0 10M mkpart 10M 20M mkpart 20M 30M mkpart 30M 40M mkpart 40M 50M mkpart 50M 60M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_sun | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,4 hd0,5 hd0,6 hd0,7
+
+
+#
+# Apple partition types
+#
+# Partition table itself is part of some partition, so there is always
+# a partition by default. But I don't understand why GRUB displays
+# two partitions by default :-(
+#
+
+echo "Checking APPLE partition types..."
+
+# 0 parts
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel mac
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_apple | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2
+
+# 1 parts
+create_disk_image ${imgfile} 64M
+${parted} -s ${imgfile} mklabel mac mkpart a 1M 10M >/dev/null
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_apple | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3
+
+# 2 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel mac mkpart a 1M 10M mkpart b 10M 20M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_apple | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,3 hd0,4
+
+# 3 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel mac mkpart a 1M 10M mkpart b 10M 20M mkpart c 20M 30M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_apple | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,4 hd0,5
+
+# 4 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel mac mkpart a 1M 10M mkpart b 10M 20M mkpart c 20M 30M mkpart d 30M 40M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_apple | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,4 hd0,5 hd0,6
+
+# 5 parts
+create_disk_image ${imgfile} 128M
+${parted} -s ${imgfile} mklabel mac mkpart a 1M 10M mkpart b 10M 20M mkpart c 20M 30M mkpart d 30M 40M mkpart e 40M 50M
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_apple | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,4 hd0,5 hd0,6 hd0,7
+
+# 6 parts
+create_disk_image ${imgfile} 128M
+${parted} -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
+echo ls | ${grubshell} --boot=cd --qemu-opts="-hda ${imgfile}" --modules=part_apple | tee ${outfile}
+check_output ${outfile} hd0 hd0,1 hd0,2 hd0,4 hd0,5 hd0,6 hd0,7 hd0,8
# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWelae8MACbLfgEAwfu///36v
3wD////+YAwrwfDo92pRoAAGEVQiFUolRIopSGppqTaQAABkAAAAADQAAFNJHqBoe1TI0aDQaMgA
aaDQAAGhhoqb9SRMBMmGg1M0jCMRk0yMJgCYAHGTJoxDTQwE0MTRpkxAyMJo00wgyYRRITTUxoiN
PaRoEYRtEmjT0j0mjGkaeo2iaCKQgCDRo0hoR5BRqPaJpT9RiExNMIyabRJoQCAEJtSeAbcCVLmM
MdVxmfrIlSyDL5p69Nogpcga5mA6RDmlMRGSin3QMMhv51UFVAAUKKBiqJbuQyfxDSCCwDNhJXIA
ZmyCqIn1qsJmrs5Iqojqzqs2ifb48ASUQggqEtg+OnKmqZSzzUouEymfSZc+symUnROKlVO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vIHgIlBVO8X0gO0B6Fg6gHq2+9V897l6jNmHWFKhJ9xigAeqrnWgFArQDQioKIh95
o+O1GwwIsH7e4WO0+eyKjQCCw8CX1fVPj8XiA/TIREuADMK7QXaN5FTXnO+JHlOcCyAr5jWULxea
EfeOeDQPuQmqHrmWCFfqWB90PILD7ztadIsggxAZEz6GkpgBAATH6En27gJBaoAagNovVV8gGAMx
wAqJm0GBnBV8ZxW7hsl36kJboHjVYFULstCYTUTJCrgL6YVaGYshV2gGpbQA5gHfBkK9EqsDwKBK
FVOBU2oAH+iw5qthmMaRYDgJKAXbC/HQJmBgWFkoUJCAiUSSt+XnellYEWiRY2xRMC4nWpSF9lkN
p2Hr5Ih+jsqN+arjoLZ7gGyDA0IiBMYEj2KT71XB3KuwLQITp4TG8U/ScAArLQHDh1AAbN8ANRpN
J/ZIkmHAQwvlFQmATsVeCmTIqyLQiwgn8SCCuiJamg6VOL3wJ9z/LYB5XCuokA+it6r3AB1+vEPF
6d0lXn0HuL3ZFodBmDVQCZS5AKgdRt2mhJK+/gK3p9zvpQuAaq7wQSCFBlNAKUQaEJASmkxIlNCr
fPHZKFNUzuqsiSCwqCFAhVwAZdpzoWikG2rdPX1LKayAyZcAA5a0LAqZ+H1KhQxfKGI1k9YvdDqA
gaAXrPy3b48AAtG7fIEONJCPEgSwYRO6fvC4GK5cZaqzaLWwJ1jC31OQjFWQAFQgVKtD0KhNxkJV
2Hm90TXWeG9QD601mWw4hkrIVhyA3DcAEURJjvVZrqWDGDwABUgGHBCrYuBlLlcpjmQHAAPykoD3
LzBxvGaGIDvvOUz4n0K+w2gyEL0H42EiIT4QGJ9j2uKmboF4QQDewXmwVRgVegoAG2q6VWQAD/xd
yRThQkOlae8M
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Testcase for checking msdos and gpt partitions logic
2010-03-16 9:56 [PATCH] Testcase for checking msdos and gpt partitions logic BVK Chaitanya
2010-03-16 17:22 ` BVK Chaitanya
@ 2010-04-07 11:11 ` Vladimir 'φ-coder/phcoder' Serbinenko
1 sibling, 0 replies; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-04-07 11:11 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 628 bytes --]
BVK Chaitanya wrote:
> Hi,
>
>
> Attached patch adds a testcase for checking msdos and gpt partition
> modules, part_msdos and part_gpt. This testcase uses parted tool to
> create disk images with different partitions and uses grub-shell to
> check whether grub is able to recognize them or not.
>
>
Please commit
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Testcase for checking msdos and gpt partitions logic
2010-03-16 17:22 ` BVK Chaitanya
@ 2010-04-07 11:15 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 0 replies; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-04-07 11:15 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 681 bytes --]
BVK Chaitanya wrote:
> This new patch has checks for sun and apple partition types.
>
>
>
>
Please resync before comitting. Now the partitions are named as .e.g.
hd0,msdos1 and not hd0,1. Can you add a check that no unexpected
partitons are found. Perhaps you can put an fs on partitions and check
that fs is seen (so in particular partitions aren't off-by-one sector)
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-04-07 11:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-16 9:56 [PATCH] Testcase for checking msdos and gpt partitions logic BVK Chaitanya
2010-03-16 17:22 ` BVK Chaitanya
2010-04-07 11:15 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-07 11:11 ` Vladimir 'φ-coder/phcoder' Serbinenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.