diff --git a/src/components/create-vm-dialog/createVmDialog.jsx b/src/components/create-vm-dialog/createVmDialog.jsx index 450b719b0..5daf26201 100644 --- a/src/components/create-vm-dialog/createVmDialog.jsx +++ b/src/components/create-vm-dialog/createVmDialog.jsx @@ -763,7 +763,7 @@ const parseKey = debounce(500, (key, setKeyObject, setKeyInvalid) => { .then(() => { setKeyInvalid(false); const parts = key.split(" "); - if (parts.length > 2) { + if (parts.length >= 2) { setKeyObject({ type: parts[0], data: parts[1], diff --git a/test/check-machines-create b/test/check-machines-create index 8d44b8560..b7f7c64ff 100755 --- a/test/check-machines-create +++ b/test/check-machines-create @@ -291,11 +291,11 @@ class TestMachinesCreate(VirtualMachinesCase): self.machine.execute("ssh-keygen -t rsa -N '' -f /tmp/rsakey") rsakey = self.machine.execute("cat /tmp/rsakey.pub").strip() self.addCleanup(self.machine.execute, "rm -f /tmp/rsakey*") - self.machine.execute("ssh-keygen -t dsa -N '' -C '' -f /tmp/dsakey") # public key with empty comment + self.machine.execute("ssh-keygen -t dsa -N '' -C '' -f /tmp/dsakey").strip() # public key with empty comment dsakey = self.machine.execute("cat /tmp/dsakey.pub") self.addCleanup(self.machine.execute, "rm -f /tmp/dsakey*") - # Try to create VM with one SSH key + # # Try to create VM with one SSH key runner.createCloudBaseImageTest(TestMachinesCreate.VmDialog(self, sourceType='cloud', storage_size=10, storage_size_unit='MiB', location=config.VALID_DISK_IMAGE_PATH, @@ -1153,8 +1153,6 @@ vnc_password= "{vnc_passwd}" ssh_keys = self.expected_ssh_keys or self.ssh_keys if ssh_keys is not None: - print("SSH KEYS", ssh_keys) - print(user_data) for key in ssh_keys: self.assertIn(key, user_data) @@ -1321,16 +1319,12 @@ vnc_password= "{vnc_passwd}" b.set_input_text("#create-vm-dialog-root-password-pw1", self.root_password) if self.ssh_keys is not None: for idx, key in enumerate(self.ssh_keys): - print(idx, key) b.click("button:contains(Add SSH keys)") b.set_input_text(f"#create-vm-dialog-ssh-key-{idx} textarea", key, value_check=False, blur=False) - import testlib - testlib.sit() # Check that ssh key was validated if self.ssh_key_invalid: self.browser.wait_attr(f"#create-vm-dialog-ssh-key-{idx} .pf-v5-c-form__group", "testdata", "key-invalid") else: - testlib.sit() b.wait_visible(f"#create-vm-dialog-ssh-key-{idx} #validated") if self.is_unattended: