test/vhost: Fix traddr lookup
get_traddr() was looking for INI configuration, however, gen_nvme.sh now supports only json flavor. Use jq in such a case to get proper traddr. Change-Id: Ifb5e5e8b3cf3c7b21f67f6129173dcd09cecc6ec Signed-off-by: Michal Berger <michalx.berger@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5578 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Community-CI: Mellanox Build Bot
This commit is contained in:
parent
e18788d30e
commit
6b52336516
@ -208,17 +208,10 @@ function check_disks() {
|
||||
function get_traddr() {
|
||||
local nvme_name=$1
|
||||
local nvme
|
||||
|
||||
nvme="$($rootdir/scripts/gen_nvme.sh)"
|
||||
while read -r line; do
|
||||
if [[ $line == *"TransportID"* ]] && [[ $line == *$nvme_name* ]]; then
|
||||
local word_array=($line)
|
||||
for word in "${word_array[@]}"; do
|
||||
if [[ $word == *"traddr"* ]]; then
|
||||
traddr=$(echo $word | sed 's/traddr://' | sed 's/"//')
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done <<< "$nvme"
|
||||
traddr=$(jq -r ".config[] | select(.params.name == \"$nvme_name\") | .params.trtype" <<< "$nvme")
|
||||
[[ -n $traddr ]] || return 1
|
||||
}
|
||||
|
||||
function delete_nvme() {
|
||||
|
Loading…
Reference in New Issue
Block a user