]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Add some compatibility-related cases to the CPU tests
authorAndrea Bolognani <abologna@redhat.com>
Fri, 14 Aug 2015 14:45:18 +0000 (16:45 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 21 Aug 2015 22:42:38 +0000 (15:42 -0700)
16 files changed:
tests/cputest.c
tests/cputestdata/ppc64-guest-compat-incompatible.xml [new file with mode: 0644]
tests/cputestdata/ppc64-guest-compat-invalid.xml [new file with mode: 0644]
tests/cputestdata/ppc64-guest-compat-none.xml [new file with mode: 0644]
tests/cputestdata/ppc64-guest-compat-valid.xml [new file with mode: 0644]
tests/cputestdata/ppc64-guest-host-model.xml [new file with mode: 0644]
tests/cputestdata/ppc64-host+guest-compat-incompatible.xml [new file with mode: 0644]
tests/cputestdata/ppc64-host+guest-compat-invalid.xml [new file with mode: 0644]
tests/cputestdata/ppc64-host+guest-compat-none.xml [new file with mode: 0644]
tests/cputestdata/ppc64-host+guest-compat-valid.xml [new file with mode: 0644]
tests/cputestdata/ppc64-host+guest-host-model.xml [new file with mode: 0644]
tests/cputestdata/ppc64-host+guest-legacy-incompatible.xml [new file with mode: 0644]
tests/cputestdata/ppc64-host+guest-legacy-invalid.xml [new file with mode: 0644]
tests/cputestdata/ppc64-host+guest-legacy.xml [new file with mode: 0644]
tests/cputestdata/ppc64-host+guest-nofallback.xml [new file with mode: 0644]
tests/cputestdata/ppc64-host+guest.xml [new file with mode: 0644]

index 5992dd0cecc508a788e7282e144721dfa0a8af3d..431b587061e32389c7b9e2caf1bd0271762480dd 100644 (file)
@@ -607,6 +607,10 @@ mymain(void)
     DO_TEST_COMPARE("ppc64", "host", "guest-legacy", VIR_CPU_COMPARE_IDENTICAL);
     DO_TEST_COMPARE("ppc64", "host", "guest-legacy-incompatible", VIR_CPU_COMPARE_INCOMPATIBLE);
     DO_TEST_COMPARE("ppc64", "host", "guest-legacy-invalid", VIR_CPU_COMPARE_ERROR);
+    DO_TEST_COMPARE("ppc64", "host", "guest-compat-none", VIR_CPU_COMPARE_IDENTICAL);
+    DO_TEST_COMPARE("ppc64", "host", "guest-compat-valid", VIR_CPU_COMPARE_IDENTICAL);
+    DO_TEST_COMPARE("ppc64", "host", "guest-compat-invalid", VIR_CPU_COMPARE_ERROR);
+    DO_TEST_COMPARE("ppc64", "host", "guest-compat-incompatible", VIR_CPU_COMPARE_INCOMPATIBLE);
 
     /* guest updates for migration
      * automatically compares host CPU with the result */
@@ -618,6 +622,16 @@ mymain(void)
     DO_TEST_UPDATE("x86", "host", "host-passthrough", VIR_CPU_COMPARE_IDENTICAL);
     DO_TEST_UPDATE("x86", "host-invtsc", "host-model", VIR_CPU_COMPARE_SUPERSET);
 
+    DO_TEST_UPDATE("ppc64", "host", "guest", VIR_CPU_COMPARE_IDENTICAL);
+    DO_TEST_UPDATE("ppc64", "host", "guest-nofallback", VIR_CPU_COMPARE_INCOMPATIBLE);
+    DO_TEST_UPDATE("ppc64", "host", "guest-legacy", VIR_CPU_COMPARE_IDENTICAL);
+    DO_TEST_UPDATE("ppc64", "host", "guest-legacy-incompatible", VIR_CPU_COMPARE_INCOMPATIBLE);
+    DO_TEST_UPDATE("ppc64", "host", "guest-legacy-invalid", VIR_CPU_COMPARE_ERROR);
+    DO_TEST_UPDATE("ppc64", "host", "guest-compat-none", VIR_CPU_COMPARE_IDENTICAL);
+    DO_TEST_UPDATE("ppc64", "host", "guest-compat-valid", VIR_CPU_COMPARE_IDENTICAL);
+    DO_TEST_UPDATE("ppc64", "host", "guest-compat-invalid", VIR_CPU_COMPARE_ERROR);
+    DO_TEST_UPDATE("ppc64", "host", "guest-compat-incompatible", VIR_CPU_COMPARE_INCOMPATIBLE);
+
     /* computing baseline CPUs */
     DO_TEST_BASELINE("x86", "incompatible-vendors", 0, -1);
     DO_TEST_BASELINE("x86", "no-vendor", 0, 0);
diff --git a/tests/cputestdata/ppc64-guest-compat-incompatible.xml b/tests/cputestdata/ppc64-guest-compat-incompatible.xml
new file mode 100644 (file)
index 0000000..3f130fa
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='host-model'>
+  <model>power8</model>
+</cpu>
diff --git a/tests/cputestdata/ppc64-guest-compat-invalid.xml b/tests/cputestdata/ppc64-guest-compat-invalid.xml
new file mode 100644 (file)
index 0000000..f35cb21
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='host-model'>
+  <model>power7+</model>
+</cpu>
diff --git a/tests/cputestdata/ppc64-guest-compat-none.xml b/tests/cputestdata/ppc64-guest-compat-none.xml
new file mode 100644 (file)
index 0000000..fd50c03
--- /dev/null
@@ -0,0 +1 @@
+<cpu mode='host-model'/>
diff --git a/tests/cputestdata/ppc64-guest-compat-valid.xml b/tests/cputestdata/ppc64-guest-compat-valid.xml
new file mode 100644 (file)
index 0000000..bf01e54
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='host-model'>
+  <model>power6</model>
+</cpu>
diff --git a/tests/cputestdata/ppc64-guest-host-model.xml b/tests/cputestdata/ppc64-guest-host-model.xml
new file mode 100644 (file)
index 0000000..188ebeb
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='host-model'>
+  <model fallback='allow'/>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host+guest-compat-incompatible.xml b/tests/cputestdata/ppc64-host+guest-compat-incompatible.xml
new file mode 100644 (file)
index 0000000..1fab751
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='host-model' match='exact'>
+  <model fallback='allow'>power8</model>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host+guest-compat-invalid.xml b/tests/cputestdata/ppc64-host+guest-compat-invalid.xml
new file mode 100644 (file)
index 0000000..bc0d829
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='host-model' match='exact'>
+  <model fallback='allow'>power7+</model>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host+guest-compat-none.xml b/tests/cputestdata/ppc64-host+guest-compat-none.xml
new file mode 100644 (file)
index 0000000..188ebeb
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='host-model'>
+  <model fallback='allow'/>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host+guest-compat-valid.xml b/tests/cputestdata/ppc64-host+guest-compat-valid.xml
new file mode 100644 (file)
index 0000000..da9cc91
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='host-model' match='exact'>
+  <model fallback='allow'>power6</model>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host+guest-host-model.xml b/tests/cputestdata/ppc64-host+guest-host-model.xml
new file mode 100644 (file)
index 0000000..188ebeb
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='host-model'>
+  <model fallback='allow'/>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host+guest-legacy-incompatible.xml b/tests/cputestdata/ppc64-host+guest-legacy-incompatible.xml
new file mode 100644 (file)
index 0000000..f5b8384
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='custom' match='exact'>
+  <model fallback='allow'>POWER8_v1.0</model>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host+guest-legacy-invalid.xml b/tests/cputestdata/ppc64-host+guest-legacy-invalid.xml
new file mode 100644 (file)
index 0000000..be059c3
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='custom' match='exact'>
+  <model fallback='allow'>POWER8E_v1.0</model>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host+guest-legacy.xml b/tests/cputestdata/ppc64-host+guest-legacy.xml
new file mode 100644 (file)
index 0000000..36bae52
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='custom' match='exact'>
+  <model fallback='allow'>POWER7_v2.3</model>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host+guest-nofallback.xml b/tests/cputestdata/ppc64-host+guest-nofallback.xml
new file mode 100644 (file)
index 0000000..0223018
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='custom' match='exact'>
+  <model fallback='forbid'>POWER8</model>
+</cpu>
diff --git a/tests/cputestdata/ppc64-host+guest.xml b/tests/cputestdata/ppc64-host+guest.xml
new file mode 100644 (file)
index 0000000..7fac4b7
--- /dev/null
@@ -0,0 +1,3 @@
+<cpu mode='custom' match='exact'>
+  <model fallback='allow'>POWER7</model>
+</cpu>