path: root/tests/convert-tests/013-reiserfs-common-inode-flags/
diff options
Diffstat (limited to 'tests/convert-tests/013-reiserfs-common-inode-flags/')
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/convert-tests/013-reiserfs-common-inode-flags/ b/tests/convert-tests/013-reiserfs-common-inode-flags/
new file mode 100755
index 00000000..e242a3b0
--- /dev/null
+++ b/tests/convert-tests/013-reiserfs-common-inode-flags/
@@ -0,0 +1,42 @@
+# Check if btrfs-convert can copy common inode flags like SYNC/IMMUTABLE
+source "$TOP/tests/common"
+source "$TOP/tests/common.convert"
+if ! check_kernel_support_reiserfs >/dev/null; then
+ _not_run "no reiserfs support"
+prepare_test_dev 512M
+check_prereq btrfs-convert
+check_global_prereq mkreiserfs
+check_global_prereq chattr
+check_global_prereq lsattr
+default_mkfs="mkreiserfs -b 4096"
+convert_test_preamble '' 'common inode flags test' 16k "$default_mkfs"
+convert_test_prep_fs reiserfs $default_mkfs
+# 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 lsattr "$TEST_MNT/flag_test"
+# 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"
+convert_test_post_rollback reiserfs