[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v9 01/17] tests/avocado: Specify target VM argument to helper rou
From: |
Jagannathan Raman |
Subject: |
[PATCH v9 01/17] tests/avocado: Specify target VM argument to helper routines |
Date: |
Tue, 3 May 2022 10:16:42 -0400 |
Specify target VM for exec_command and
exec_command_and_wait_for_pattern routines
Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Signed-off-by: John G Johnson <john.g.johnson@oracle.com>
Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Beraldo Leal <bleal@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
tests/avocado/avocado_qemu/__init__.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/tests/avocado/avocado_qemu/__init__.py
b/tests/avocado/avocado_qemu/__init__.py
index 39f15c1d51..340a345799 100644
--- a/tests/avocado/avocado_qemu/__init__.py
+++ b/tests/avocado/avocado_qemu/__init__.py
@@ -198,7 +198,7 @@ def wait_for_console_pattern(test, success_message,
failure_message=None,
"""
_console_interaction(test, success_message, failure_message, None, vm=vm)
-def exec_command(test, command):
+def exec_command(test, command, vm=None):
"""
Send a command to a console (appending CRLF characters), while logging
the content.
@@ -207,11 +207,14 @@ def exec_command(test, command):
:type test: :class:`avocado_qemu.QemuSystemTest`
:param command: the command to send
:type command: str
+ :param vm: target vm
+ :type vm: :class:`qemu.machine.QEMUMachine`
"""
- _console_interaction(test, None, None, command + '\r')
+ _console_interaction(test, None, None, command + '\r', vm=vm)
def exec_command_and_wait_for_pattern(test, command,
- success_message, failure_message=None):
+ success_message, failure_message=None,
+ vm=None):
"""
Send a command to a console (appending CRLF characters), then wait
for success_message to appear on the console, while logging the.
@@ -223,8 +226,11 @@ def exec_command_and_wait_for_pattern(test, command,
:param command: the command to send
:param success_message: if this message appears, test succeeds
:param failure_message: if this message appears, test fails
+ :param vm: target vm
+ :type vm: :class:`qemu.machine.QEMUMachine`
"""
- _console_interaction(test, success_message, failure_message, command +
'\r')
+ _console_interaction(test, success_message, failure_message, command +
'\r',
+ vm=vm)
class QemuBaseTest(avocado.Test):
def _get_unique_tag_val(self, tag_name):
--
2.20.1
- [PATCH v9 00/17] vfio-user server in QEMU, Jagannathan Raman, 2022/05/03
- [PATCH v9 01/17] tests/avocado: Specify target VM argument to helper routines,
Jagannathan Raman <=
- [PATCH v9 02/17] qdev: unplug blocker for devices, Jagannathan Raman, 2022/05/03
- [PATCH v9 03/17] remote/machine: add HotplugHandler for remote machine, Jagannathan Raman, 2022/05/03
- [PATCH v9 04/17] remote/machine: add vfio-user property, Jagannathan Raman, 2022/05/03
- [PATCH v9 05/17] configure: require cmake 3.19 or newer, Jagannathan Raman, 2022/05/03
- [PATCH v9 07/17] vfio-user: define vfio-user-server object, Jagannathan Raman, 2022/05/03