test/nvmf: Replace [ with [[ test in allocate_nic_ips()
The former will force Bash to complain if $ip consists of more than one ip address. E.g.: 1:08:55 # '[' -z 192.168.121.37 192.168.121.36 ']' line 104: [: 192.168.121.37: binary operator expected The alternative is to properly quote the $ip inside [, however, [[ is always the safest approach. Change-Id: Iced7319a106ce35a183840984aa6e6e1e52caa16 Signed-off-by: Michal Berger <michalx.berger@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4478 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
26811624b8
commit
e351dca373
@ -101,7 +101,7 @@ function allocate_nic_ips() {
|
||||
((count = NVMF_IP_LEAST_ADDR))
|
||||
for nic_name in $(get_rdma_if_list); do
|
||||
ip="$(get_ip_address $nic_name)"
|
||||
if [ -z $ip ]; then
|
||||
if [[ -z $ip ]]; then
|
||||
ip addr add $NVMF_IP_PREFIX.$count/24 dev $nic_name
|
||||
ip link set $nic_name up
|
||||
((count = count + 1))
|
||||
|
Loading…
Reference in New Issue
Block a user