diff mbox series

[2/2,V2] fstests: add _require_mknod

Message ID 42fcddeb-7274-bf41-3475-16eae0f78e92@sandeen.net (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Eric Sandeen May 8, 2020, 2:23 p.m. UTC
Add a _require_mknod test so that filesystems with no ->mknod
operation will _notrun instead of fail.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

V2 trim the long line, sorry.

Comments

Christoph Hellwig May 8, 2020, 3:03 p.m. UTC | #1
On Fri, May 08, 2020 at 09:23:42AM -0500, Eric Sandeen wrote:
> Add a _require_mknod test so that filesystems with no ->mknod
> operation will _notrun instead of fail.
> 
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Eryu Guan May 17, 2020, 4:12 p.m. UTC | #2
On Fri, May 08, 2020 at 09:23:42AM -0500, Eric Sandeen wrote:
> Add a _require_mknod test so that filesystems with no ->mknod
> operation will _notrun instead of fail.
> 
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
> ---
> 
> V2 trim the long line, sorry.
> 
> diff --git a/common/rc b/common/rc
> index 2734dbf6..b50a4294 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -4214,6 +4215,13 @@ _require_sysctl()
>  	sysctl $name &>/dev/null || _notrun "$name sysctl unavailable"
>  }
>  
> +_require_mknod()
> +{
> +	mknod $TEST_DIR/$tmp.null c 1 3 \

$tmp points to /tmp/$$, so this mknod is trying to make node at

	$TEST_DIR//tmp/<pid>

which will always fail.

Use $TEST_DIR/$seq.null instead?

And I don't see any callers of this require rule, shouldn't existing
tests that use mknod be updated to require this rule?

Thanks,
Eryu

> +		|| _notrun "$FSTYP does not support mknod/mkfifo"
> +	rm -f $TEST_DIR/$tmp.null
> +}
> +
>  init_rc
>  
>  ################################################################################
>
Eric Sandeen May 17, 2020, 9:04 p.m. UTC | #3
On 5/17/20 11:12 AM, Eryu Guan wrote:
> On Fri, May 08, 2020 at 09:23:42AM -0500, Eric Sandeen wrote:
>> Add a _require_mknod test so that filesystems with no ->mknod
>> operation will _notrun instead of fail.
>>
>> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
>> ---
>>
>> V2 trim the long line, sorry.
>>
>> diff --git a/common/rc b/common/rc
>> index 2734dbf6..b50a4294 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -4214,6 +4215,13 @@ _require_sysctl()
>>  	sysctl $name &>/dev/null || _notrun "$name sysctl unavailable"
>>  }
>>  
>> +_require_mknod()
>> +{
>> +	mknod $TEST_DIR/$tmp.null c 1 3 \
> 
> $tmp points to /tmp/$$, so this mknod is trying to make node at
> 
> 	$TEST_DIR//tmp/<pid>
> 
> which will always fail.
> 
> Use $TEST_DIR/$seq.null instead?
> 
> And I don't see any callers of this require rule, shouldn't existing
> tests that use mknod be updated to require this rule?

I'm sorry Eryu, the original patch added it to all the tests and I somehow
lost that on V2, I'm really making a mess of patches lately.  :(  I'll send
a V3 with more care.
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index 2734dbf6..b50a4294 100644
--- a/common/rc
+++ b/common/rc
@@ -4214,6 +4215,13 @@  _require_sysctl()
 	sysctl $name &>/dev/null || _notrun "$name sysctl unavailable"
 }
 
+_require_mknod()
+{
+	mknod $TEST_DIR/$tmp.null c 1 3 \
+		|| _notrun "$FSTYP does not support mknod/mkfifo"
+	rm -f $TEST_DIR/$tmp.null
+}
+
 init_rc
 
 ################################################################################