Python: minor fixes
cover Python: minor fixes
GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-aqmp-fixes
CI: https://gitlab.com/jsnow/qemu/-/pipelines/449959282
Fix a bug in async QMP, and fix a minor test annoyance.
John Snow (2):
python/aqmp: Fix negotiation with pre-"oob" QEMU
python: use avocado's "new" runner
python/avocado.cfg | 2 +- python/qemu/aqmp/qmp_client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.31.1
PATCH 1/2 python/aqmp: Fix negotiation with pre-"oob" QEMU
QEMU versions prior to the "oob" capability *also* can't accept the "enable" keyword argument at all. Fix the handshake process with older QEMU versions.
--- python/qemu/aqmp/qmp_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
python/qemu/aqmp/qmp_client.py +2 -2
@@ -292,9 +292,9 @@ async def _negotiate(self) -> None: """ self.logger.debug("Negotiating capabilities ...") - arguments: Dict[str, List[str]] = {'enable': []} + arguments: Dict[str, List[str]] = {} if self._greeting and 'oob' in self._greeting.QMP.capabilities: - arguments['enable'].append('oob') + arguments.setdefault('enable', []).append('oob') msg = self.make_execute_msg('qmp_capabilities', arguments=arguments) # It's not safe to use execute() here, because the reader/writers
Signature · 1 line
2.31.1
PATCH 2/2 python: use avocado's "new" runner
In reply to John SnowThe old legacy runner no longer seems to work with output logging, so we can't see failure logs when a test case fails. The new runner doesn't (seem to) support Coverage.py yet, but seeing error output is a more important feature.
--- python/avocado.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
python/avocado.cfg +1 -1
@@ -1,5 +1,5 @@ [run] -test_runner = runner +test_runner = nrunner [simpletests] # Don't show stdout/stderr in the test *summary*
Signature · 1 line
2.31.1