mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-06 11:02:25 -10:00
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 <[email protected]> Reviewed-by: Cleber Rosa <[email protected]> Tested-by: Cleber Rosa <[email protected]> Message-Id: <[email protected]> Signed-off-by: Cleber Rosa <[email protected]>
20 lines
678 B
Python
20 lines
678 B
Python
# Check for crash when using empty -cpu option
|
|
#
|
|
# Copyright (c) 2019 Red Hat, Inc.
|
|
#
|
|
# Author:
|
|
# Eduardo Habkost <[email protected]>
|
|
#
|
|
# 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')
|