summaryrefslogtreecommitdiff
path: root/tests/mkfs-tests/011-rootdir-create-file
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2018-02-19 15:51:31 +0000
committerDimitri John Ledkov <xnox@ubuntu.com>2018-02-19 15:52:49 +0000
commitb70cb0d0a21394d5d6b00b51f064115c2724cea8 (patch)
treef001381d2ee826e6665e003e7c6dccb084a54316 /tests/mkfs-tests/011-rootdir-create-file
parentf1b0adb46b2c193e940f8c22b35036d2ee76c673 (diff)
Diffstat (limited to 'tests/mkfs-tests/011-rootdir-create-file')
-rwxr-xr-xtests/mkfs-tests/011-rootdir-create-file/test.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/mkfs-tests/011-rootdir-create-file/test.sh b/tests/mkfs-tests/011-rootdir-create-file/test.sh
new file mode 100755
index 00000000..c04f711d
--- /dev/null
+++ b/tests/mkfs-tests/011-rootdir-create-file/test.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Regression test for mkfs.btrfs --rootdir on non-existent file.
+# Expected behavior: it should create a new file if destination doesn't exist
+# Regression 460e93f25754 ("btrfs-progs: mkfs: check the status of file at mkfs")
+
+source "$TOP/tests/common"
+
+check_prereq mkfs.btrfs
+
+tmp=$(mktemp -d --tmpdir btrfs-progs-mkfs.rootdirXXXXXXX)
+# we can't use TEST_DEV, a file is needed
+img=$(mktemp btrfs-progs-mkfs.rootdirXXXXXXX)
+run_check "$TOP/mkfs.btrfs" -f --rootdir "$TOP/Documentation/" "$img"
+
+rm -rf -- "$img"