Regression test for previous patch "btrfs-progs: convert: Make
ext*_image file obey datacsum setting."
Signed-off-by: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx>
---
tests/convert-tests.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tests/convert-tests.sh b/tests/convert-tests.sh
index 7652a6c..42cbeb6 100644
--- a/tests/convert-tests.sh
+++ b/tests/convert-tests.sh
@@ -9,7 +9,6 @@ unset LANG
LANG=C
SCRIPT_DIR=$(dirname $(realpath $0))
TOP=$(realpath $SCRIPT_DIR/../)
-TEST_DEV=${TEST_DEV:-}
TEST_MNT=${TEST_MNT:-$TOP/tests/mnt}
RESULTS="$TOP/tests/convert-tests-results.txt"
IMAGE="$TOP/tests/test.img"
@@ -18,6 +17,8 @@ source $TOP/tests/common
rm -f $RESULTS
+setup_root_helper
+
convert_test() {
echo " [TEST] $1"
nodesize=$2
@@ -27,6 +28,13 @@ convert_test() {
run_check rm -f $IMAGE
run_check truncate -s 256M $IMAGE
run_check $* -F $IMAGE
+
+ # create a file to check btrfs-convert can convert regular file
+ # correct
+ run_check $SUDO_HELPER mount $IMAGE $TEST_MNT
+ run_check $SUDO_HELPER dd if=/dev/zero of=$TEST_MNT/test bs=$nodesize \
+ count=1 1>/dev/null 2>&1
+ run_check $SUDO_HELPER umount $TEST_MNT
run_check $TOP/btrfs-convert -N "$nodesize" $IMAGE
run_check $TOP/btrfs check $IMAGE
}
--
2.3.5
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html