Skip to contentSkip to conversation

net/virt_lib.sh: Fix quoting default variable on dash

PATCH New Petr Vorel 2 participants 3 messages May 15, 2018

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 net/virt_lib.sh: Fix quoting default variable on dash

Dash (and maybe some other posix shells) needs quoting whole argument, otherwise it's not able to assert:

/opt/ltp/testcases/bin/ipvlan01.sh: 384: local: l2,mode: bad variable name /opt/ltp/testcases/bin/vlan01.sh: 360: local: ,protocol: bad variable name

The problem was in $opt, change also $start_id to use the same convention.

Fixes dcacbcffe ("network/virt: add test-case 01 to virt_lib.sh")
       94aac42a0 ("network/virt: add test-case 02 to virt_lib.sh")
---
 testcases/network/virt/virt_lib.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/network/virt/virt_lib.sh +4 -4
index 72946c5be..095dbf3a3 100644
@@ -356,8 +356,8 @@ virt_netperf_msg_sizes()
 # OPTIONS - different options separated by comma.
 virt_test_01()
 {
-	start_id=${start_id:-"1"}
-	local opts=${1:-""}
+	start_id="${start_id:-1}"
+	local opts="${1:-}"
 	local n=0
 
 	while true; do
@@ -380,8 +380,8 @@ virt_test_01()
 # OPTIONS - different options separated by comma.
 virt_test_02()
 {
-	start_id=${start_id:-"1"}
-	local opts=${1:-""}
+	start_id="${start_id:-1}"
+	local opts="${1:-}"
 	local n=0
 
 	while true; do
Signature · 1 line
2.16.3
author
#1 lore raw

PATCH 1/1 net/virt_lib.sh: Fix quoting default variable on dash

Hi,

Quoted 2 lines

Dash (and maybe some other posix shells) needs quoting whole argument, otherwise it's not able to assert:

typo: assigned

Kind regards,
Petr

#2 lore raw

PATCH 1/1 net/virt_lib.sh: Fix quoting default variable on dash

Hi!

Quoted 3 lines
Quoted 2 lines

Dash (and maybe some other posix shells) needs quoting whole argument, otherwise it's not able to assert:

typo: assigned

Fixed the typo and pushed, thanks.

Signature · 2 lines
Cyril Hrubis
[email protected]