Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
7f3165b7
T
tp-qemu
项目概览
openeuler
/
tp-qemu
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tp-qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7f3165b7
编写于
4月 15, 2020
作者:
Y
Yu Yihuang
提交者:
GitHub
4月 15, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2176 from PaulYuuu/cpu_hotplug_s390
Make cpu hotplug cases work on s390
上级
d1208a4d
1c944fb4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
44 addition
and
19 deletion
+44
-19
provider/cpu_utils.py
provider/cpu_utils.py
+2
-1
qemu/tests/cfg/cpu_device_hotplug_during_boot.cfg
qemu/tests/cfg/cpu_device_hotplug_during_boot.cfg
+2
-0
qemu/tests/cfg/cpu_device_hotpluggable.cfg
qemu/tests/cfg/cpu_device_hotpluggable.cfg
+11
-2
qemu/tests/cfg/invalid_cpu_device_hotplug.cfg
qemu/tests/cfg/invalid_cpu_device_hotplug.cfg
+10
-2
qemu/tests/cpu_device_hotpluggable.py
qemu/tests/cpu_device_hotpluggable.py
+7
-6
qemu/tests/cpu_device_hotpluggable_with_stress.py
qemu/tests/cpu_device_hotpluggable_with_stress.py
+12
-8
未找到文件。
provider/cpu_utils.py
浏览文件 @
7f3165b7
...
@@ -38,7 +38,8 @@ def get_guest_cpu_ids(session, os_type):
...
@@ -38,7 +38,8 @@ def get_guest_cpu_ids(session, os_type):
return
set
()
return
set
()
cmd
=
"grep processor /proc/cpuinfo"
cmd
=
"grep processor /proc/cpuinfo"
output
=
session
.
cmd_output
(
cmd
)
output
=
session
.
cmd_output
(
cmd
)
return
set
(
map
(
int
,
re
.
findall
(
r
"(\d+)$"
,
output
,
re
.
M
)))
return
set
(
map
(
int
,
re
.
findall
(
r
"processor\s+(?::\s)?(\d+)"
,
output
,
re
.
M
)))
def
check_guest_cpu_topology
(
session
,
os_type
,
cpuinfo
):
def
check_guest_cpu_topology
(
session
,
os_type
,
cpuinfo
):
...
...
qemu/tests/cfg/cpu_device_hotplug_during_boot.cfg
浏览文件 @
7f3165b7
...
@@ -5,9 +5,11 @@
...
@@ -5,9 +5,11 @@
qemu_sandbox = on
qemu_sandbox = on
vcpu_devices = vcpu1
vcpu_devices = vcpu1
only Linux
only Linux
no aarch64
no ovmf
no ovmf
no RHEL.6
no RHEL.6
variants:
variants:
- @only_plug:
- @only_plug:
- with_unplug:
- with_unplug:
no s390x
unplug_during_boot = yes
unplug_during_boot = yes
qemu/tests/cfg/cpu_device_hotpluggable.cfg
浏览文件 @
7f3165b7
# Notes:
# Notes:
# For ppc64/ppc64le, please manually specify cpu_model in your environment
# For ppc64/ppc64le, please manually specify cpu_model in your environment
- cpu_device_hotpluggable: install setup image_copy unattended_install.cdrom
- cpu_device_hotpluggable: install setup image_copy unattended_install.cdrom
only ppc64 ppc64le x86_
64
no aarch
64
Windows:
Windows:
no WinXP, WinVista, Win7, Win8, Win10, Win2000, Win2003
# TBD: Please update the list when new supported Win OS comes out
only Win2008, Win2012, Win2016, Win2019
Win2008, Win2012, s390x:
check_cpu_topology = no
# ovmf does not support hotpluggable vCPU yet, this line will be removed
# ovmf does not support hotpluggable vCPU yet, this line will be removed
# when it is fully supported.
# when it is fully supported.
no ovmf
no ovmf
...
@@ -35,6 +38,8 @@
...
@@ -35,6 +38,8 @@
hotplug:
hotplug:
Linux:
Linux:
sub_test_after_migrate = reboot hotunplug
sub_test_after_migrate = reboot hotunplug
s390x:
sub_test_after_migrate = reboot
Windows:
Windows:
sub_test_after_migrate = reboot
sub_test_after_migrate = reboot
hotunplug:
hotunplug:
...
@@ -44,6 +49,8 @@
...
@@ -44,6 +49,8 @@
pause_vm_before_hotplug = yes
pause_vm_before_hotplug = yes
Linux:
Linux:
sub_test_type = pause_resume
sub_test_type = pause_resume
s390x:
del sub_test_type
- with_online_offline:
- with_online_offline:
only hotplug
only hotplug
only Linux
only Linux
...
@@ -59,6 +66,7 @@
...
@@ -59,6 +66,7 @@
install_path = "C:\Program Files\JAM Software\HeavyLoad"
install_path = "C:\Program Files\JAM Software\HeavyLoad"
install_cmd = "start /wait %s:\HeavyLoadSetup.exe /verysilent"
install_cmd = "start /wait %s:\HeavyLoadSetup.exe /verysilent"
- with_numa:
- with_numa:
no s390x
only hotplug
only hotplug
only multi_vcpu
only multi_vcpu
type = cpu_device_hotpluggable_with_numa
type = cpu_device_hotpluggable_with_numa
...
@@ -77,5 +85,6 @@
...
@@ -77,5 +85,6 @@
vcpu_enable = no
vcpu_enable = no
- hotunplug:
- hotunplug:
only Linux
only Linux
no s390x
hotpluggable_test = hotunplug
hotpluggable_test = hotunplug
vcpu_enable = yes
vcpu_enable = yes
qemu/tests/cfg/invalid_cpu_device_hotplug.cfg
浏览文件 @
7f3165b7
- invalid_cpu_device_hotplug:
- invalid_cpu_device_hotplug:
only x86_64 ppc64 ppc64le
no aarch64
virt_test_type = qemu
virt_test_type = qemu
type = invalid_cpu_device_hotplug
type = invalid_cpu_device_hotplug
required_qemu = [2.6.0, )
required_qemu = [2.6.0, )
...
@@ -16,8 +16,11 @@
...
@@ -16,8 +16,11 @@
error_desc = "core {0} already populated"
error_desc = "core {0} already populated"
x86_64:
x86_64:
Windows:
Windows:
no WinXP, WinVista, Win7, Win8, Win10, Win2000, Win2003
# TBD: Please update the list when new supported Win OS comes out
only Win2008, Win2012, Win2016, Win2019
error_desc = "CPU\[{0}\] with APIC ID \d+ exists"
error_desc = "CPU\[{0}\] with APIC ID \d+ exists"
s390x:
error_desc = "Unable to add CPU with core-id: {0}, it already exists"
- invalid_id:
- invalid_id:
execute_test = invalid_vcpu
execute_test = invalid_vcpu
ppc64, ppc64le:
ppc64, ppc64le:
...
@@ -33,6 +36,9 @@
...
@@ -33,6 +36,9 @@
ppc64, ppc64le:
ppc64, ppc64le:
error_desc = "invalid core id {0}"
error_desc = "invalid core id {0}"
invalid_ids = 1 -1 -2
invalid_ids = 1 -1 -2
s390x:
error_desc = "Parameter 'core-id' expects uint32_t"
invalid_ids = -1
- nr_threads:
- nr_threads:
invalid_property = nr-threads
invalid_property = nr-threads
only ppc64 ppc64le
only ppc64 ppc64le
...
@@ -44,3 +50,5 @@
...
@@ -44,3 +50,5 @@
error_desc = "core id {0} out of range"
error_desc = "core id {0} out of range"
x86_64:
x86_64:
error_desc = "Invalid CPU {1}: {0} must be in range 0:{2}"
error_desc = "Invalid CPU {1}: {0} must be in range 0:{2}"
s390x:
error_desc = "Unable to add CPU with core-id: {0}, maximum core-id: {2}"
qemu/tests/cpu_device_hotpluggable.py
浏览文件 @
7f3165b7
...
@@ -113,6 +113,7 @@ def run(test, params, env):
...
@@ -113,6 +113,7 @@ def run(test, params, env):
hotpluggable_test
=
params
[
"hotpluggable_test"
]
hotpluggable_test
=
params
[
"hotpluggable_test"
]
verify_wait_timeout
=
params
.
get_numeric
(
"verify_wait_timeout"
,
60
)
verify_wait_timeout
=
params
.
get_numeric
(
"verify_wait_timeout"
,
60
)
sub_test_type
=
params
.
get
(
"sub_test_type"
)
sub_test_type
=
params
.
get
(
"sub_test_type"
)
check_cpu_topology
=
params
.
get_boolean
(
"check_cpu_topology"
,
True
)
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
.
verify_alive
()
vm
.
verify_alive
()
...
@@ -159,9 +160,9 @@ def run(test, params, env):
...
@@ -159,9 +160,9 @@ def run(test, params, env):
if
vm
.
is_alive
():
if
vm
.
is_alive
():
session
=
vm
.
wait_for_login
(
timeout
=
login_timeout
)
session
=
vm
.
wait_for_login
(
timeout
=
login_timeout
)
check_guest_cpu_count
(
expected_vcpus
)
check_guest_cpu_count
(
expected_vcpus
)
if
(
expected_vcpus
==
maxcpus
and
if
expected_vcpus
==
maxcpus
and
check_cpu_topology
:
not
cpu_utils
.
check_guest_cpu_topology
(
session
,
os_type
,
if
not
cpu_utils
.
check_guest_cpu_topology
(
session
,
os_type
,
vm
.
cpuinfo
)
):
vm
.
cpuinfo
):
session
.
close
()
session
.
close
()
test
.
fail
(
"CPU topology of guest is inconsistent with "
test
.
fail
(
"CPU topology of guest is inconsistent with "
"expectations."
)
"expectations."
)
qemu/tests/cpu_device_hotpluggable_with_stress.py
浏览文件 @
7f3165b7
...
@@ -5,6 +5,7 @@ import logging
...
@@ -5,6 +5,7 @@ import logging
from
provider
import
cpu_utils
from
provider
import
cpu_utils
from
virttest
import
arch
from
virttest
import
error_context
from
virttest
import
error_context
from
virttest
import
utils_misc
from
virttest
import
utils_misc
from
virttest
import
utils_package
from
virttest
import
utils_package
...
@@ -39,6 +40,7 @@ def run(test, params, env):
...
@@ -39,6 +40,7 @@ def run(test, params, env):
session
.
cmd
(
install_cmd
)
session
.
cmd
(
install_cmd
)
os_type
=
params
[
"os_type"
]
os_type
=
params
[
"os_type"
]
vm_arch_name
=
params
.
get
(
'vm_arch_name'
,
arch
.
ARCH
)
login_timeout
=
params
.
get_numeric
(
"login_timeout"
,
360
)
login_timeout
=
params
.
get_numeric
(
"login_timeout"
,
360
)
stress_duration
=
params
.
get_numeric
(
"stress_duration"
,
180
)
stress_duration
=
params
.
get_numeric
(
"stress_duration"
,
180
)
verify_wait_timeout
=
params
.
get_numeric
(
"verify_wait_timeout"
,
60
)
verify_wait_timeout
=
params
.
get_numeric
(
"verify_wait_timeout"
,
60
)
...
@@ -88,14 +90,16 @@ def run(test, params, env):
...
@@ -88,14 +90,16 @@ def run(test, params, env):
"%.2f%%"
%
(
cpu_id
,
cpu_usage_rate
))
"%.2f%%"
%
(
cpu_id
,
cpu_usage_rate
))
logging
.
info
(
"Usage rate of vCPU(%s) is: %.2f%%"
,
cpu_id
,
logging
.
info
(
"Usage rate of vCPU(%s) is: %.2f%%"
,
cpu_id
,
cpu_usage_rate
)
cpu_usage_rate
)
for
vcpu_dev
in
vcpu_devices
:
if
not
vm_arch_name
.
startswith
(
"s390"
):
error_context
.
context
(
"Hotunplug vcpu device: %s"
%
vcpu_dev
,
for
vcpu_dev
in
vcpu_devices
:
logging
.
info
)
error_context
.
context
(
"Hotunplug vcpu device: %s"
%
vcpu_dev
,
vm
.
hotunplug_vcpu_device
(
vcpu_dev
)
logging
.
info
)
# Drift the running stress task to other vCPUs
vm
.
hotunplug_vcpu_device
(
vcpu_dev
)
time
.
sleep
(
random
.
randint
(
5
,
10
))
# Drift the running stress task to other vCPUs
if
vm
.
get_cpu_count
()
!=
smp
:
time
.
sleep
(
random
.
randint
(
5
,
10
))
test
.
fail
(
"Actual number of guest CPUs is not equal to expected"
)
if
vm
.
get_cpu_count
()
!=
smp
:
test
.
fail
(
"Actual number of guest CPUs is not equal to "
"expected"
)
stress_tool
.
unload_stress
()
stress_tool
.
unload_stress
()
stress_tool
.
clean
()
stress_tool
.
clean
()
else
:
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录