From b0690837f31f4d0d357a7d0f73b1f8d4b733b82a Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Tue, 24 Sep 2024 14:06:10 +0530 Subject: [PATCH] qa: test fallocate fails in mode 0 Signed-off-by: Milind Changire --- qa/workunits/fs/misc/fallocate.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 qa/workunits/fs/misc/fallocate.sh diff --git a/qa/workunits/fs/misc/fallocate.sh b/qa/workunits/fs/misc/fallocate.sh new file mode 100755 index 00000000000..253e6cb7a37 --- /dev/null +++ b/qa/workunits/fs/misc/fallocate.sh @@ -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 -- 2.39.5