render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
7a3408
From eac642265fb445d028457e9f974dd3ae5f5b9529 Mon Sep 17 00:00:00 2001
7a3408
Message-Id: <eac642265fb445d028457e9f974dd3ae5f5b9529@dist-git>
7a3408
From: Andrea Bolognani <abologna@redhat.com>
7a3408
Date: Fri, 21 Aug 2015 16:36:04 -0700
7a3408
Subject: [PATCH] tests: Add some compatibility-related cases to the CPU tests
7a3408
7a3408
(cherry picked from commit 7dc52241b314adb19ca4f0af156d772e3d5a29a5)
7a3408
7a3408
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1251927
7a3408
7a3408
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7a3408
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7a3408
---
7a3408
 tests/cputest.c                                            | 14 ++++++++++++++
7a3408
 tests/cputestdata/ppc64-guest-compat-incompatible.xml      |  3 +++
7a3408
 tests/cputestdata/ppc64-guest-compat-invalid.xml           |  3 +++
7a3408
 tests/cputestdata/ppc64-guest-compat-none.xml              |  1 +
7a3408
 tests/cputestdata/ppc64-guest-compat-valid.xml             |  3 +++
7a3408
 tests/cputestdata/ppc64-guest-host-model.xml               |  3 +++
7a3408
 tests/cputestdata/ppc64-host+guest-compat-incompatible.xml |  3 +++
7a3408
 tests/cputestdata/ppc64-host+guest-compat-invalid.xml      |  3 +++
7a3408
 tests/cputestdata/ppc64-host+guest-compat-none.xml         |  3 +++
7a3408
 tests/cputestdata/ppc64-host+guest-compat-valid.xml        |  3 +++
7a3408
 tests/cputestdata/ppc64-host+guest-host-model.xml          |  3 +++
7a3408
 tests/cputestdata/ppc64-host+guest-legacy-incompatible.xml |  3 +++
7a3408
 tests/cputestdata/ppc64-host+guest-legacy-invalid.xml      |  3 +++
7a3408
 tests/cputestdata/ppc64-host+guest-legacy.xml              |  3 +++
7a3408
 tests/cputestdata/ppc64-host+guest-nofallback.xml          |  3 +++
7a3408
 tests/cputestdata/ppc64-host+guest.xml                     |  3 +++
7a3408
 16 files changed, 57 insertions(+)
7a3408
 create mode 100644 tests/cputestdata/ppc64-guest-compat-incompatible.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-guest-compat-invalid.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-guest-compat-none.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-guest-compat-valid.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-guest-host-model.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-host+guest-compat-incompatible.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-host+guest-compat-invalid.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-host+guest-compat-none.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-host+guest-compat-valid.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-host+guest-host-model.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-host+guest-legacy-incompatible.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-host+guest-legacy-invalid.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-host+guest-legacy.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-host+guest-nofallback.xml
7a3408
 create mode 100644 tests/cputestdata/ppc64-host+guest.xml
7a3408
7a3408
diff --git a/tests/cputest.c b/tests/cputest.c
7a3408
index 5992dd0..431b587 100644
7a3408
--- a/tests/cputest.c
7a3408
+++ b/tests/cputest.c
7a3408
@@ -607,6 +607,10 @@ mymain(void)
7a3408
     DO_TEST_COMPARE("ppc64", "host", "guest-legacy", VIR_CPU_COMPARE_IDENTICAL);
7a3408
     DO_TEST_COMPARE("ppc64", "host", "guest-legacy-incompatible", VIR_CPU_COMPARE_INCOMPATIBLE);
7a3408
     DO_TEST_COMPARE("ppc64", "host", "guest-legacy-invalid", VIR_CPU_COMPARE_ERROR);
7a3408
+    DO_TEST_COMPARE("ppc64", "host", "guest-compat-none", VIR_CPU_COMPARE_IDENTICAL);
7a3408
+    DO_TEST_COMPARE("ppc64", "host", "guest-compat-valid", VIR_CPU_COMPARE_IDENTICAL);
7a3408
+    DO_TEST_COMPARE("ppc64", "host", "guest-compat-invalid", VIR_CPU_COMPARE_ERROR);
7a3408
+    DO_TEST_COMPARE("ppc64", "host", "guest-compat-incompatible", VIR_CPU_COMPARE_INCOMPATIBLE);
7a3408
 
7a3408
     /* guest updates for migration
7a3408
      * automatically compares host CPU with the result */
7a3408
@@ -618,6 +622,16 @@ mymain(void)
7a3408
     DO_TEST_UPDATE("x86", "host", "host-passthrough", VIR_CPU_COMPARE_IDENTICAL);
7a3408
     DO_TEST_UPDATE("x86", "host-invtsc", "host-model", VIR_CPU_COMPARE_SUPERSET);
7a3408
 
7a3408
+    DO_TEST_UPDATE("ppc64", "host", "guest", VIR_CPU_COMPARE_IDENTICAL);
7a3408
+    DO_TEST_UPDATE("ppc64", "host", "guest-nofallback", VIR_CPU_COMPARE_INCOMPATIBLE);
7a3408
+    DO_TEST_UPDATE("ppc64", "host", "guest-legacy", VIR_CPU_COMPARE_IDENTICAL);
7a3408
+    DO_TEST_UPDATE("ppc64", "host", "guest-legacy-incompatible", VIR_CPU_COMPARE_INCOMPATIBLE);
7a3408
+    DO_TEST_UPDATE("ppc64", "host", "guest-legacy-invalid", VIR_CPU_COMPARE_ERROR);
7a3408
+    DO_TEST_UPDATE("ppc64", "host", "guest-compat-none", VIR_CPU_COMPARE_IDENTICAL);
7a3408
+    DO_TEST_UPDATE("ppc64", "host", "guest-compat-valid", VIR_CPU_COMPARE_IDENTICAL);
7a3408
+    DO_TEST_UPDATE("ppc64", "host", "guest-compat-invalid", VIR_CPU_COMPARE_ERROR);
7a3408
+    DO_TEST_UPDATE("ppc64", "host", "guest-compat-incompatible", VIR_CPU_COMPARE_INCOMPATIBLE);
7a3408
+
7a3408
     /* computing baseline CPUs */
