Skip to content
Snippets Groups Projects
Commit e8197c6e authored by Cleber Rosa's avatar Cleber Rosa
Browse files

Acceptance Tests: fix population of public key in cloudinit image


Currently the path of the ssh public key is being set, but its
content is obviously what's needed.

Signed-off-by: default avatarCleber Rosa <crosa@redhat.com>
Message-Id: <20210203172357.1422425-18-crosa@redhat.com>
Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: default avatarWainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: default avatarWillian Rampazzo <willianr@redhat.com>
Signed-off-by: default avatarCleber Rosa <crosa@redhat.com>
parent efe30d50
No related branches found
No related tags found
No related merge requests found
......@@ -290,13 +290,15 @@ def prepare_cloudinit(self, ssh_pubkey=None):
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment