[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15353: [PATCH 12/19] tests: rewrite t6001 to use /dev/mapper
From: |
Brian C. Lane |
Subject: |
bug#15353: [PATCH 12/19] tests: rewrite t6001 to use /dev/mapper |
Date: |
Wed, 11 Sep 2013 12:25:02 -0700 |
From: "Brian C. Lane" <address@hidden>
This test began failing because using a private copy of /dev/mapper
confuses the system. This fixes that and generally cleans up the test.
tests/t6001.sh: update to use /dev/mapper directly
---
tests/t6001-psep.sh | 42 +++++++++++++++++-------------------------
1 file changed, 17 insertions(+), 25 deletions(-)
diff --git a/tests/t6001-psep.sh b/tests/t6001-psep.sh
index da6b8a1..809ff9e 100644
--- a/tests/t6001-psep.sh
+++ b/tests/t6001-psep.sh
@@ -19,10 +19,7 @@
. "${srcdir=.}/init.sh"; path_prepend_ ../parted
require_root_
-lvm_init_root_dir_
-
-test "x$ENABLE_DEVICE_MAPPER" = xyes \
- || skip_ "no device-mapper support"
+(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed"
# Device maps names - should be random to not conflict with existing ones on
# the system
@@ -41,25 +38,19 @@ cleanup_fn_() {
rm -f "$f1 $f2";
}
-# create a file of size N bytes
-N=10M
-
-f1=$(pwd)/1; d1=$(loop_setup_ "$f1") \
- || skip_ "is this partition mounted with 'nodev'?"
+loop_file_1=loop-file-1-$$
+loop_file_2=loop-file-2-$$
-f2=$(pwd)/2 ;d2=$(loop_setup_ "$f2") \
- || skip_ "is this partition mounted with 'nodev'?"
+d1=$(loop_setup_ $loop_file_1) || framework_failure
+d1_size=$(blockdev --getsz $d1)
+d2=$(loop_setup_ $loop_file_2) || framework_failure
+d2_size=$(blockdev --getsz $d2)
-dmsetup_cmd="0 `blockdev --getsz $d1` linear $d1 0"
-# setup: create a mapping
-echo "$dmsetup_cmd" | dmsetup create "$linear_" || fail=1
-dev="$DM_DEV_DIR/mapper/$linear_"
+dmsetup create $linear_ --table "0 $d1_size linear $d1 0" || framework_failure
+dev="/dev/mapper/$linear_"
# Create msdos partition table
-parted -s $dev mklabel msdos > out 2>&1 || fail=1
-compare /dev/null out || fail=1
-
-parted -s $dev mkpart primary fat32 1m 5m > out 2>&1 || fail=1
+parted -s $dev mklabel msdos mkpart primary fat32 1m 5m > out 2>&1 || fail=1
compare /dev/null out || fail=1
#make sure device name is correct
@@ -67,17 +58,18 @@ test -e ${dev}p1 || fail=1
#repeat on name not ending in a digit
# setup: create a mapping
-echo "$dmsetup_cmd" | dmsetup create "$linear2_" || fail=1
-dev="$DM_DEV_DIR/mapper/$linear2_"
+dmsetup create $linear2_ --table "0 $d2_size linear $d2 0" || framework_failure
+dev="/dev/mapper/$linear2_"
# Create msdos partition table
-parted -s $dev mklabel msdos > out 2>&1 || fail=1
-compare /dev/null out || fail=1
-
-parted -s $dev mkpart primary fat32 1m 5m > out 2>&1 || fail=1
+parted -s $dev mklabel msdos mkpart primary fat32 1m 5m > out 2>&1 || fail=1
compare /dev/null out || fail=1
#make sure device name is correct
test -e ${dev}1 || fail=1
+if [ -n "$fail" ]; then
+ ls /dev/mapper
+fi
+
Exit $fail
--
1.8.3.1
- bug#15356: [PATCH 00/19] Fedora parted patches, Brian C. Lane, 2013/09/11
- bug#15345: [PATCH 17/19] tests: Add btrfs and xfs to the fs probe test, Brian C. Lane, 2013/09/11
- bug#15346: [PATCH 01/19] libparted: copy pmbr_boot when duplicating GPT disk, Brian C. Lane, 2013/09/11
- bug#15347: [PATCH 18/19] libparted: Flush parent device on open (#962611), Brian C. Lane, 2013/09/11
- bug#15350: [PATCH 19/19] tests: Restrict gpt-header-munge to little-endian systems, Brian C. Lane, 2013/09/11
- bug#15348: [PATCH 11/19] libparted: don't canonicalize /dev/md/ paths (#872361), Brian C. Lane, 2013/09/11
- bug#15349: [PATCH 10/19] libparted: mklabel to support EDEV DASD, Brian C. Lane, 2013/09/11
- bug#15353: [PATCH 12/19] tests: rewrite t6001 to use /dev/mapper,
Brian C. Lane <=
- bug#15351: [PATCH 09/19] libparted: Avoid dasd as default disk type while probe, Brian C. Lane, 2013/09/11
- bug#15352: [PATCH 04/19] libparted: preserve the uuid on dm partitions (#832145), Brian C. Lane, 2013/09/11
- bug#15354: [PATCH 05/19] tests: Make sure dm UUIDs are not erased, Brian C. Lane, 2013/09/11
- bug#15355: [PATCH 02/19] tests: test creating 20 device-mapper partitions (#803108), Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 03/19] libparted: use dm_udev_wait (#698121), Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 08/19] libparted: mklabel to support EAV DASD, Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 16/19] libparted: Recognize btrfs filesystem, Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 06/19] libparted: add support for implicit FBA DASD partitions, Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 14/19] libparted: Add UEFI System Partition flag., Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 15/19] libparted: Add hfs_esp partition flag to GPT., Brian C. Lane, 2013/09/11