summaryrefslogtreecommitdiff
path: root/tests/fsck-tests/033-lowmem-collission-dir-items
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2018-07-23 14:32:01 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2018-07-23 14:32:01 +0100
commit3b9cf4c8cda0818e4d3f9892ece9f7d99de13b03 (patch)
tree59446f505b5bb3b31b1b3bb81af997dda68407c2 /tests/fsck-tests/033-lowmem-collission-dir-items
parentf22f0302575d3a167ee550470c922de82e34342b (diff)
Diffstat (limited to 'tests/fsck-tests/033-lowmem-collission-dir-items')
-rwxr-xr-xtests/fsck-tests/033-lowmem-collission-dir-items/test.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/fsck-tests/033-lowmem-collission-dir-items/test.sh b/tests/fsck-tests/033-lowmem-collission-dir-items/test.sh
new file mode 100755
index 00000000..60f34b25
--- /dev/null
+++ b/tests/fsck-tests/033-lowmem-collission-dir-items/test.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# Ensure that running btrfs check on a fs which has name collisions of files
+# doesn't result in false positives. This test is specifically targeted at
+# lowmem mode.
+
+source "$TEST_TOP/common"
+
+check_prereq btrfs
+check_prereq mkfs.btrfs
+
+setup_root_helper
+prepare_test_dev
+
+run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+run_check_mount_test_dev
+
+# Create 2 files whose names collide
+run_check $SUDO_HELPER touch "$TEST_MNT/5ab4e206~~~~~~~~XVT1U3ZF647YS2PD4AKAG826"
+run_check $SUDO_HELPER touch "$TEST_MNT/5ab4e26a~~~~~~~~AP1C3VQBE79IJOTVOEZIR9YU"
+
+run_check_umount_test_dev
+
+# The fs is clean so lowmem shouldn't produce any warnings
+run_check "$TOP/btrfs" check --readonly "$TEST_DEV"