Skip to contentSkip to conversation

generic/740: add _require_scratch

PATCH In review Christoph Hellwig 2 participants 6 messages Jun 4, 2025 – Jun 5, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/740: add _require_scratch

This test requires a scratch device.

Found while playing around with a setup that only has a TEST_DIR.

---
 tests/generic/740 | 1 +
 1 file changed, 1 insertion(+)
tests/generic/740 +1 -0
index c0a634f2302b..d14e873b2fac 100755
@@ -21,6 +21,7 @@ _exclude_fs jfs
 _exclude_fs ocfs2
 _exclude_fs udf
 
+_require_scratch
 _require_block_device "${SCRATCH_DEV}"
 # not all the FS support zoned block device
 _require_non_zoned_device "${SCRATCH_DEV}"
Signature · 1 line
2.47.2
#1 lore raw
Quoted 14 lines · Christoph Hellwig

This test requires a scratch device.

Found while playing around with a setup that only has a TEST_DIR.

---
 tests/generic/740 | 1 +
 1 file changed, 1 insertion(+)
tests/generic/740 +0 -0
index c0a634f2302b..d14e873b2fac 100755

tests/generic/740 _exclude_fs jfs · line 24

Quoted 4 lines
tests/generic/740 +1 -0
@@ -21,6 +21,7 @@ _exclude_fs jfs
 _exclude_fs ocfs2
 _exclude_fs udf
 
+_require_scratch

There's a "_require_scratch_nocheck" in this test case, but it's called after the "_require_block_device". Maybe you can check below commit [1], to figure out what change do you really need :)

[1]
commit 3ae8a19f97d09852f59a8067d770930aa5f389ce

Author: Christoph Hellwig <[email protected]>
Date:   Sun Jun 23 14:10:34 2024 +0200

generic/740: enable by default

Quoted 7 lines
tests/generic/740 +0 -0
 _require_block_device "${SCRATCH_DEV}"
 # not all the FS support zoned block device
 _require_non_zoned_device "${SCRATCH_DEV}"
Signature · 1 line
2.47.2
#2 lore raw
Quoted 4 lines · Zorro Lang
Quoted 1 line

+_require_scratch

There's a "_require_scratch_nocheck" in this test case, but it's called after the "_require_block_device".

Yes. But I looked at _require_scratch_nocheck and despite the name it doesn't seem to imply _require_scratch.

#3 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Zorro Lang
Quoted 1 line

+_require_scratch

There's a "_require_scratch_nocheck" in this test case, but it's called after the "_require_block_device".

Yes. But I looked at _require_scratch_nocheck and despite the name it doesn't seem to imply _require_scratch.

Due to _require_scratch calls _require_scratch_nocheck, not converse :)

_require_scratch()

{
        _require_scratch_nocheck
        touch ${RESULT_DIR}/require_scratch
}
Quoted 2 lines
#4 lore raw
Quoted 11 lines · Zorro Lang
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Zorro Lang
Quoted 1 line

+_require_scratch

There's a "_require_scratch_nocheck" in this test case, but it's called after the "_require_block_device".

Yes. But I looked at _require_scratch_nocheck and despite the name it doesn't seem to imply _require_scratch.

Due to _require_scratch calls _require_scratch_nocheck, not converse :)

Oh, I guess I should have looked deeper..

#5 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 7 lines · Zorro Lang
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Zorro Lang
Quoted 1 line

+_require_scratch

There's a "_require_scratch_nocheck" in this test case, but it's called after the "_require_block_device".

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Yes. But I looked at _require_scratch_nocheck and despite the name it doesn't seem to imply _require_scratch.

Due to _require_scratch calls _require_scratch_nocheck, not converse :)

Oh, I guess I should have looked deeper..

I saw you did below change in commit 3ae8a19f97d0 :

  -_require_scratch_nocheck
  -_require_no_large_scratch_dev
  +_require_block_device "${SCRATCH_DEV}"
   # not all the FS support zoned block device
   _require_non_zoned_device "${SCRATCH_DEV}"

-# mkfs.btrfs did not have overwrite detection at first -if [ "$FSTYP" == "btrfs" ]; then
- grep -q 'force overwrite' echo $MKFS_BTRFS_PROG | awk '{print $1}' || \
- _notrun "Installed mkfs.btrfs does not support -f option"
-fi
+_require_scratch_nocheck +_require_no_large_scratch_dev

I don't know why you moved these two lines here, how about move them back :)

Quoted 1 line