public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Zorro Lang <zlang@redhat.com>
Cc: "fstests@vger.kernel.org" <fstests@vger.kernel.org>,
	Jeff Moyer <jmoyer@redhat.com>
Subject: Re: [PATCH] common/rc: explicitly test for engine availability in _require_fio
Date: Fri, 14 Mar 2025 09:39:14 -0500	[thread overview]
Message-ID: <2d814fda-6ce4-4758-a55e-387f05b3dedf@redhat.com> (raw)
In-Reply-To: <20250314143609.wk4ceplp5y3tw4mo@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>

On 3/14/25 9:36 AM, Zorro Lang wrote:
> On Wed, Mar 12, 2025 at 11:48:11AM -0500, Eric Sandeen wrote:
>> The current test in _require_fio (--warnings-fatal --showcmd) does not
>> fail if an invalid/unavailable io engine is specified.
>>
>> Add an explicit test that every requested io engine in the job file
>> is actually available.
>>
>> Remove the "ioe_e4defrag" entries in ext4 tests - an engine with this
>> name has seemingly never existed, but in each case later stanzas
>> overrode the io engine, so it did not cause problems without this
>> explicit parsing and checking.
>>
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>
>> diff --git a/common/rc b/common/rc
>> index ca755055..c155bb46 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -3983,6 +3983,12 @@ _require_fio()
>>  		return 1;
>>  	fi
>>  
>> +	# Explicitly check for every ioengine availability
>> +	for ENGINE in `grep ioengine= $job | awk -F= '{print $2}'; sort`; do
>             ^^^^^^
> 
> I think a local variable is enough, e.g. "local eng".
> 
> And, how about:
>   for eng in `sed -n "s/ioengine=\(.*\)/\1/p" $job`
> 
>> +		fio --enghelp | grep -qw $ENGINE || \
>                 ^^^
>               $FIO_PROG
> 
> And to make sure the "||" checks the return value of grep, how about:
> 
>   grep -wq $eng <($FIO_PROG --enghelp 2>/dev/null) ||

Clearly my bash-fu is lacking!
 
> 
> Others look good to me.

Ok, I'll try this. Also noticing that I typo'd "sort" which was supposed
to be via a pipe, as well as a missing "uniq" :( sorry about that.

-Eric


  reply	other threads:[~2025-03-14 14:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 16:48 [PATCH] common/rc: explicitly test for engine availability in _require_fio Eric Sandeen
2025-03-14 14:36 ` Zorro Lang
2025-03-14 14:39   ` Eric Sandeen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-18 10:08 Zorro Lang
2025-03-18 13:23 ` Zorro Lang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d814fda-6ce4-4758-a55e-387f05b3dedf@redhat.com \
    --to=sandeen@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=jmoyer@redhat.com \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox