btrfs-progs: tests: update misc/054 to test escaping of clone and xattrs

Add cases for clone source path and xattr name and value escapin in
receive dump.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2024-06-17 22:38:33 +02:00 committed by Qu Wenruo
parent a95e6d307b
commit 52cccb4bfd

View file

@ -1,6 +1,6 @@
#!/bin/bash
# Verify that receive --dump escapes paths for rename, symlink and hardlink
# when it's the "dest=" value
# when it's the "dest=" value, clone (source path) and xattr name and value
source "$TEST_TOP/common" || exit
@ -19,7 +19,7 @@ run_check $SUDO_HELPER ln -s "$TEST_MNT/subv1/file
failed symlink source" "$TEST_MNT/subv1/file
failed symlink target"
# Hardlinke
# Hardlink
run_check $SUDO_HELPER touch "$TEST_MNT/subv1/file
failed link source"
@ -27,6 +27,19 @@ run_check $SUDO_HELPER ln "$TEST_MNT/subv1/file
failed link source" "$TEST_MNT/subv1/file
failed link target"
# Xattr name and value, create
run_check $SUDO_HELPER touch "$TEST_MNT/subv1/xattr-file"
run_check $SUDO_HELPER setfattr -n user.'name
failed xattr name' -v '123
failed xattr value' "$TEST_MNT/subv1/xattr-file"
# Clone
run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT/subv1/clone-source
failed clone source write" bs=1M count=1
run_check $SUDO_HELPER cp --reflink=always "$TEST_MNT/subv1/clone-source
failed clone source write" "$TEST_MNT/subv1/clone-target
failed clone target"
run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot -r "$TEST_MNT/subv1" "$TEST_MNT/snap1"
_mktemp_local send.stream
run_check $SUDO_HELPER "$TOP/btrfs" send -f send.stream "$TEST_MNT/snap1"