summaryrefslogtreecommitdiff
path: root/tests/convert-tests
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2017-02-13 11:24:33 +0000
committerDimitri John Ledkov <xnox@ubuntu.com>2017-02-13 11:24:33 +0000
commit4305d024938113df5d73021a09eb2a991f54ca2f (patch)
treed9e7ecc9db14bcc1394607a9e6c644a8b93e9bea /tests/convert-tests
parente693f0e4ffb1776a05b78264ee3d93d5f07efede (diff)
New upstream release Closes: #849353, #817806, #854915, #845473
Diffstat (limited to 'tests/convert-tests')
-rwxr-xr-xtests/convert-tests/004-ext2-backup-superblock-ranges/test.sh3
-rwxr-xr-xtests/convert-tests/005-delete-all-rollback/test.sh13
-rwxr-xr-xtests/convert-tests/009-common-inode-flags/test.sh34
3 files changed, 45 insertions, 5 deletions
diff --git a/tests/convert-tests/004-ext2-backup-superblock-ranges/test.sh b/tests/convert-tests/004-ext2-backup-superblock-ranges/test.sh
index d85e4de4..c56650b2 100755
--- a/tests/convert-tests/004-ext2-backup-superblock-ranges/test.sh
+++ b/tests/convert-tests/004-ext2-backup-superblock-ranges/test.sh
@@ -14,7 +14,6 @@ source $TOP/tests/common
check_prereq btrfs-convert
check_prereq btrfs
-check_prereq btrfs-show-super
check_global_prereq e2fsck
check_global_prereq xzcat
@@ -27,7 +26,7 @@ function check_image() {
run_check e2fsck -n -f $TEST_DEV
run_check $TOP/btrfs-convert $TEST_DEV
run_check $TOP/btrfs check $TEST_DEV
- run_check $TOP/btrfs-show-super $TEST_DEV
+ run_check $TOP/btrfs inspect-internal dump-super $TEST_DEV
run_check_mount_test_dev
run_check $SUDO_HELPER e2fsck -n -f $TEST_MNT/ext2_saved/image
diff --git a/tests/convert-tests/005-delete-all-rollback/test.sh b/tests/convert-tests/005-delete-all-rollback/test.sh
index d498e5f8..cf576e70 100755
--- a/tests/convert-tests/005-delete-all-rollback/test.sh
+++ b/tests/convert-tests/005-delete-all-rollback/test.sh
@@ -34,9 +34,10 @@ do_test() {
run_check_umount_test_dev
convert_test_do_convert "$features" "$nodesize"
- convert_test_post_check "$CHECKSUMTMP"
run_check_mount_test_dev
+ convert_test_post_check_checksums "$CHECKSUMTMP"
+
here=$(pwd)
cd "$TEST_MNT" || _fail "cannot cd to TEST_MNT"
# ext2_saved/image must not be deleted
@@ -45,10 +46,16 @@ do_test() {
run_check $TOP/btrfs filesystem sync "$TEST_MNT"
run_check_umount_test_dev
convert_test_post_rollback
- convert_test_post_check "$CHECKSUMTMP"
+
+ run_check_mount_test_dev
+ convert_test_post_check_checksums "$CHECKSUMTMP"
+ run_check_umount_test_dev
# mount again and verify checksums
- convert_test_post_check "$CHECKSUMTMP"
+ run_check_mount_test_dev
+ convert_test_post_check_checksums "$CHECKSUMTMP"
+ run_check_umount_test_dev
+
rm "$CHECKSUMTMP"
}
diff --git a/tests/convert-tests/009-common-inode-flags/test.sh b/tests/convert-tests/009-common-inode-flags/test.sh
new file mode 100755
index 00000000..6f26d187
--- /dev/null
+++ b/tests/convert-tests/009-common-inode-flags/test.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+# Check if btrfs-convert can copy common inode flags like SYNC/IMMUTABLE
+
+source $TOP/tests/common
+source $TOP/tests/common.convert
+
+setup_root_helper
+prepare_test_dev 512M
+check_prereq btrfs-convert
+
+fail=0
+default_mke2fs="mke2fs -t ext4 -b 4096"
+convert_test_preamble '' 'common inode flags test' 16k "$default_mke2fs"
+convert_test_prep_fs $default_mke2fs
+
+# create file with specific flags
+run_check $SUDO_HELPER touch $TEST_MNT/flag_test
+run_check $SUDO_HELPER chattr +aAdSi $TEST_MNT/flag_test
+
+run_check_umount_test_dev
+convert_test_do_convert
+run_check_mount_test_dev
+
+# Log the status
+run_check lsattr $TEST_MNT/flag_test
+# Above flags should be copied to btrfs flags, and lsattr should get them
+run_check_stdout lsattr $TEST_MNT/flag_test | cut -f1 -d\ | grep "[aAdiS]" -q
+if [ $? -ne 0 ]; then
+ rm tmp_output
+ _fail "no common inode flags are copied after convert"
+fi
+
+run_check_umount_test_dev
+convert_test_post_rollback