Skip to content

Commit

Permalink
Merge pull request #13 from egreen77/master
Browse files Browse the repository at this point in the history
Fix unquoted variables in pci diag test
  • Loading branch information
garlick authored Aug 12, 2021
2 parents 8d6d92c + 9d29070 commit e05e5bf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions diags/pci.t
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ which lspci >/dev/null 2>&1 || diag_plan_skip "lspci is not installed"
diag_plan $(($numdev * 3))

for i in $(seq 0 $(($numdev - 1))); do
location=${DIAG_PCI_SLOT[$i]}
name=$(echo ${DIAG_PCI_NAME[$i]}|normalize_whitespace)
speed=${DIAG_PCI_SPEED[$i]}
width=${DIAG_PCI_WIDTH[$i]}
location="${DIAG_PCI_SLOT[$i]}"
name=$(echo "${DIAG_PCI_NAME[$i]}"|normalize_whitespace)
speed="${DIAG_PCI_SPEED[$i]}"
width="${DIAG_PCI_WIDTH[$i]}"

if [ -n "$name" ] && [ -n "$location" ] ; then
gotname=$(getname $location)
if [ "$name" != "$gotname" ] && ! [[ "$gotname" =~ $name ]]; then
if [ "$name" != "$gotname" ] && ! [[ "$gotname" =~ "$name" ]]; then
diag_fail "$location name $gotname, expected $name"
else
diag_ok "$location name $gotname"
Expand Down

0 comments on commit e05e5bf

Please sign in to comment.