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

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

 



smptest was failing and we didn't notice, turn it into unit test.

Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>
---
 x86/smptest.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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();
 }
-- 
2.2.1

--
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