[parted-devel] [PATCH 3/4] tests: update tests for new disk flags output

bcl at redhat.com bcl at redhat.com
Sat Jan 28 00:59:04 UTC 2012


* tests/t0010-script-no-ctrl-chars.sh: Updated
* tests/t0100-print.sh: Updated
* tests/t0101-print-empty.sh: Updated
* tests/t0220-gpt-msftres.sh: Updated
* tests/t0250-gpt.sh: Updated
* tests/t0280-gpt-corrupt.sh: Updated
* tests/t2310-dos-extended-2-sector-min-offset.sh: Updated
* tests/t4000-sun-raid-type.sh: Updated
* tests/t4100-dvh-partition-limits.sh: Updated
* tests/t4100-msdos-partition-limits.sh: Updated
* tests/t4100-msdos-starting-sector.sh: Updated
* tests/t4200-partprobe.sh: Updated
* tests/t5000-tags.sh: Updated
* tests/t6000-dm.sh: Updated
* tests/t9040-many-partitions.sh: Updated
* tests/t9041-undetected-in-use-16th-partition.sh: Updated
---
 tests/t0010-script-no-ctrl-chars.sh             |    2 +-
 tests/t0100-print.sh                            |    1 +
 tests/t0101-print-empty.sh                      |    1 +
 tests/t0220-gpt-msftres.sh                      |    2 +-
 tests/t0250-gpt.sh                              |    2 +-
 tests/t0280-gpt-corrupt.sh                      |    4 ++--
 tests/t2310-dos-extended-2-sector-min-offset.sh |    2 +-
 tests/t4000-sun-raid-type.sh                    |    2 +-
 tests/t4100-dvh-partition-limits.sh             |    4 ++--
 tests/t4100-msdos-partition-limits.sh           |    4 ++--
 tests/t4100-msdos-starting-sector.sh            |    4 ++--
 tests/t4200-partprobe.sh                        |    2 +-
 tests/t5000-tags.sh                             |    6 +++---
 tests/t6000-dm.sh                               |    4 ++--
 tests/t9040-many-partitions.sh                  |    2 +-
 tests/t9041-undetected-in-use-16th-partition.sh |    2 +-
 16 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/tests/t0010-script-no-ctrl-chars.sh b/tests/t0010-script-no-ctrl-chars.sh
index 49b3ff1..25efb73 100755
--- a/tests/t0010-script-no-ctrl-chars.sh
+++ b/tests/t0010-script-no-ctrl-chars.sh
@@ -32,7 +32,7 @@ compare out /dev/null || fail=1
 TERM=xterm parted -m -s $dev u s p > out 2>&1 || fail=1
 
 sed "s,.*/$dev:,$dev:," out > k && mv k out || fail=1
-printf "BYT;\n$dev:${n_sectors}s:file:$ss:$ss:msdos:;\n" > exp || fail=1
+printf "BYT;\n$dev:${n_sectors}s:file:$ss:$ss:msdos::;\n" > exp || fail=1
 
 compare out exp || fail=1
 
diff --git a/tests/t0100-print.sh b/tests/t0100-print.sh
index d09b8ed..a84a68e 100755
--- a/tests/t0100-print.sh
+++ b/tests/t0100-print.sh
@@ -27,6 +27,7 @@ Model:  (file)
 Disk .../$dev: 8s
 Sector size (logical/physical): ${ss}B/${ss}B
 Partition Table: msdos
+Disk Flags: 
 
 Number  Start  End  Size  Type  File system  Flags
 
diff --git a/tests/t0101-print-empty.sh b/tests/t0101-print-empty.sh
index 3e77850..41ee909 100755
--- a/tests/t0101-print-empty.sh
+++ b/tests/t0101-print-empty.sh
@@ -28,6 +28,7 @@ Model:  (file)
 Disk .../$dev: 8s
 Sector size (logical/physical): ${ss}B/${ss}B
 Partition Table: unknown
+Disk Flags: 
 EOF
 } > exp || framework_failure
 