7a3408
     DO_TEST_BASELINE("x86", "incompatible-vendors", 0, -1);
7a3408
     DO_TEST_BASELINE("x86", "no-vendor", 0, 0);
7a3408
diff --git a/tests/cputestdata/ppc64-guest-compat-incompatible.xml b/tests/cputestdata/ppc64-guest-compat-incompatible.xml
7a3408
new file mode 100644
7a3408
index 0000000..3f130fa
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-guest-compat-incompatible.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='host-model'>
7a3408
+  <model>power8</model>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-guest-compat-invalid.xml b/tests/cputestdata/ppc64-guest-compat-invalid.xml
7a3408
new file mode 100644
7a3408
index 0000000..f35cb21
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-guest-compat-invalid.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='host-model'>
7a3408
+  <model>power7+</model>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-guest-compat-none.xml b/tests/cputestdata/ppc64-guest-compat-none.xml
7a3408
new file mode 100644
7a3408
index 0000000..fd50c03
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-guest-compat-none.xml
7a3408
@@ -0,0 +1 @@
7a3408
+<cpu mode='host-model'/>
7a3408
diff --git a/tests/cputestdata/ppc64-guest-compat-valid.xml b/tests/cputestdata/ppc64-guest-compat-valid.xml
7a3408
new file mode 100644
7a3408
index 0000000..bf01e54
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-guest-compat-valid.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='host-model'>
7a3408
+  <model>power6</model>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-guest-host-model.xml b/tests/cputestdata/ppc64-guest-host-model.xml
7a3408
new file mode 100644
7a3408
index 0000000..188ebeb
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-guest-host-model.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='host-model'>
7a3408
+  <model fallback='allow'/>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-host+guest-compat-incompatible.xml b/tests/cputestdata/ppc64-host+guest-compat-incompatible.xml
7a3408
new file mode 100644
7a3408
index 0000000..1fab751
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-host+guest-compat-incompatible.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='host-model' match='exact'>
7a3408
+  <model fallback='allow'>power8</model>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-host+guest-compat-invalid.xml b/tests/cputestdata/ppc64-host+guest-compat-invalid.xml
7a3408
new file mode 100644
7a3408
index 0000000..bc0d829
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-host+guest-compat-invalid.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='host-model' match='exact'>
7a3408
+  <model fallback='allow'>power7+</model>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-host+guest-compat-none.xml b/tests/cputestdata/ppc64-host+guest-compat-none.xml
7a3408
new file mode 100644
7a3408
index 0000000..188ebeb
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-host+guest-compat-none.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='host-model'>
7a3408
+  <model fallback='allow'/>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-host+guest-compat-valid.xml b/tests/cputestdata/ppc64-host+guest-compat-valid.xml
7a3408
new file mode 100644
7a3408
index 0000000..da9cc91
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-host+guest-compat-valid.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='host-model' match='exact'>
7a3408
+  <model fallback='allow'>power6</model>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-host+guest-host-model.xml b/tests/cputestdata/ppc64-host+guest-host-model.xml
7a3408
new file mode 100644
7a3408
index 0000000..188ebeb
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-host+guest-host-model.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='host-model'>
7a3408
+  <model fallback='allow'/>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-host+guest-legacy-incompatible.xml b/tests/cputestdata/ppc64-host+guest-legacy-incompatible.xml
7a3408
new file mode 100644
7a3408
index 0000000..f5b8384
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-host+guest-legacy-incompatible.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='custom' match='exact'>
7a3408
+  <model fallback='allow'>POWER8_v1.0</model>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-host+guest-legacy-invalid.xml b/tests/cputestdata/ppc64-host+guest-legacy-invalid.xml
7a3408
new file mode 100644
7a3408
index 0000000..be059c3
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-host+guest-legacy-invalid.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='custom' match='exact'>
7a3408
+  <model fallback='allow'>POWER8E_v1.0</model>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-host+guest-legacy.xml b/tests/cputestdata/ppc64-host+guest-legacy.xml
7a3408
new file mode 100644
7a3408
index 0000000..36bae52
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-host+guest-legacy.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='custom' match='exact'>
7a3408
+  <model fallback='allow'>POWER7_v2.3</model>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-host+guest-nofallback.xml b/tests/cputestdata/ppc64-host+guest-nofallback.xml
7a3408
new file mode 100644
7a3408
index 0000000..0223018
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-host+guest-nofallback.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='custom' match='exact'>
7a3408
+  <model fallback='forbid'>POWER8</model>
7a3408
+</cpu>
7a3408
diff --git a/tests/cputestdata/ppc64-host+guest.xml b/tests/cputestdata/ppc64-host+guest.xml
7a3408
new file mode 100644
7a3408
index 0000000..7fac4b7
7a3408
--- /dev/null
7a3408
+++ b/tests/cputestdata/ppc64-host+guest.xml
7a3408
@@ -0,0 +1,3 @@
7a3408
+<cpu mode='custom' match='exact'>
7a3408
+  <model fallback='allow'>POWER7</model>
7a3408
+</cpu>
7a3408
-- 
7a3408
2.5.0
7a3408