]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa: test fallocate fails in mode 0
authorMilind Changire <mchangir@redhat.com>
Tue, 24 Sep 2024 08:36:10 +0000 (14:06 +0530)
committerMilind Changire <mchangir@redhat.com>
Wed, 30 Oct 2024 10:11:16 +0000 (15:41 +0530)
Signed-off-by: Milind Changire <mchangir@redhat.com>
qa/workunits/fs/misc/fallocate.sh [new file with mode: 0755]

diff --git a/qa/workunits/fs/misc/fallocate.sh b/qa/workunits/fs/misc/fallocate.sh
new file mode 100755 (executable)
index 0000000..253e6cb
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh -x
+
+# fallocate with mode 0 should fail with EOPNOTSUPP
+set -e
+mkdir -p testdir
+cd testdir
+
+expect_failure() {
+       if "$@"; then return 1; else return 0; fi
+}
+
+expect_failure fallocate -l 1M preallocated.txt
+rm -f preallocated.txt
+
+cd ..
+rmdir testdir
+echo OK