]> git.ipfire.org Git - thirdparty/qemu.git/commit
tests/acceptance: Automatic set -cpu to the test vm
authorWainer dos Santos Moschetta <wainersm@redhat.com>
Fri, 30 Apr 2021 13:34:08 +0000 (10:34 -0300)
committerCleber Rosa <crosa@redhat.com>
Tue, 13 Jul 2021 17:18:51 +0000 (13:18 -0400)
commit20bbf846b960477a71284bbf848437f2a6e7c804
treeb716ab1310c5c55dc60f3a4a5ed139870310431b
parent012293c1b1451edc28e9b3a6ea573d74c5ed373c
tests/acceptance: Automatic set -cpu to the test vm

This introduces a new feature to the functional tests: automatic setting of
the '-cpu VALUE' option to the created vm if the test is tagged with
'cpu:VALUE'. The 'cpu' property is made available to the test object as well.

For example, for a simple test as:

    def test(self):
        """
        :avocado: tags=cpu:host
        """
        self.assertEqual(self.cpu, "host")
        self.vm.launch()

The resulting QEMU evocation will be like:

    qemu-system-x86_64 -display none -vga none \
        -chardev socket,id=mon,path=/var/tmp/avo_qemu_sock_pdgzbgd_/qemu-1135557-monitor.sock \
        -mon chardev=mon,mode=control -cpu host

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Message-Id: <20210430133414.39905-2-wainersm@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
docs/devel/testing.rst
tests/acceptance/avocado_qemu/__init__.py