]>
Commit | Line | Data |
---|---|---|
5b863f3e EH |
1 | # Check for crash when using empty -cpu option |
2 | # | |
3 | # Copyright (c) 2019 Red Hat, Inc. | |
4 | # | |
5 | # Author: | |
6 | # Eduardo Habkost <[email protected]> | |
7 | # | |
8 | # This work is licensed under the terms of the GNU GPL, version 2 or | |
9 | # later. See the COPYING file in the top-level directory. | |
10 | import subprocess | |
11 | from avocado_qemu import Test | |
12 | ||
13 | class EmptyCPUModel(Test): | |
14 | def test(self): | |
15 | cmd = [self.qemu_bin, '-S', '-display', 'none', '-machine', 'none', '-cpu', ''] | |
16 | r = subprocess.run(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE) | |
17 | self.assertEquals(r.returncode, 1, "QEMU exit code should be 1") | |
18 | self.assertEquals(r.stdout, b'', "QEMU stdout should be empty") | |
19 | self.assertNotEquals(r.stderr, b'', "QEMU stderr shouldn't be empty") |