1 Star 0 Fork 120

eulaceura/SPEC.qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tests-avocado-raspi2_initrd-Wait-for-guest-shutdown-.patch 2.18 KB
一键复制 编辑 原始数据 按行查看 历史
yezengruan 提交于 2022-12-06 12:44 . QEMU update to verison 6.2.0-60
From b30894533ec65a304c304016eaa461c23ca8d70c Mon Sep 17 00:00:00 2001
From: jianchunfu <jianchunfu_yewu@cmss.chinamobile.com>
Date: Wed, 30 Nov 2022 14:21:17 +0800
Subject: [PATCH 02/17] tests/avocado: raspi2_initrd: Wait for guest shutdown
message before stopping
The avocado test
tests/avocado/boot_linux_console.py:BootLinuxConsole.test_arm_raspi2_initrd
finishes wiith
exec_command(self, 'halt')
# Wait for VM to shut down gracefully
self.vm.wait()
In theory this should be fine. In practice it runs into two bugs:
* when the test calls self.vm.wait() Avocado closes the socket
connection to the guest serial console immediately, so the
avocado logs don't have the last part of the guest output:
https://gitlab.com/qemu-project/qemu/-/issues/1265
* when the socket is closed, a bug in the QEMU socket chardev
means that it loses any data that the guest UART has not
yet consumed. This means that the guest doesn't always read
the full 'halt' command string, so the test intermittently
fails with a timeout:
https://gitlab.com/qemu-project/qemu/-/issues/1264
Work around both of these by waiting for the guest to print the
string that means it has completed the shutdown process. This fixes
a very long standing intermittent failure in this test.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/636
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: jianchunfu <jianchunfu_yewu@cmss.chinamobile.com>
---
tests/avocado/boot_linux_console.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 9c618d4809..58864ec163 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -512,7 +512,7 @@ def test_arm_raspi2_initrd(self):
'BCM2835')
exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
'/soc/cprman@7e101000')
- exec_command(self, 'halt')
+ exec_command_and_wait_for_pattern(self, 'halt', 'reboot: System halted')
# Wait for VM to shut down gracefully
self.vm.wait()
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/eulaceura/SPEC.qemu.git
git@gitee.com:eulaceura/SPEC.qemu.git
eulaceura
SPEC.qemu
SPEC.qemu
master

搜索帮助