2016-08-19 08:13:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Check if the converted ext2 image is readonly
|
|
|
|
|
2018-02-08 06:34:19 +00:00
|
|
|
source "$TEST_TOP/common"
|
|
|
|
source "$TEST_TOP/common.convert"
|
2016-08-19 08:13:06 +00:00
|
|
|
|
|
|
|
setup_root_helper
|
2017-10-27 13:50:34 +00:00
|
|
|
prepare_test_dev
|
2016-08-19 08:13:06 +00:00
|
|
|
check_prereq btrfs-convert
|
2017-08-29 14:35:01 +00:00
|
|
|
check_global_prereq mke2fs
|
2016-08-19 08:13:06 +00:00
|
|
|
|
|
|
|
default_mke2fs="mke2fs -t ext4 -b 4096"
|
|
|
|
convert_test_preamble '' 'readonly image test' 16k "$default_mke2fs"
|
2017-07-20 15:53:56 +00:00
|
|
|
convert_test_prep_fs ext4 $default_mke2fs
|
2016-08-19 08:13:06 +00:00
|
|
|
run_check_umount_test_dev
|
|
|
|
convert_test_do_convert
|
|
|
|
run_check_mount_test_dev
|
|
|
|
|
|
|
|
# It's expected to fail
|
2017-08-22 17:44:44 +00:00
|
|
|
$SUDO_HELPER dd if=/dev/zero of="$TEST_MNT/ext2_saved/image" bs=1M count=1 \
|
2016-08-19 08:13:06 +00:00
|
|
|
&> /dev/null
|
|
|
|
if [ $? -ne 1 ]; then
|
2017-08-22 17:44:44 +00:00
|
|
|
echo "after convert ext2_saved/image is not read-only"
|
2016-08-19 08:13:06 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
run_check_umount_test_dev
|
2017-09-07 12:44:45 +00:00
|
|
|
convert_test_post_rollback ext4
|