tests/acceptance: linux-related tests fix
authorPavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>
Fri, 19 Feb 2021 11:04:22 +0000 (14:04 +0300)
committerCleber Rosa <crosa@redhat.com>
Wed, 17 Mar 2021 02:24:44 +0000 (22:24 -0400)
This patch allows cloudinit images download when ssh
key is not specified.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Message-Id: <161373266228.1608713.7614311331725780044.stgit@pasha-ThinkPad-X280>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
tests/acceptance/avocado_qemu/__init__.py

index ac8041821fa18b0fd1270dcfcf579440d9bd07d3..83b1741ec855c8bbcb6a8a40630c159e805ccd07 100644 (file)
@@ -317,8 +317,10 @@ 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()
+            pubkey_content = None
+            if ssh_pubkey:
+                with open(ssh_pubkey) as pubkey:
+                    pubkey_content = pubkey.read()
             cloudinit.iso(cloudinit_iso, self.name,
                           username='root',
                           password='password',