From b0c11adee755018208d946fd104fdfc9f0da8de3 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 30 Nov 2018 14:56:16 +0000 Subject: [PATCH] tests: md: Increase size of MD partitions in test. Commit c11a92751e003b3d4bc3584b598afc9bd9d9e703 chose some strangely sized partitions for testing Linux MD devices. The disks were 100M however the four partitions only covered the first 10M of disk space (with the rest being unallocated and unused in the test). This worked until Linux 4.20 where the ~2M-sized partitions become too small for a Linux MD device. This commit changes the test to use four 20M-sized partitions which is sufficient space to create the MD device with recent kernels. I also modified the partition allocation code to use explicit calculations and variables, making it considerably clearer. --- tests/md/test-mdadm.sh | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/tests/md/test-mdadm.sh b/tests/md/test-mdadm.sh index 10a693952..ead07363e 100755 --- a/tests/md/test-mdadm.sh +++ b/tests/md/test-mdadm.sh @@ -1,6 +1,6 @@ #!/bin/bash - # libguestfs -# Copyright (C) 2011 Red Hat Inc. +# Copyright (C) 2011-2018 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,6 +25,12 @@ skip_if_skipped rm -f mdadm-{1,2,3,4}.img +# Partition boundaries. +p1_start=$(( 1024*1024/512 )); p1_end=$(( 20*1024*1024/512 - 1 )) +p2_start=$(( p1_end+1 )); p2_end=$(( 40*1024*1024/512 - 1 )) +p3_start=$(( p2_end+1 )); p3_end=$(( 60*1024*1024/512 - 1 )) +p4_start=$(( p3_end+1 )); p4_end=$(( 80*1024*1024/512 - 1 )) + guestfish <