]> git.pld-linux.org Git - packages/parted.git/blob - 0051-tests-t3310-flags.sh-Add-test-for-dvh-table-flags.patch
- rel 4; tons of patches from FC
[packages/parted.git] / 0051-tests-t3310-flags.sh-Add-test-for-dvh-table-flags.patch
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
5
6 DVH table reserves the first 4 MiB for the volume header information so
7 move the created test partition to immediately after that.
8
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.
11
12 Signed-off-by: Brian C. Lane <bcl@redhat.com>
13 ---
14  tests/t3310-flags.sh | 15 +++++++++++----
15  1 file changed, 11 insertions(+), 4 deletions(-)
16
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
22  
23  extract_flags()
24  {
25 -  perl -nle '/^[^:]*:2048s:4095s:2048s::[^:]*:(.+);$/ and print $1' "$@"
26 +  perl -nle '/^[^:]*:4096s:6143s:2048s::[^:]*:(.+);$/ and print $1' "$@"
27  }
28  
29 -for table_type in bsd gpt mac msdos; do
30 +for table_type in bsd dvh gpt mac msdos; do
31    ptn_num=1
32  
33    case $table_type in
34      bsd)   primary_or_name=''
35             ;;
36 +    dvh)   primary_or_name='primary'
37 +           ;;
38      gpt)   primary_or_name='PTNNAME'
39             ;;
40      mac)   primary_or_name='PTNNAME'
41 @@ -42,11 +44,11 @@ for table_type in bsd gpt mac msdos; do
42             ;;
43    esac
44  
45 -  n_sectors=5000
46 +  n_sectors=8192
47    dd if=/dev/null of=$dev bs=$ss seek=$n_sectors || fail=1
48  
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
54  
55 @@ -55,6 +57,11 @@ for table_type in bsd gpt mac msdos; do
56      || { warn_ "$ME_: $table_type: failed to get available flags";
57           fail=1; continue; }
58    case $table_type in
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'`
63 +           ;;
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
67 -- 
68 2.7.4
69
This page took 0.151882 seconds and 3 git commands to generate.