test/setup: fix failure in allowed() when there is only one device
If there is only one device in ${devs[*]}, we see failure backtrace: ========== Backtrace start: ========== in /home/jenkins/spdk_repo/spdk/test/setup/acl.sh:41 -> allowed([]) ... 36 } 37 38 allowed() { 39 PCI_ALLOWED="${devs[0]}" setup output config \ 40 | grep "Skipping denied controller at " \ => 41 | grep -v "${devs[0]}" 42 verify "${devs[@]:1}" 43 setup reset 44 } 45 46 setup reset Signed-off-by: Rui Chang <rui.chang@arm.com> Change-Id: I9aba6b19f6de6bea7149e0f39da8d5d8d6978a4e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7467 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Michal Berger <michalx.berger@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
a417658803
commit
8af74b5ac7
@ -11,6 +11,7 @@ collect_setup_devs() {
|
||||
|
||||
while read -r _ dev _ _ _ driver _; do
|
||||
[[ $dev == *:*:*.* ]] || continue
|
||||
[[ $driver == nvme ]] || continue
|
||||
devs+=("$dev") drivers["$dev"]=$driver
|
||||
done < <(setup output status)
|
||||
((${#devs[@]} > 0))
|
||||
@ -37,8 +38,7 @@ denied() {
|
||||
|
||||
allowed() {
|
||||
PCI_ALLOWED="${devs[0]}" setup output config \
|
||||
| grep "Skipping denied controller at " \
|
||||
| grep -v "${devs[0]}"
|
||||
| grep -E "${devs[0]} .*: ${drivers["${devs[0]}"]} -> .*"
|
||||
verify "${devs[@]:1}"
|
||||
setup reset
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user