parted/0051-tests-t3310-flags.sh-Add-test-for-dvh-table-flags.patch
Brian C. Lane c6a1bfceda - tests: t3310-flags.sh: skip pc98 when sector size != 512 (bcl)
- tests: Set optimal blocks to 64 for scsi_debug devices (bcl)
- tests: t3310-flags.sh: Add tests for remaining table types (mike.fleetwood)
- tests: t3310-flags.sh: Add test for dvh table flags (mike.fleetwood)
- tests: t3310-flags.sh: Add test for mac table flags (mike.fleetwood)
- libparted: Remove commented local variable from bsd_partition_set_flag()
  (mike.fleetwood)
- libparted: Fix to report success when setting lvm flag on bsd table
  (mike.fleetwood)
- tests: t3310-flags.sh: Add test for bsd table flags (mike.fleetwood)
- tests: t3310-flags.sh: Stop excluding certain flags from being tested
  (mike.fleetwood)
- tests: t3310-flags.sh: Query libparted for all flags to be tested
  (mike.fleetwood)
- libparted: only IEC units are treated as exact (petr.uzel)
- docs: Improve partition description in parted.texi (gareth.randall)
- Add support for NVMe devices (petr.uzel)
- libparted/dasd: correct the offset where the first partition begins
  (dongdwdw)
2016-10-04 16:53:44 -07:00

70 lines
2.3 KiB
Diff

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