All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] tests/acceptance: Use QEMUMachine on tests that expect failure
@ 2019-12-11 18:55 Wainer dos Santos Moschetta
  2019-12-11 18:55 ` [PATCH v2 1/2] python/qemu: Add set_qmp_monitor() to QEMUMachine Wainer dos Santos Moschetta
  2019-12-11 18:55 ` [PATCH v2 2/2] tests/acceptance: Makes linux_initrd and empty_cpu_model use QEMUMachine Wainer dos Santos Moschetta
  0 siblings, 2 replies; 7+ messages in thread
From: Wainer dos Santos Moschetta @ 2019-12-11 18:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: philmd, ehabkost, crosa

The linux_initrd and empty_cpu_model tests assert that QEMU exit
with failure on certain scenarios. Currently they are not able
to use QEMUMachine object due to the QMP monitor connection which
is tentatively established always. Instead they handle the QEMU binary
directy, but ideally they should use QEMUMachine in order to:
a) Take advantage of error handling and logging in QEMUMachine.
b) Follow the pattern in other acceptance tests.

Changes v2 -> v1:
- set_qmp_monitor() uses enabled=True instead of disabled=False
  (patch 01) [crosa]
- removed monitor_address parameter from set_qmp_monitor()
  (patch 01) [crosa]
- adjusted to use 'enabled' (patch 02) [crosa]

Changes v1 -> null:
- Patch 01 first appeared in [1]. Here I propose the same
implementation but the code was rebased.
- empty_cpu_model used to check both stdout and stderr of the process. The
QEMUMachine doesn't provide an interface to access the underneath
process object, instead the process' output is available through
get_log(). This method in turn returns the content of stdout (stderr is
redirected to stdout). Therefore, I adapted the assertion statement
to check the '-cpu option cannot be empty' message shows in the output.

Git:
- Tree: https://github.com/wainersm/qemu
- Branch: tests_without_qmp_v2

CI:
- Travis (PASS): https://travis-ci.org/wainersm/qemu/builds/623716505

References:
[1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg627498.html


Wainer dos Santos Moschetta (2):
  python/qemu: Add set_qmp_monitor() to QEMUMachine
  tests/acceptance: Makes linux_initrd and empty_cpu_model use
    QEMUMachine

 python/qemu/machine.py              | 66 +++++++++++++++++++----------
 tests/acceptance/empty_cpu_model.py | 12 +++---
 tests/acceptance/linux_initrd.py    | 13 +++---
 3 files changed, 56 insertions(+), 35 deletions(-)

-- 
2.21.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-12-15 19:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 18:55 [PATCH v2 0/2] tests/acceptance: Use QEMUMachine on tests that expect failure Wainer dos Santos Moschetta
2019-12-11 18:55 ` [PATCH v2 1/2] python/qemu: Add set_qmp_monitor() to QEMUMachine Wainer dos Santos Moschetta
2019-12-12 14:13   ` Cleber Rosa
2019-12-13 12:46     ` Wainer dos Santos Moschetta
2019-12-15 19:51       ` Cleber Rosa
2019-12-11 18:55 ` [PATCH v2 2/2] tests/acceptance: Makes linux_initrd and empty_cpu_model use QEMUMachine Wainer dos Santos Moschetta
2019-12-15 19:51   ` Cleber Rosa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.