diff options
author | Cleber Rosa <crosa@redhat.com> | 2021-04-12 00:46:40 -0400 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2021-06-01 16:21:20 -0400 |
commit | c6620c443d076bc0c80357e41f8f8d7fcdade6df (patch) | |
tree | 93ecba52357f117c4389ba51f10c213bd775107e /tests/acceptance/avocado_qemu | |
parent | d8c6a89968906af24ab27acd936013d3f937fc16 (diff) |
Acceptance Tests: set up SSH connection by default after boot for LinuxTest
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>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20210412044644.55083-8-crosa@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'tests/acceptance/avocado_qemu')
-rw-r--r-- | tests/acceptance/avocado_qemu/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 25f871f5bc..1062a851b9 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -391,7 +391,7 @@ class LinuxTest(Test, LinuxSSHMixIn): 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(), @@ -399,3 +399,6 @@ class LinuxTest(Test, LinuxSSHMixIn): 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) |