qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 07/10] Acceptance Tests: set up SSH connection by default


From: Wainer dos Santos Moschetta
Subject: Re: [PATCH v2 07/10] Acceptance Tests: set up SSH connection by default after boot for LinuxTest
Date: Thu, 25 Mar 2021 11:31:24 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

Hi,

On 3/23/21 7:15 PM, Cleber Rosa wrote:
The LinuxTest specifically targets users that need to interact with Linux
guests.  So, it makes sense to give a connection by default, and avoid
requiring it as boiler-plate code.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
  tests/acceptance/avocado_qemu/__init__.py | 5 ++++-
  tests/acceptance/virtiofs_submounts.py    | 1 -
  2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/acceptance/avocado_qemu/__init__.py 
b/tests/acceptance/avocado_qemu/__init__.py
index 535f63a48d..4960142bcc 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -390,7 +390,7 @@ def set_up_cloudinit(self, ssh_pubkey=None):
          cloudinit_iso = self.prepare_cloudinit(ssh_pubkey)
          self.vm.add_args('-drive', 'file=%s,format=raw' % cloudinit_iso)
- def launch_and_wait(self):
+    def launch_and_wait(self, set_up_ssh_connection=True):
          self.vm.set_console()
          self.vm.launch()
          console_drainer = 
datadrainer.LineLogger(self.vm.console_socket.fileno(),
@@ -398,3 +398,6 @@ def launch_and_wait(self):
          console_drainer.start()
          self.log.info('VM launched, waiting for boot confirmation from guest')
          cloudinit.wait_for_phone_home(('0.0.0.0', self.phone_home_port), 
self.name)
+        if set_up_ssh_connection:
+            self.log.info('Setting up the SSH connection')
+            self.ssh_connect(self.username, self.ssh_key)

Where is self.username set?

- Wainer

diff --git a/tests/acceptance/virtiofs_submounts.py 
b/tests/acceptance/virtiofs_submounts.py
index e10a935ac4..e019d3b896 100644
--- a/tests/acceptance/virtiofs_submounts.py
+++ b/tests/acceptance/virtiofs_submounts.py
@@ -136,7 +136,6 @@ def set_up_virtiofs(self):
def launch_vm(self):
          self.launch_and_wait()
-        self.ssh_connect('root', self.ssh_key)
def set_up_nested_mounts(self):
          scratch_dir = os.path.join(self.shared_dir, 'scratch')




reply via email to

[Prev in Thread] Current Thread [Next in Thread]