[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240617103337.GQ8447@kernel.org>
Date: Mon, 17 Jun 2024 11:33:37 +0100
From: Simon Horman <horms@...nel.org>
To: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Cc: Aaron Conole <aconole@...hat.com>, Adrian Moreno <amorenoz@...hat.com>,
Pravin B Shelar <pshelar@....org>, Shuah Khan <shuah@...nel.org>,
netdev@...r.kernel.org, dev@...nvswitch.org,
linux-kselftest@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net] selftests: openvswitch: Use bash as interpreter
On Mon, Jun 17, 2024 at 12:05:11PM +0200, Przemek Kitszel wrote:
> On 6/17/24 10:28, Simon Horman wrote:
> > openvswitch.sh makes use of substitutions of the form ${ns:0:1}, to
> > obtain the first character of $ns. Empirically, this is works with bash
> > but not dash. When run with dash these evaluate to an empty string and
> > printing an error to stdout.
> >
> > # dash -c 'ns=client; echo "${ns:0:1}"' 2>error
> > # cat error
> > dash: 1: Bad substitution
> > # bash -c 'ns=client; echo "${ns:0:1}"' 2>error
> > c
> > # cat error
> >
> > This leads to tests that neither pass nor fail.
> > F.e.
> >
> > TEST: arp_ping [START]
> > adding sandbox 'test_arp_ping'
> > Adding DP/Bridge IF: sbx:test_arp_ping dp:arpping {, , }
> > create namespaces
> > ./openvswitch.sh: 282: eval: Bad substitution
> > TEST: ct_connect_v4 [START]
> > adding sandbox 'test_ct_connect_v4'
> > Adding DP/Bridge IF: sbx:test_ct_connect_v4 dp:ct4 {, , }
> > ./openvswitch.sh: 322: eval: Bad substitution
> > create namespaces
> >
> > Resolve this by making openvswitch.sh a bash script.
> >
> > Fixes: 918423fda910 ("selftests: openvswitch: add an initial flow programming case")
> > Signed-off-by: Simon Horman <horms@...nel.org>
>
> That's good fix,
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
>
> sidenote: I like very much the idea to use the least powerful tool, like
> sh vs bash, awk vs gawk, but it breaks when we forget what is outside of
> the scope of the former/standard.
> Perhaps for shell, we could convert all the selftests at once?
Thanks,
Now that you mention it, I have the same feelings.
Do we ever expect to use the minimal tools, when other
parts of the test suite depend on the enhanced ones?
...
Powered by blists - more mailing lists