diff --git a/tests/t0220-gpt-msftres.sh b/tests/t0220-gpt-msftres.sh
index 1247ee0..00d588c 100755
--- a/tests/t0220-gpt-msftres.sh
+++ b/tests/t0220-gpt-msftres.sh
@@ -52,7 +52,7 @@ parted -s $dev mklabel gpt > out 2>&1 || fail=1
 # expect no output
 compare out /dev/null || fail=1
 
-printf "BYT;\n$dev:${n_sectors}s:file:$ss:$ss:gpt:;\n" > exp
+printf "BYT;\n$dev:${n_sectors}s:file:$ss:$ss:gpt::;\n" > exp
 i=1
 for type in $fs_types; do
   end=$(expr $start + $part_size - 1)
diff --git a/tests/t0250-gpt.sh b/tests/t0250-gpt.sh
index 5f42440..d9e0496 100755
--- a/tests/t0250-gpt.sh
+++ b/tests/t0250-gpt.sh
@@ -35,7 +35,7 @@ parted -m -s $dev unit s print > t 2>&1 || fail=1
 sed "s,.*/$dev:,$dev:," t > out || fail=1
 
 # check for expected output
-printf "BYT;\n$dev:${n_sectors}s:file:$sector_size_:$sector_size_:gpt:;\n" \
+printf "BYT;\n$dev:${n_sectors}s:file:$sector_size_:$sector_size_:gpt::;\n" \
   > exp || fail=1
 compare exp out || fail=1
 
diff --git a/tests/t0280-gpt-corrupt.sh b/tests/t0280-gpt-corrupt.sh
index df54817..375da0e 100755
--- a/tests/t0280-gpt-corrupt.sh
+++ b/tests/t0280-gpt-corrupt.sh
@@ -34,7 +34,7 @@ parted -m -s $dev unit s print > t 2>&1 || fail=1
 sed "s,.*/$dev:,$dev:," t > out || fail=1
 
 # check for expected output
-printf "BYT;\n$dev:${n_sectors}s:file:$sector_size_:$sector_size_:gpt:;\n" \
+printf "BYT;\n$dev:${n_sectors}s:file:$sector_size_:$sector_size_:gpt::;\n" \
   > exp || fail=1
 compare exp out || fail=1
 
@@ -90,7 +90,7 @@ parted -m -s $dev u s print > out 2>&1 || fail=1
 
 # check for expected output
 printf "BYT;\nfile\n1:2048s:4095s:2048s::foo:;\n" > exp || fail=1
-sed "s/.*gpt:;/file/" out > k && mv k out || fail=1
+sed "s/.*gpt::;/file/" out > k && mv k out || fail=1
 compare exp out || fail=1
 
 Exit $fail
diff --git a/tests/t2310-dos-extended-2-sector-min-offset.sh b/tests/t2310-dos-extended-2-sector-min-offset.sh
index b86c6bc..aad575a 100644
--- a/tests/t2310-dos-extended-2-sector-min-offset.sh
+++ b/tests/t2310-dos-extended-2-sector-min-offset.sh
@@ -33,7 +33,7 @@ p5=${scsi_dev}5
 
 cat <<EOF > exp || framework_failure
 BYT;
-$scsi_dev:2048s:scsi:512:512:msdos:Linux scsi_debug;
+$scsi_dev:2048s:scsi:512:512:msdos:Linux scsi_debug:;
 1:64s:128s:65s:::lba;
 5:66s:128s:63s:::;
 EOF
diff --git a/tests/t4000-sun-raid-type.sh b/tests/t4000-sun-raid-type.sh
index 91a9f63..84b170a 100755
--- a/tests/t4000-sun-raid-type.sh
+++ b/tests/t4000-sun-raid-type.sh
@@ -24,7 +24,7 @@ ss=$sector_size_
 
 N=2000 # number of sectors
 dev=sun-disk-file
-exp="BYT;\n---:${N}s:file:$ss:$ss:sun:;\n1:0s:127s:128s"
+exp="BYT;\n---:${N}s:file:$ss:$ss:sun::;\n1:0s:127s:128s"
 # create an empty file as a test disk
 dd if=/dev/zero of=$dev bs=${ss}c count=$N 2> /dev/null || fail=1
 
