diff options
author | Dimitri John Ledkov <xnox@ubuntu.com> | 2017-10-18 13:15:59 +0100 |
---|---|---|
committer | Dimitri John Ledkov <xnox@ubuntu.com> | 2017-10-18 13:15:59 +0100 |
commit | 74d288e05c2d0cb97186f51049813b3e5b5bb0cd (patch) | |
tree | 4fc213398dc89e053d53ff7d42102942470e9cb5 /tests/misc-tests/026-image-non-printable-chars/test.sh | |
parent | 569a646293cd782de7665b6158514f3b48d229d3 (diff) |
New upstream release.
Diffstat (limited to 'tests/misc-tests/026-image-non-printable-chars/test.sh')
-rwxr-xr-x | tests/misc-tests/026-image-non-printable-chars/test.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/misc-tests/026-image-non-printable-chars/test.sh b/tests/misc-tests/026-image-non-printable-chars/test.sh new file mode 100755 index 00000000..8018586f --- /dev/null +++ b/tests/misc-tests/026-image-non-printable-chars/test.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# check that sanitized names with matching crc do not contain unprintable +# characters, namely 0x7f + +source "$TOP/tests/common" + +check_prereq mkfs.btrfs +check_prereq btrfs + +prepare_test_dev + +run_check "$TOP/mkfs.btrfs" -f "$TEST_DEV" +run_check_mount_test_dev +run_check $SUDO_HELPER chmod a+rw "$TEST_MNT" + +# known to produce char 0x7f == 127 +touch "$TEST_MNT/|5gp!" + +run_check_umount_test_dev + +run_check $SUDO_HELPER "$TOP/btrfs-image" -ss "$TEST_DEV" img +run_check $SUDO_HELPER "$TOP/btrfs-image" -r img img.restored +run_check_stdout $SUDO_HELPER "$TOP/btrfs" inspect-internal dump-tree img.restored > img.dump + +ch7f=$(echo -en '\x7f') +if grep -q "$ch7f" img.dump; then + _fail "found char 0x7f in the sanitized names" +fi + +rm -f -- img img.restored img.dump |