1 Star 0 Fork 71

Jiangjiacheng/src_libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
libvirt-tests-add-cpu-compare-test-cases-for-arm-CPU.patch 6.65 KB
一键复制 编辑 原始数据 按行查看 历史
From 8c57ff0e9b940eb1e29a4aa3e8a9d04b03424989 Mon Sep 17 00:00:00 2001
From: Xu Yandong <xuyandong2@huawei.com>
Date: Mon, 16 Oct 2017 17:55:48 +0800
Subject: tests: add cpu compare test cases for arm CPU
add cpu compare test cases for arm CPU
Signed-off-by: Xu Yandong <xuyandong2@huawei.com>
---
tests/cputest.c | 10 ++++++++++
.../aarch64-guest-compat-incompatible.xml | 4 ++++
tests/cputestdata/aarch64-guest-compat-none.xml | 1 +
tests/cputestdata/aarch64-guest-compat-valid.xml | 3 +++
tests/cputestdata/aarch64-guest-exact.xml | 4 ++++
tests/cputestdata/aarch64-guest-features-invalid.xml | 12 ++++++++++++
tests/cputestdata/aarch64-guest-features-valid.xml | 7 +++++++
.../aarch64-guest-legacy-incompatible.xml | 4 ++++
tests/cputestdata/aarch64-guest-legacy.xml | 4 ++++
tests/cputestdata/aarch64-guest-strict.xml | 4 ++++
tests/cputestdata/aarch64-host.xml | 12 ++++++++++++
11 files changed, 65 insertions(+)
create mode 100644 tests/cputestdata/aarch64-guest-compat-incompatible.xml
create mode 100644 tests/cputestdata/aarch64-guest-compat-none.xml
create mode 100644 tests/cputestdata/aarch64-guest-compat-valid.xml
create mode 100644 tests/cputestdata/aarch64-guest-exact.xml
create mode 100644 tests/cputestdata/aarch64-guest-features-invalid.xml
create mode 100644 tests/cputestdata/aarch64-guest-features-valid.xml
create mode 100644 tests/cputestdata/aarch64-guest-legacy-incompatible.xml
create mode 100644 tests/cputestdata/aarch64-guest-legacy.xml
create mode 100644 tests/cputestdata/aarch64-guest-strict.xml
create mode 100644 tests/cputestdata/aarch64-host.xml
diff --git a/tests/cputest.c b/tests/cputest.c
index 1f59f0d..e4b4531 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -1140,6 +1140,16 @@ mymain(void)
DO_TEST_COMPARE(VIR_ARCH_PPC64, "host", "guest-compat-invalid", VIR_CPU_COMPARE_ERROR);
DO_TEST_COMPARE(VIR_ARCH_PPC64, "host", "guest-compat-incompatible", VIR_CPU_COMPARE_INCOMPATIBLE);
+ DO_TEST_COMPARE(VIR_ARCH_AARCH64, "host", "guest-strict", VIR_CPU_COMPARE_IDENTICAL);
+ DO_TEST_COMPARE(VIR_ARCH_AARCH64, "host", "guest-exact", VIR_CPU_COMPARE_INCOMPATIBLE);
+ DO_TEST_COMPARE(VIR_ARCH_AARCH64, "host", "guest-legacy", VIR_CPU_COMPARE_IDENTICAL);
+ DO_TEST_COMPARE(VIR_ARCH_AARCH64, "host", "guest-legacy-incompatible", VIR_CPU_COMPARE_INCOMPATIBLE);
+ DO_TEST_COMPARE(VIR_ARCH_AARCH64, "host", "guest-compat-none", VIR_CPU_COMPARE_IDENTICAL);
+ DO_TEST_COMPARE(VIR_ARCH_AARCH64, "host", "guest-compat-valid", VIR_CPU_COMPARE_IDENTICAL);
+ DO_TEST_COMPARE(VIR_ARCH_AARCH64, "host", "guest-compat-incompatible", VIR_CPU_COMPARE_INCOMPATIBLE);
+ DO_TEST_COMPARE(VIR_ARCH_AARCH64, "host", "guest-features-valid", VIR_CPU_COMPARE_IDENTICAL);
+ DO_TEST_COMPARE(VIR_ARCH_AARCH64, "host", "guest-features-invalid", VIR_CPU_COMPARE_INCOMPATIBLE);
+
/* guest updates for migration
* automatically compares host CPU with the result */
DO_TEST_UPDATE(VIR_ARCH_X86_64, "host", "min", VIR_CPU_COMPARE_IDENTICAL);
diff --git a/tests/cputestdata/aarch64-guest-compat-incompatible.xml b/tests/cputestdata/aarch64-guest-compat-incompatible.xml
new file mode 100644
index 0000000..f68ead5
--- /dev/null
+++ b/tests/cputestdata/aarch64-guest-compat-incompatible.xml
@@ -0,0 +1,4 @@
+<cpu mode='custom'>
+ <model>cortex-a72</model>
+ <vendor>ARM</vendor>
+</cpu>
diff --git a/tests/cputestdata/aarch64-guest-compat-none.xml b/tests/cputestdata/aarch64-guest-compat-none.xml
new file mode 100644
index 0000000..fd50c03
--- /dev/null
+++ b/tests/cputestdata/aarch64-guest-compat-none.xml
@@ -0,0 +1 @@
+<cpu mode='host-model'/>
diff --git a/tests/cputestdata/aarch64-guest-compat-valid.xml b/tests/cputestdata/aarch64-guest-compat-valid.xml
new file mode 100644
index 0000000..0206d6e
--- /dev/null
+++ b/tests/cputestdata/aarch64-guest-compat-valid.xml
@@ -0,0 +1,3 @@
+<cpu mode='host-model'>
+ <model>cortex-a57</model>
+</cpu>
diff --git a/tests/cputestdata/aarch64-guest-exact.xml b/tests/cputestdata/aarch64-guest-exact.xml
new file mode 100644
index 0000000..bbbe65f
--- /dev/null
+++ b/tests/cputestdata/aarch64-guest-exact.xml
@@ -0,0 +1,4 @@
+<cpu match='exact'>
+ <model>cortex-a72</model>
+ <vendor>ARM</vendor>
+</cpu>
diff --git a/tests/cputestdata/aarch64-guest-features-invalid.xml b/tests/cputestdata/aarch64-guest-features-invalid.xml
new file mode 100644
index 0000000..afbb402
--- /dev/null
+++ b/tests/cputestdata/aarch64-guest-features-invalid.xml
@@ -0,0 +1,12 @@
+<cpu>
+ <model>cortex-a57</model>
+ <vendor>ARM</vendor>
+ <feature name='fp'/>
+ <feature name='asimd'/>
+ <feature name='aes'/>
+ <feature name='pmull'/>
+ <feature name='sha1'/>
+ <feature name='sha2'/>
+ <feature name='crc32'/>
+ <feature name='sha3'/>
+</cpu>
diff --git a/tests/cputestdata/aarch64-guest-features-valid.xml b/tests/cputestdata/aarch64-guest-features-valid.xml
new file mode 100644
index 0000000..0858f76
--- /dev/null
+++ b/tests/cputestdata/aarch64-guest-features-valid.xml
@@ -0,0 +1,7 @@
+<cpu>
+ <model>cortex-a57</model>
+ <vendor>ARM</vendor>
+ <feature name='asimd'/>
+ <feature name='aes'/>
+ <feature name='crc32'/>
+</cpu>
diff --git a/tests/cputestdata/aarch64-guest-legacy-incompatible.xml b/tests/cputestdata/aarch64-guest-legacy-incompatible.xml
new file mode 100644
index 0000000..2f1941d
--- /dev/null
+++ b/tests/cputestdata/aarch64-guest-legacy-incompatible.xml
@@ -0,0 +1,4 @@
+<cpu mode='custom' match='exact'>
+ <model fallback='allow'>cortex-a72</model>
+ <vendor>ARM</vendor>
+</cpu>
diff --git a/tests/cputestdata/aarch64-guest-legacy.xml b/tests/cputestdata/aarch64-guest-legacy.xml
new file mode 100644
index 0000000..64a05e4
--- /dev/null
+++ b/tests/cputestdata/aarch64-guest-legacy.xml
@@ -0,0 +1,4 @@
+<cpu mode='custom' match='exact'>
+ <model fallback='allow'>cortex-a57</model>
+ <vendor>ARM</vendor>
+</cpu>
diff --git a/tests/cputestdata/aarch64-guest-strict.xml b/tests/cputestdata/aarch64-guest-strict.xml
new file mode 100644
index 0000000..a057ebd
--- /dev/null
+++ b/tests/cputestdata/aarch64-guest-strict.xml
@@ -0,0 +1,4 @@
+<cpu match='strict'>
+ <model>cortex-a57</model>
+ <vendor>ARM</vendor>
+</cpu>
diff --git a/tests/cputestdata/aarch64-host.xml b/tests/cputestdata/aarch64-host.xml
new file mode 100644
index 0000000..60c20f2
--- /dev/null
+++ b/tests/cputestdata/aarch64-host.xml
@@ -0,0 +1,12 @@
+<cpu>
+ <arch>aarch64</arch>
+ <model>cortex-a57</model>
+ <vendor>ARM</vendor>
+ <feature name='fp'/>
+ <feature name='asimd'/>
+ <feature name='aes'/>
+ <feature name='pmull'/>
+ <feature name='sha1'/>
+ <feature name='sha2'/>
+ <feature name='crc32'/>
+</cpu>
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jjiacheng/src_libvirt.git
git@gitee.com:jjiacheng/src_libvirt.git
jjiacheng
src_libvirt
src_libvirt
master

搜索帮助