From c80e7df5c3bb6137f46f1c52df6831d0eae80996 Mon Sep 17 00:00:00 2001 From: cunyinch Date: Mon, 19 Jun 2017 11:48:36 +0800 Subject: [PATCH] test/nvme: optimization of hotplug script. Change-Id: I167faf4daf04e50b7cb74a90cfeaa0f7a78a113a Signed-off-by: cunyinch Reviewed-on: https://review.gerrithub.io/366032 Tested-by: SPDK Automated Test System Reviewed-by: Ziye Yang Reviewed-by: Daniel Verkamp Reviewed-by: Ben Walker --- test/lib/nvme/hotplug.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lib/nvme/hotplug.sh b/test/lib/nvme/hotplug.sh index 827ed7561..6a4ac1e10 100755 --- a/test/lib/nvme/hotplug.sh +++ b/test/lib/nvme/hotplug.sh @@ -21,13 +21,13 @@ function monitor_cmd() { } function get_online_devices_count() { - ssh_vm "lspci | grep "NVM" | wc -l" + ssh_vm "lspci | grep -c NVM" } function wait_for_devices_ready() { count=$(get_online_devices_count) - while [ "$count" -ne "4" ]; do + while [ $count -ne 4 ]; do echo "waitting for all devices online" count=$(get_online_devices_count) done