Replace the human-monitor-command based version test with the native QMP query-version command, which returns structured version data. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260828-qemu-no-hmp-v5-9-9227de146347@redhat.com>
31 lines
762 B
Python
Executable File
31 lines
762 B
Python
Executable File
#!/usr/bin/env python3
|
|
#
|
|
# Version check example test
|
|
#
|
|
# Copyright (c) 2018 Red Hat, Inc.
|
|
#
|
|
# Author:
|
|
# Cleber Rosa <crosa@redhat.com>
|
|
#
|
|
# This work is licensed under the terms of the GNU GPL, version 2 or
|
|
# later. See the COPYING file in the top-level directory.
|
|
|
|
|
|
from qemu_test import QemuSystemTest
|
|
|
|
|
|
class Version(QemuSystemTest):
|
|
|
|
def test_qmp_query_version(self):
|
|
self.set_machine('none')
|
|
self.vm.add_args('-nodefaults')
|
|
self.vm.launch()
|
|
res = self.vm.cmd('query-version')
|
|
version = res['qemu']
|
|
self.assertIsInstance(version['major'], int)
|
|
self.assertIsInstance(version['minor'], int)
|
|
self.assertIsInstance(version['micro'], int)
|
|
|
|
if __name__ == '__main__':
|
|
QemuSystemTest.main()
|