diff mbox series

[1/1] xfs/018: make sure that larp mode actually works

Message ID 169567816694.2269819.8230834804621611518.stgit@frogsfrogsfrogs (mailing list archive)
State New, archived
Headers show
Series fstests: disallow LARP on old fses | expand

Commit Message

Darrick J. Wong Sept. 25, 2023, 9:42 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Skip this test if larp mode doesn't work.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/018 |   13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Zorro Lang Sept. 29, 2023, 5:17 a.m. UTC | #1
On Mon, Sep 25, 2023 at 02:42:46PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Skip this test if larp mode doesn't work.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  tests/xfs/018 |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> 
> diff --git a/tests/xfs/018 b/tests/xfs/018
> index 1ef51a2e61..73040edc92 100755
> --- a/tests/xfs/018
> +++ b/tests/xfs/018
> @@ -71,6 +71,17 @@ create_test_file()
>  	done
>  }
>  
> +require_larp()
> +{
> +	touch $SCRATCH_MNT/a
> +
> +	# Set attribute, being careful not to include the trailing newline
> +	# in the attr value.
> +	echo -n "attr_value" | ${ATTR_PROG} -s "attr_name" $SCRATCH_MNT/a 2>&1 | \
> +		grep 'Operation not supported' && \
> +		_notrun 'LARP not supported on this filesystem'

"rm -f $SCRATCH_MNT/a" ? although that's not necessary :)

Reviewed-by: Zorro Lang <zlang@redhat.com>

> +}
> +
>  # real QA test starts here
>  _supported_fs xfs
>  
> @@ -112,6 +123,8 @@ _scratch_mount
>  testdir=$SCRATCH_MNT/testdir
>  mkdir $testdir
>  
> +require_larp
> +
>  # empty, inline
>  create_test_file empty_file1 0
>  test_attr_replay empty_file1 "attr_name" $attr64 "s" "larp"
>
diff mbox series

Patch

diff --git a/tests/xfs/018 b/tests/xfs/018
index 1ef51a2e61..73040edc92 100755
--- a/tests/xfs/018
+++ b/tests/xfs/018
@@ -71,6 +71,17 @@  create_test_file()
 	done
 }
 
+require_larp()
+{
+	touch $SCRATCH_MNT/a
+
+	# Set attribute, being careful not to include the trailing newline
+	# in the attr value.
+	echo -n "attr_value" | ${ATTR_PROG} -s "attr_name" $SCRATCH_MNT/a 2>&1 | \
+		grep 'Operation not supported' && \
+		_notrun 'LARP not supported on this filesystem'
+}
+
 # real QA test starts here
 _supported_fs xfs
 
@@ -112,6 +123,8 @@  _scratch_mount
 testdir=$SCRATCH_MNT/testdir
 mkdir $testdir
 
+require_larp
+
 # empty, inline
 create_test_file empty_file1 0
 test_attr_replay empty_file1 "attr_name" $attr64 "s" "larp"