diff mbox

[kvm-unit-tests,2/2] x86: smptest: use report

Message ID 1421771719-8626-3-git-send-email-rkrcmar@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Radim Krčmář Jan. 20, 2015, 4:35 p.m. UTC
smptest was failing and we didn't notice, turn it into unit test.

Signed-off-by: Radim Kr?má? <rkrcmar@redhat.com>
---
 x86/smptest.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/x86/smptest.c b/x86/smptest.c
index 37805999b3b0..acda22e18314 100644
--- a/x86/smptest.c
+++ b/x86/smptest.c
@@ -1,6 +1,8 @@ 
 #include "libcflat.h"
 #include "smp.h"
 
+unsigned nipis;
+
 static void ipi_test(void *data)
 {
     int n = (long)data;
@@ -8,6 +10,8 @@  static void ipi_test(void *data)
     printf("ipi called, cpu %d\n", n);
     if (n != smp_id())
 	printf("but wrong cpu %d\n", smp_id());
+    else
+        nipis++;
 }
 
 int main()
@@ -21,5 +25,7 @@  int main()
     printf("found %d cpus\n", ncpus);
     for (i = 0; i < ncpus; ++i)
 	on_cpu(i, ipi_test, (void *)(long)i);
-    return 0;
+
+    report("IPI to each CPU", nipis == ncpus);
+    return report_summary();
 }