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