2016-08-19 08:13:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Check if the converted ext2 image is readonly
|
|
|
|
|
2023-04-19 15:08:41 +00:00
|
|
|
source "$TEST_TOP/common" || exit
|
|
|
|
source "$TEST_TOP/common.convert" || exit
|
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
|
|
|
|
2023-04-13 18:40:23 +00:00
|
|
|
setup_root_helper
|
|
|
|
prepare_test_dev
|
|
|
|
|
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
|