diff --git a/tests/t4100-dvh-partition-limits.sh b/tests/t4100-dvh-partition-limits.sh
index b57a1c3..1623906 100755
--- a/tests/t4100-dvh-partition-limits.sh
+++ b/tests/t4100-dvh-partition-limits.sh
@@ -129,9 +129,10 @@ do_mkpart_start_and_len $(echo 2^32-1|bc) 1000 || fail=1
 # FIXME: In the long run, figure out if it's sensible.
 cat > exp <<EOF
 Model:  (file)
-Disk: 4294970342s
+Disk $dev: 4294970342s
 Sector size (logical/physical): ${ss}B/${ss}B
 Partition Table: $table_type
+Disk Flags: 
 
 Number  Start        End          Size   Type      File system  Name  Flags
  9      0s           4095s        4096s  extended
@@ -141,7 +142,6 @@ EOF
 
 # print the result
 parted -s $dev unit s p > out 2>&1 || fail=1
-sed "s/Disk .*:/Disk:/;s/ *$//" out > k && mv k out || fail=1
 compare out exp || fail=1
 
 # a partition start sector number of 2^32 must fail
diff --git a/tests/t4100-msdos-partition-limits.sh b/tests/t4100-msdos-partition-limits.sh
index 4ec3c27..d80a6ab 100755
--- a/tests/t4100-msdos-partition-limits.sh
+++ b/tests/t4100-msdos-partition-limits.sh
@@ -116,9 +116,10 @@ do_mkpart_start_and_len $(echo 2^32-1|bc) 1000 || fail=1
 
 cat > exp <<EOF
 Model:  (file)
-Disk: 4294970342s
+Disk $dev: 4294970342s
 Sector size (logical/physical): ${ss}B/${ss}B
 Partition Table: $table_type
+Disk Flags: 
 
 Number  Start        End          Size   Type     File system  Flags
  1      4294967295s  4294968294s  1000s  primary
@@ -127,7 +128,6 @@ EOF
 
 # print the result
 parted -s $dev unit s p > out 2>&1 || fail=1
-sed "s/Disk .*:/Disk:/;s/ *$//" out > k && mv k out  || fail=1
 compare out exp || fail=1
 
 # a partition start sector number of 2^32 must fail
diff --git a/tests/t4100-msdos-starting-sector.sh b/tests/t4100-msdos-starting-sector.sh
index f768646..26b5a57 100755
--- a/tests/t4100-msdos-starting-sector.sh
+++ b/tests/t4100-msdos-starting-sector.sh
@@ -38,7 +38,7 @@ compare out /dev/null || fail=1
 # Test the output of print free with no partitions.
 cat <<EOF > exp || fail=1
 BYT;
-path:${N}s:file:$ss:$ss:msdos:;
+path:${N}s:file:$ss:$ss:msdos::;
 1:32s:4095s:4064s:free;
 EOF
 
@@ -54,7 +54,7 @@ compare out exp || fail=1
 # Test the output of print free with one partition.
 cat <<EOF > exp || fail=1
 BYT;
-path:${N}s:file:$ss:$ss:msdos:;
+path:${N}s:file:$ss:$ss:msdos::;
 1:32s:2047s:2016s:free;
 1:2048s:4095s:2048s:::;
 EOF
diff --git a/tests/t4200-partprobe.sh b/tests/t4200-partprobe.sh
index bd5e15d..41bc802 100755
--- a/tests/t4200-partprobe.sh
+++ b/tests/t4200-partprobe.sh
@@ -33,7 +33,7 @@ dvhtool -d $dev --unix-to-vh d data || fail=1
 
 # Here's sample output from the parted...print command below:
 # BYT;
-# /dev/sdd:128880s:scsi:512:512:dvh: Flash Disk;
+# /dev/sdd:128880s:scsi:512:512:dvh: Flash Disk:;
 # 9:0s:4095s:4096s:::;
 # 17:4s:11s:8s::data:;
 
diff --git a/tests/t5000-tags.sh b/tests/t5000-tags.sh
index ef2f610..47437d3 100755
--- a/tests/t5000-tags.sh
+++ b/tests/t5000-tags.sh
@@ -44,7 +44,7 @@ parted -m -s $dev unit s print > t 2>&1 || fail=1
 sed "s,.*/$dev:,$dev:," t > out || fail=1
 
 # check for expected output
-printf "BYT;\n$dev:${N}s:file:$ss:$ss:gpt:;\n" > exp || fail=1
+printf "BYT;\n$dev:${N}s:file:$ss:$ss:gpt::;\n" > exp || fail=1
 compare exp out || fail=1
 
 # add a partition
@@ -66,10 +66,10 @@ gen_exp()
 {
   cat <<EOF
 BYT;
-$dev:${N}s:file:$ss:$ss:gpt:;
+$dev:${N}s:file:$ss:$ss:gpt::;
 1:${start_sector}s:${end_sector}s:${part_sectors}s::name1:;
 BYT;
-$dev:${N}s:file:$ss:$ss:gpt:;
+$dev:${N}s:file:$ss:$ss:gpt::;
 1:${start_sector}s:${end_sector}s:${part_sectors}s::name1:bios_grub;
 EOF
 }
diff --git a/tests/t6000-dm.sh b/tests/t6000-dm.sh
index 03586c7..94b4316 100755
--- a/tests/t6000-dm.sh
+++ b/tests/t6000-dm.sh
@@ -72,14 +72,14 @@ for type in linear ; do
   compare out /dev/null || fail=1
 
   parted -s "$dev" print > out 2>&1 || fail=1
-  sed 's/^Disk .*: /Disk DEV: /' out > k; mv k out
 
   # Create expected output file.
   cat <<EOF >> exp || fail=1
 Model: Linux device-mapper ($type) (dm)
-Disk DEV: 524kB
+Disk $dev: 524kB
 Sector size (logical/physical): 512B/512B
 Partition Table: msdos
+Disk Flags: 
 
 Number  Start  End  Size  Type  File system  Flags
 
diff --git a/tests/t9040-many-partitions.sh b/tests/t9040-many-partitions.sh
index 1282c1f..55530fe 100644
--- a/tests/t9040-many-partitions.sh
+++ b/tests/t9040-many-partitions.sh
@@ -40,7 +40,7 @@ scsi_debug_setup_ sector_size=$ss dev_size_mb=$n_MiB > dev-name ||
 scsi_dev=$(cat dev-name)
 
 n=$((n_MiB * sectors_per_MiB))
-printf "BYT;\n$scsi_dev:${n}s:scsi:$ss:$ss:gpt:Linux scsi_debug;\n" \
+printf "BYT;\n$scsi_dev:${n}s:scsi:$ss:$ss:gpt:Linux scsi_debug:;\n" \
   > exp || fail=1
 
 parted -s $scsi_dev mklabel gpt || fail=1
diff --git a/tests/t9041-undetected-in-use-16th-partition.sh b/tests/t9041-undetected-in-use-16th-partition.sh
index 74c30fc..1c6bad2 100644
--- a/tests/t9041-undetected-in-use-16th-partition.sh
+++ b/tests/t9041-undetected-in-use-16th-partition.sh
@@ -40,7 +40,7 @@ scsi_debug_setup_ sector_size=$ss dev_size_mb=$n_MiB > dev-name ||
 scsi_dev=$(cat dev-name)
 
 n=$((n_MiB * sectors_per_MiB))
-printf "BYT;\n$scsi_dev:${n}s:scsi:$ss:$ss:gpt:Linux scsi_debug;\n" \
+printf "BYT;\n$scsi_dev:${n}s:scsi:$ss:$ss:gpt:Linux scsi_debug:;\n" \
   > exp || fail=1
 
 parted -s $scsi_dev mklabel gpt || fail=1
-- 
1.7.6.5




More information about the parted-devel mailing list