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