From e8197c6e0c56aff83d96df221bb56a57d0bc0e96 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Wed, 3 Feb 2021 12:23:52 -0500 Subject: [PATCH] Acceptance Tests: fix population of public key in cloudinit image MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Currently the path of the ssh public key is being set, but its content is obviously what's needed. Signed-off-by: Cleber Rosa Message-Id: <20210203172357.1422425-18-crosa@redhat.com> Reviewed-by: Marc-André Lureau Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Willian Rampazzo Signed-off-by: Cleber Rosa --- 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 687c5dc0cf..51e9055c98 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -290,13 +290,15 @@ class LinuxTest(Test): 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.30.2