[PATCH 18/18] tests: Add a bunch of ppc64 cases to the cpu test

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

 



New test cases cover the cpuCompare() and cpuBaseline() implementation.
---
 tests/cputest.c                                          | 10 ++++++++++
 tests/cputestdata/ppc64-baseline-incompatible-models.xml | 14 ++++++++++++++
 tests/cputestdata/ppc64-baseline-same-model-result.xml   |  3 +++
 tests/cputestdata/ppc64-baseline-same-model.xml          | 14 ++++++++++++++
 tests/cputestdata/ppc64-host-better.xml                  |  6 ++++++
 tests/cputestdata/ppc64-host-incomp-arch.xml             |  6 ++++++
 tests/cputestdata/ppc64-host-no-vendor.xml               |  5 +++++
 tests/cputestdata/ppc64-host-worse.xml                   |  6 ++++++
 8 files changed, 64 insertions(+)
 create mode 100644 tests/cputestdata/ppc64-baseline-incompatible-models.xml
 create mode 100644 tests/cputestdata/ppc64-baseline-same-model-result.xml
 create mode 100644 tests/cputestdata/ppc64-baseline-same-model.xml
 create mode 100644 tests/cputestdata/ppc64-host-better.xml
 create mode 100644 tests/cputestdata/ppc64-host-incomp-arch.xml
 create mode 100644 tests/cputestdata/ppc64-host-no-vendor.xml
 create mode 100644 tests/cputestdata/ppc64-host-worse.xml

diff --git a/tests/cputest.c b/tests/cputest.c
index 82999f8..5f17145 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -563,6 +563,13 @@ mymain(void)
     DO_TEST_COMPARE("x86", "host", "host-no-vendor", VIR_CPU_COMPARE_IDENTICAL);
     DO_TEST_COMPARE("x86", "host-no-vendor", "host", VIR_CPU_COMPARE_INCOMPATIBLE);
 
+    DO_TEST_COMPARE("ppc64", "host", "host", VIR_CPU_COMPARE_IDENTICAL);
+    DO_TEST_COMPARE("ppc64", "host", "host-better", VIR_CPU_COMPARE_INCOMPATIBLE);
+    DO_TEST_COMPARE("ppc64", "host", "host-worse", VIR_CPU_COMPARE_INCOMPATIBLE);
+    DO_TEST_COMPARE("ppc64", "host", "host-incomp-arch", VIR_CPU_COMPARE_INCOMPATIBLE);
+    DO_TEST_COMPARE("ppc64", "host", "host-no-vendor", VIR_CPU_COMPARE_IDENTICAL);
+    DO_TEST_COMPARE("ppc64", "host-no-vendor", "host", VIR_CPU_COMPARE_INCOMPATIBLE);
+
     /* guest to host comparison */
     DO_TEST_COMPARE("x86", "host", "bogus-model", VIR_CPU_COMPARE_ERROR);
     DO_TEST_COMPARE("x86", "host", "bogus-feature", VIR_CPU_COMPARE_ERROR);
@@ -619,6 +626,9 @@ mymain(void)
 
     DO_TEST_BASELINE("ppc64", "incompatible-vendors", 0, -1);
     DO_TEST_BASELINE("ppc64", "no-vendor", 0, 0);
+    DO_TEST_BASELINE("ppc64", "incompatible-models", 0, -1);
+    DO_TEST_BASELINE("ppc64", "same-model", 0, 0);
+
     /* CPU features */
     DO_TEST_HASFEATURE("x86", "host", "vmx", YES);
     DO_TEST_HASFEATURE("x86", "host", "lm", YES);
diff --git a/tests/cputestdata/ppc64-baseline-incompatible-models.xml b/tests/cputestdata/ppc64-baseline-incompatible-models.xml
new file mode 100644
index 0000000..7e7b9a6
--- /dev/null
+++ b/tests/cputestdata/ppc64-baseline-incompatible-models.xml
@@ -0,0 +1,14 @@
+<cpuTest>
+<cpu>
+  <arch>ppc64</arch>
+  <model>POWER7</model>
+  <vendor>IBM</vendor>
+  <topology sockets='2' cores='4' threads='1'/>
+</cpu>
+<cpu>
+  <arch>ppc64</arch>
+  <model>POWER8</model>
+  <vendor>IBM</vendor>
+  <topology sockets='1' cores='1' threads='1'/>
+</cpu>
+</cpuTest>
diff --git a/tests/cputestdata/ppc64-baseline-same-model-result.xml b/tests/cputestdata/ppc64-baseline-same-model-result.xml
new file mode 100644
index 0000000..dc0c862
--- /dev/null
+++ b/tests/cputestdata/ppc64-baseline-same-model-result.xml
@@ -0,0 +1,3 @@
+<cpu mode='custom' match='exact'>
+  <model fallback='allow'>POWER8</model>
+</cpu>
diff --git a/tests/cputestdata/ppc64-baseline-same-model.xml b/tests/cputestdata/ppc64-baseline-same-model.xml
new file mode 100644
index 0000000..dceae83
--- /dev/null
+++ b/tests/cputestdata/ppc64-baseline-same-model.xml
@@ -0,0 +1,14 @@
+<cpuTest>
+<cpu>
+  <arch>ppc64</arch>
+  <model>POWER8</model>
+  <vendor>IBM</vendor>
+  <topology sockets='2' cores='4' threads='1'/>
+</cpu>
+<cpu>
+  <arch>ppc64</arch>
+  <model>POWER8</model>
+  <vendor>IBM</vendor>
+  <topology sockets='1' cores='1' threads='1'/>
+</cpu>
+</cpuTest>
diff --git a/tests/cputestdata/ppc64-host-better.xml b/tests/cputestdata/ppc64-host-better.xml
new file mode 100644
index 0000000..af87412
--- /dev/null
+++ b/tests/cputestdata/ppc64-host-better.xml
@@ -0,0 +1,6 @@
+<cpu>
+  <arch>ppc64</arch>
+  <model>POWER8</model>
+  <vendor>IBM</vendor>
+  <topology sockets='1' cores='64' threads='1'/>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host-incomp-arch.xml b/tests/cputestdata/ppc64-host-incomp-arch.xml
new file mode 100644
index 0000000..195f436
--- /dev/null
+++ b/tests/cputestdata/ppc64-host-incomp-arch.xml
@@ -0,0 +1,6 @@
+<cpu>
+  <arch>x86_64</arch>
+  <model>POWER7</model>
+  <vendor>IBM</vendor>
+  <topology sockets='1' cores='64' threads='1'/>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host-no-vendor.xml b/tests/cputestdata/ppc64-host-no-vendor.xml
new file mode 100644
index 0000000..de73006
--- /dev/null
+++ b/tests/cputestdata/ppc64-host-no-vendor.xml
@@ -0,0 +1,5 @@
+<cpu>
+  <arch>ppc64</arch>
+  <model>POWER7</model>
+  <topology sockets='1' cores='64' threads='1'/>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host-worse.xml b/tests/cputestdata/ppc64-host-worse.xml
new file mode 100644
index 0000000..ba1806b
--- /dev/null
+++ b/tests/cputestdata/ppc64-host-worse.xml
@@ -0,0 +1,6 @@
+<cpu>
+  <arch>ppc64</arch>
+  <model>POWER6</model>
+  <vendor>IBM</vendor>
+  <topology sockets='1' cores='64' threads='1'/>
+</cpu>
-- 
2.4.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]