diff options
author | David Sterba <dsterba@suse.com> | 2015-11-13 18:43:04 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-11-16 14:23:46 +0100 |
commit | a343805d585facd2ea04a43ae070f76ef2a5cedb (patch) | |
tree | b27a8deefd506b24c70ab5f3ef025af5dc947196 /tests | |
parent | 882f319761ebe0ff17624e6b66ff79270c3c63e5 (diff) |
btrfs-progs: tests: add 006-partitioned-loopdev
Create filesystem on a partitioned loop device, test for "btrfs-progs:
Fix partitioned loop devices resolving".
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mkfs-tests/006-partitioned-loopdev/partition-1g-1g | bin | 0 -> 512 bytes | |||
-rwxr-xr-x | tests/mkfs-tests/006-partitioned-loopdev/test.sh | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/mkfs-tests/006-partitioned-loopdev/partition-1g-1g b/tests/mkfs-tests/006-partitioned-loopdev/partition-1g-1g Binary files differnew file mode 100644 index 00000000..eb057769 --- /dev/null +++ b/tests/mkfs-tests/006-partitioned-loopdev/partition-1g-1g diff --git a/tests/mkfs-tests/006-partitioned-loopdev/test.sh b/tests/mkfs-tests/006-partitioned-loopdev/test.sh new file mode 100755 index 00000000..5c92facd --- /dev/null +++ b/tests/mkfs-tests/006-partitioned-loopdev/test.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# recognize partitioned loop devices + +source $TOP/tests/common + +check_prereq mkfs.btrfs +check_prereq btrfs +setup_root_helper + +run_check truncate -s0 img +chmod a+w img +cp partition-1g-1g img +run_check truncate -s2g img + +loopdev=$(run_check_stdout $SUDO_HELPER losetup --partscan --find --show img) +base=$(basename $loopdev) + +# expect partitions named like loop0p1 etc +for looppart in $(ls /dev/$base?*); do + run_check $SUDO_HELPER $TOP/mkfs.btrfs -f $looppart + run_check $TOP/btrfs-show-super $looppart +done + +# cleanup +run_check $SUDO_HELPER losetup -d $loopdev +run_check truncate -s0 img |