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

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