Blame SOURCES/0051-tests-t3310-flags.sh-Add-test-for-dvh-table-flags.patch

003ee8
From 797dbba3bb86178e17ccac46d3619936f75df1d4 Mon Sep 17 00:00:00 2001
003ee8
From: Mike Fleetwood <mike.fleetwood@googlemail.com>
003ee8
Date: Sat, 1 Oct 2016 16:40:22 +0100
003ee8
Subject: [PATCH 51/53] tests: t3310-flags.sh: Add test for dvh table flags
003ee8
003ee8
DVH table reserves the first 4 MiB for the volume header information so
003ee8
move the created test partition to immediately after that.
003ee8
003ee8
Exclude testing the boot flag as that can only be set on logical
003ee8
partitions and this test script only uses primary partitions so far.
003ee8
003ee8
Signed-off-by: Brian C. Lane <bcl@redhat.com>
003ee8
---
003ee8
 tests/t3310-flags.sh | 15 +++++++++++----
003ee8
 1 file changed, 11 insertions(+), 4 deletions(-)
003ee8
003ee8
diff --git a/tests/t3310-flags.sh b/tests/t3310-flags.sh
003ee8
index 672160d..e449589 100644
003ee8
--- a/tests/t3310-flags.sh
003ee8
+++ b/tests/t3310-flags.sh
003ee8
@@ -22,15 +22,17 @@ dev=dev-file
003ee8
 
003ee8
 extract_flags()
003ee8
 {
003ee8
-  perl -nle '/^[^:]*:2048s:4095s:2048s::[^:]*:(.+);$/ and print $1' "$@"
003ee8
+  perl -nle '/^[^:]*:4096s:6143s:2048s::[^:]*:(.+);$/ and print $1' "$@"
003ee8
 }
003ee8
 
003ee8
-for table_type in bsd gpt mac msdos; do
003ee8
+for table_type in bsd dvh gpt mac msdos; do
003ee8
   ptn_num=1
003ee8
 
003ee8
   case $table_type in
003ee8
     bsd)   primary_or_name=''
003ee8
            ;;
003ee8
+    dvh)   primary_or_name='primary'
003ee8
+           ;;
003ee8
     gpt)   primary_or_name='PTNNAME'
003ee8
            ;;
003ee8
     mac)   primary_or_name='PTNNAME'
003ee8
@@ -42,11 +44,11 @@ for table_type in bsd gpt mac msdos; do
003ee8
            ;;
003ee8
   esac
003ee8
 
003ee8
-  n_sectors=5000
003ee8
+  n_sectors=8192
003ee8
   dd if=/dev/null of=$dev bs=$ss seek=$n_sectors || fail=1
003ee8
 
003ee8
   parted -s $dev mklabel $table_type \
003ee8
-    mkpart $primary_or_name ext2 $((1*2048))s $((2*2048-1))s \
003ee8
+    mkpart $primary_or_name ext2 $((4*1024))s $((6*1024-1))s \
003ee8
       > out 2> err || fail=1
003ee8
   compare /dev/null out || fail=1
003ee8
 
003ee8
@@ -55,6 +57,11 @@ for table_type in bsd gpt mac msdos; do
003ee8
     || { warn_ "$ME_: $table_type: failed to get available flags";
003ee8
          fail=1; continue; }
003ee8
   case $table_type in
003ee8
+    dvh)   # FIXME: Exclude boot flag as that can only be set on logical
003ee8
+           # partitions in the DVH disk label and this test only uses
003ee8
+           # primary partitions.
003ee8
+           flags=`echo "$flags" | egrep -v 'boot'`
003ee8
+           ;;
003ee8
     mac)   # FIXME: Setting root or swap flags also sets the partition
003ee8
            # name to root or swap respectively.  Probably intended
003ee8
            # behaviour.  Setting lvm or raid flags after root or swap
003ee8
-- 
003ee8
2.7.4
003ee8