[PATCH 0/2] tests/acceptance: Use QEMUMachine on tests that expect failure

Wainer dos Santos Moschetta posted 2 patches 4 years, 5 months ago
Test asan passed
Test checkpatch passed
Test FreeBSD passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20191112135801.854-1-wainersm@redhat.com
Maintainers: Eduardo Habkost <ehabkost@redhat.com>, Cleber Rosa <crosa@redhat.com>
There is a newer version of this series
python/qemu/machine.py              | 68 +++++++++++++++++++----------
tests/acceptance/empty_cpu_model.py | 13 +++---
tests/acceptance/linux_initrd.py    | 13 +++---
3 files changed, 59 insertions(+), 35 deletions(-)
[PATCH 0/2] tests/acceptance: Use QEMUMachine on tests that expect failure
Posted by Wainer dos Santos Moschetta 4 years, 5 months ago
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.

Notes worth it:
 - 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

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

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              | 68 +++++++++++++++++++----------
 tests/acceptance/empty_cpu_model.py | 13 +++---
 tests/acceptance/linux_initrd.py    | 13 +++---
 3 files changed, 59 insertions(+), 35 deletions(-)

-- 
2.18.1


Re: [PATCH 0/2] tests/acceptance: Use QEMUMachine on tests that expect failure
Posted by Wainer dos Santos Moschetta 4 years, 4 months ago
Ping.

Any brave soul to review it? :)

- Wainer


On 11/12/19 11:57 AM, Wainer dos Santos Moschetta wrote:
> 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.
>
> Notes worth it:
>   - 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
>
> CI:
>   - Travis (PASS): https://travis-ci.org/wainersm/qemu/builds/610499693
>
> 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              | 68 +++++++++++++++++++----------
>   tests/acceptance/empty_cpu_model.py | 13 +++---
>   tests/acceptance/linux_initrd.py    | 13 +++---
>   3 files changed, 59 insertions(+), 35 deletions(-)
>