netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] tests: shell: quote reference to array to iterate over empty string
@ 2023-11-21 11:11 Pablo Neira Ayuso
  0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2023-11-21 11:11 UTC (permalink / raw)
  To: netfilter-devel

This patch restores coverage for non-interval set backend.

Use "${FLAGS[@]}" in loop, otherwise empty string is skipped in the
iteration. This snippet:

  FLAGS=("")
  available_flags FLAGS "single"

  for flags in "${FLAGS[@]}" ; do
          echo $flags
  done

... now shows the empty string:

  # bash test.sh

  interval

Fixes: ed927baa4fd8 ("tests: shell: skip pipapo set backend in transactions/30s-stress")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 tests/shell/testcases/transactions/30s-stress | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/shell/testcases/transactions/30s-stress b/tests/shell/testcases/transactions/30s-stress
index ef3e1d3e3e4b..e92b922660b8 100755
--- a/tests/shell/testcases/transactions/30s-stress
+++ b/tests/shell/testcases/transactions/30s-stress
@@ -324,7 +324,7 @@ random_elem()
 
 			FLAGS=("")
 			available_flags FLAGS $key
-			for flags in ${FLAGS[@]} ; do
+			for flags in "${FLAGS[@]}" ; do
 				cnt=$((cnt+1))
 				if [ $f -ne fkr ] ;then
 					f=$((f+1))
-- 
2.30.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-21 11:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-21 11:11 [PATCH nft] tests: shell: quote reference to array to iterate over empty string Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).