diff mbox series

[17/22] Acceptance Tests: fix population of public key in cloudinit image

Message ID 20210203172357.1422425-18-crosa@redhat.com (mailing list archive)
State New, archived
Headers show
Series Acceptance Test: introduce base class for Linux based tests | expand

Commit Message

Cleber Rosa Feb. 3, 2021, 5:23 p.m. UTC
Currently the path of the ssh public key is being set, but its
content is obviously what's needed.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Marc-André Lureau Feb. 11, 2021, 10:08 a.m. UTC | #1
On Wed, Feb 3, 2021 at 9:40 PM Cleber Rosa <crosa@redhat.com> wrote:
>
> Currently the path of the ssh public key is being set, but its
> content is obviously what's needed.
>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  tests/acceptance/avocado_qemu/__init__.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> index 472088ae7d..8156224625 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -337,13 +337,15 @@ class LinuxTest(Test, LinuxSSHMixIn):
>          try:
>              cloudinit_iso = os.path.join(self.workdir, 'cloudinit.iso')
>              self.phone_home_port = network.find_free_port()
> +            with open(ssh_pubkey) as pubkey:
> +                pubkey_content = pubkey.read()
>              cloudinit.iso(cloudinit_iso, self.name,
>                            username='root',
>                            password='password',
>                            # QEMU's hard coded usermode router address
>                            phone_home_host='10.0.2.2',
>                            phone_home_port=self.phone_home_port,
> -                          authorized_key=ssh_pubkey)
> +                          authorized_key=pubkey_content)
>          except Exception:
>              self.cancel('Failed to prepare the cloudinit image')
>          return cloudinit_iso
> --
> 2.25.4
>
>
Wainer dos Santos Moschetta Feb. 15, 2021, 2:48 p.m. UTC | #2
On 2/3/21 2:23 PM, Cleber Rosa wrote:
> Currently the path of the ssh public key is being set, but its
> content is obviously what's needed.
>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>   tests/acceptance/avocado_qemu/__init__.py | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)


Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>


>
> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> index 472088ae7d..8156224625 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -337,13 +337,15 @@ class LinuxTest(Test, LinuxSSHMixIn):
>           try:
>               cloudinit_iso = os.path.join(self.workdir, 'cloudinit.iso')
>               self.phone_home_port = network.find_free_port()
> +            with open(ssh_pubkey) as pubkey:
> +                pubkey_content = pubkey.read()
>               cloudinit.iso(cloudinit_iso, self.name,
>                             username='root',
>                             password='password',
>                             # QEMU's hard coded usermode router address
>                             phone_home_host='10.0.2.2',
>                             phone_home_port=self.phone_home_port,
> -                          authorized_key=ssh_pubkey)
> +                          authorized_key=pubkey_content)
>           except Exception:
>               self.cancel('Failed to prepare the cloudinit image')
>           return cloudinit_iso
Willian Rampazzo Feb. 15, 2021, 7:23 p.m. UTC | #3
On Wed, Feb 3, 2021 at 2:25 PM Cleber Rosa <crosa@redhat.com> wrote:
>
> Currently the path of the ssh public key is being set, but its
> content is obviously what's needed.
>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>  tests/acceptance/avocado_qemu/__init__.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>
diff mbox series

Patch

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index 472088ae7d..8156224625 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -337,13 +337,15 @@  class LinuxTest(Test, LinuxSSHMixIn):
         try:
             cloudinit_iso = os.path.join(self.workdir, 'cloudinit.iso')
             self.phone_home_port = network.find_free_port()
+            with open(ssh_pubkey) as pubkey:
+                pubkey_content = pubkey.read()
             cloudinit.iso(cloudinit_iso, self.name,
                           username='root',
                           password='password',
                           # QEMU's hard coded usermode router address
                           phone_home_host='10.0.2.2',
                           phone_home_port=self.phone_home_port,
-                          authorized_key=ssh_pubkey)
+                          authorized_key=pubkey_content)
         except Exception:
             self.cancel('Failed to prepare the cloudinit image')
         return cloudinit_iso