OSDN Git Service

tests: fix misleading mkpart usage
authorJim Meyering <meyering@redhat.com>
Sun, 8 Jan 2012 17:03:34 +0000 (18:03 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 8 Jan 2012 17:05:32 +0000 (18:05 +0100)
Using "primary" is fine (and common) as a partition *type* for dos
partition tables, but with a partition table of type GPT, it is
downright misleading to specify the partition *name* as "primary".
* tests/t0220-gpt-msftres.sh: Use "p-name" as partition name,
rather than misleading "primary".
* tests/t7000-scripting.sh: Likewise.

tests/t0220-gpt-msftres.sh
tests/t7000-scripting.sh

index 83c50f2..8bfa17c 100755 (executable)
@@ -57,7 +57,7 @@ i=1
 for type in $fs_types; do
   end=$(expr $start + $part_size - 1)
   echo "$i:${start}s:${end}s:${part_size}s::$type:;" >> exp || fail=1
-  parted -s $dev mkpart primary $type ${start}s ${end}s > err 2>&1 || fail=1
+  parted -s $dev mkpart p-name $type ${start}s ${end}s > err 2>&1 || fail=1
   compare /dev/null err || fail=1
   parted -s $dev name $i $type > err 2>&1 || fail=1
   compare /dev/null err || fail=1
index 1cfb08a..e64814b 100755 (executable)
@@ -47,7 +47,7 @@ for mkpart in mkpart; do
   dd if=/dev/zero of=testfile bs=${ss}c count=$N 2> /dev/null || fail=1
 
   # Test the scripting mode of $mkpart.
-  parted -s testfile -- mklabel gpt "$mkpart" primary ext3 1s -1s > out 2>&1
+  parted -s testfile -- mklabel gpt "$mkpart" p-name ext3 1s -1s > out 2>&1
   test $? = 1 || fail=1
 
   # Compare the real error and the expected one
@@ -61,7 +61,7 @@ for mkpart in mkpart; do
   # Test the interactive mode of $mkpart
   echo n | \
     parted ---pretend-input-tty testfile \
-      "mklabel gpt '$mkpart' primary ext3 1s -1s" > out 2>&1 && fail=1
+      "mklabel gpt '$mkpart' p-name ext3 1s -1s" > out 2>&1 && fail=1
 
   # We have to format the output before comparing.
   # normalize the actual output