qemu-patch-raspberry4/tests/acceptance/empty_cpu_model.py
Wainer dos Santos Moschetta c80c6beb17 tests/acceptance: Makes linux_initrd and empty_cpu_model use QEMUMachine
On linux_initrd and empty_cpu_model tests the same effect of
calling QEMU through run() to inspect the terminated process is
achieved with a sequence of set_qmp_monitor() / launch() / wait()
commands on an QEMUMachine object. This patch changes those
tests to use QEMUMachine instead, so they follow the same pattern
to launch QEMU found on other acceptance tests.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20191211185536.16962-3-wainersm@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-12-16 10:59:50 -05:00

20 lines
678 B
Python

# Check for crash when using empty -cpu option
#
# Copyright (c) 2019 Red Hat, Inc.
#
# Author:
# Eduardo Habkost <ehabkost@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 Test
class EmptyCPUModel(Test):
def test(self):
self.vm.add_args('-S', '-display', 'none', '-machine', 'none', '-cpu', '')
self.vm.set_qmp_monitor(enabled=False)
self.vm.launch()
self.vm.wait()
self.assertEquals(self.vm.exitcode(), 1, "QEMU exit code should be 1")
self.assertRegex(self.vm.get_log(), r'-cpu option cannot be empty')