All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: kvm@vger.kernel.org
Cc: andre.przywara@arm.com, Alexander Gordeev <agordeev@redhat.com>
Subject: [PATCH kvm-unit-tests 1/5] arm/pci-test: skip on pci/pci-testdev probe failure
Date: Wed, 14 Dec 2016 15:39:50 +0100	[thread overview]
Message-ID: <20161214143954.10452-2-drjones@redhat.com> (raw)
In-Reply-To: <20161214143954.10452-1-drjones@redhat.com>

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@redhat.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 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


  reply	other threads:[~2016-12-14 14:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14 14:39 [PATCH kvm-unit-tests 0/5] arm/arm64: few fixes Andrew Jones
2016-12-14 14:39 ` Andrew Jones [this message]
2016-12-14 14:39 ` [PATCH kvm-unit-tests 2/5] lib/arm/setup: fix and comment init order Andrew Jones
2016-12-14 14:39 ` [PATCH kvm-unit-tests 3/5] lib/powerpc/setup: comment init dependencies Andrew Jones
2016-12-14 14:39 ` [PATCH kvm-unit-tests 4/5] devicetree: cpu nodes may have 64-bit regs Andrew Jones
2016-12-14 14:39 ` [PATCH kvm-unit-tests 5/5] arm/arm64: support 64-bit MPIDRs Andrew Jones
2016-12-19 14:39 ` [PATCH kvm-unit-tests 0/5] arm/arm64: few fixes Andrew Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161214143954.10452-2-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=agordeev@redhat.com \
    --cc=andre.przywara@arm.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.