
assertRegexpMatches() has been removed in Python 3.12 and should be replaced by assertRegex(). See: https://docs.python.org/3.12/whatsnew/3.12.html#id3 Inspired-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20231114144832.71612-1-philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> (cherry picked from commit f0a663b4ced2bf315936c774c2b6ff398fce8905) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> (Mjt: adjust context for before v8.1.0-1582-g684750ab4f "python/qemu: rename command() to cmd()")
25 lines
630 B
Python
25 lines
630 B
Python
# 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 avocado_qemu import QemuSystemTest
|
|
|
|
|
|
class Version(QemuSystemTest):
|
|
"""
|
|
:avocado: tags=quick
|
|
"""
|
|
def test_qmp_human_info_version(self):
|
|
self.vm.add_args('-nodefaults')
|
|
self.vm.launch()
|
|
res = self.vm.command('human-monitor-command',
|
|
command_line='info version')
|
|
self.assertRegex(res, r'^(\d+\.\d+\.\d)')
|