aboutsummaryrefslogtreecommitdiff
path: root/tests/acceptance/empty_cpu_model.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/acceptance/empty_cpu_model.py')
-rw-r--r--tests/acceptance/empty_cpu_model.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/acceptance/empty_cpu_model.py b/tests/acceptance/empty_cpu_model.py
index 3f4f663582..a1e59e45e4 100644
--- a/tests/acceptance/empty_cpu_model.py
+++ b/tests/acceptance/empty_cpu_model.py
@@ -7,13 +7,13 @@
#
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
-import subprocess
from avocado_qemu import Test
class EmptyCPUModel(Test):
def test(self):
- cmd = [self.qemu_bin, '-S', '-display', 'none', '-machine', 'none', '-cpu', '']
- r = subprocess.run(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
- self.assertEquals(r.returncode, 1, "QEMU exit code should be 1")
- self.assertEquals(r.stdout, b'', "QEMU stdout should be empty")
- self.assertNotEquals(r.stderr, b'', "QEMU stderr shouldn't be empty")
+ 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')