[PATCH kvm-unit-tests 1/5] arm/pci-test: skip on pci/pci-testdev probe failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some configurations don't have pci or pci-testdev. This patch
avoids saying FAIL in those cases. Instead we get SKIP.

Cc: Alexander Gordeev <agordeev@xxxxxxxxxx>
Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
---
 arm/pci-test.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/arm/pci-test.c b/arm/pci-test.c
index 10a367de5357..cf128ac1b032 100644
--- a/arm/pci-test.c
+++ b/arm/pci-test.c
@@ -14,14 +14,19 @@ int main(void)
 {
 	int ret;
 
-	if (!pci_probe())
-		report_abort("PCI bus probing failed\n");
+	if (!pci_probe()) {
+		printf("PCI bus probing failed, skipping tests...\n");
+		return report_summary();
+	}
 
 	pci_print();
 
 	ret = pci_testdev();
-	report("PCI test device passed %d/%d tests",
-		ret >= NR_TESTS, ret > 0 ? ret : 0, NR_TESTS);
+	if (ret == -1)
+		report_skip("No PCI test device");
+	else
+		report("PCI test device passed %d/%d tests",
+			ret >= NR_TESTS, ret > 0 ? ret : 0, NR_TESTS);
 
 	return report_summary();
 }
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux