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 <cr...@redhat.com>
---
  tests/acceptance/avocado_qemu/__init__.py | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)


Reviewed-by: Wainer dos Santos Moschetta <waine...@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


Reply via email to