linux-stable/tools/testing
Simon Horman a674424c23 selftests: openvswitch: Use bash as interpreter
[ Upstream commit e2b447c9a1 ]

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: 918423fda9 ("selftests: openvswitch: add an initial flow programming case")
Signed-off-by: Simon Horman <horms@kernel.org>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Link: https://lore.kernel.org/r/20240617-ovs-selftest-bash-v1-1-7ae6ccd3617b@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-27 13:49:07 +02:00
..
crypto/chacha20-s390
cxl cxl/test: Add missing vmalloc.h for tools/testing/cxl/test/mem.c 2024-06-21 14:38:26 +02:00
fault-injection
ktest ktest: force $buildonly = 1 for 'make_warnings_file' test type 2024-04-13 13:07:37 +02:00
kunit kunit: tool: fix parsing of test attributes 2024-02-05 20:14:15 +00:00
memblock memblock tests: fix warning ‘struct seq_file’ declared inside parameter list 2023-09-14 10:51:28 +03:00
nvdimm
radix-tree maple_tree: do not preallocate nodes for slot stores 2024-01-05 15:19:43 +01:00
scatterlist
selftests selftests: openvswitch: Use bash as interpreter 2024-06-27 13:49:07 +02:00
vsock vsock/test: fix SEQPACKET message bounds test 2023-12-03 07:33:05 +01:00