diff mbox series

[05/22] tests/acceptance/virtiofs_submounts.py: do not ask for ssh key password

Message ID 20210203172357.1422425-6-crosa@redhat.com
State New
Headers show
Series Acceptance Test: introduce base class for Linux based tests | expand

Commit Message

Cleber Rosa Feb. 3, 2021, 5:23 p.m. UTC
Tests are supposed to be non-interactive, and ssh-keygen is asking for
a password when creating a key.  Let's set an empty key, which prevents
ssh-keygen for asking for a password.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/acceptance/virtiofs_submounts.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Bennée Feb. 4, 2021, 10:49 a.m. UTC | #1
Cleber Rosa <crosa@redhat.com> writes:

> Tests are supposed to be non-interactive, and ssh-keygen is asking for
> a password when creating a key.  Let's set an empty key, which prevents
> ssh-keygen for asking for a password.

We are not generating an empty key, just one that isn't protected by a
passphrase. So:

  Tests are supposed to be non-interactive, and ssh-keygen is asking for
  a passphrase when creating a key.  Let's set an empty passphrase to
  avoid the prompt.

Otherwise:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Beraldo Leal Feb. 4, 2021, 11:05 a.m. UTC | #2
On Wed, Feb 03, 2021 at 12:23:40PM -0500, Cleber Rosa wrote:
> Tests are supposed to be non-interactive, and ssh-keygen is asking for
> a password when creating a key.  Let's set an empty key, which prevents
> ssh-keygen for asking for a password.
> 
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>  tests/acceptance/virtiofs_submounts.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virtiofs_submounts.py
> index 68d3cd6869..3b5a242385 100644
> --- a/tests/acceptance/virtiofs_submounts.py
> +++ b/tests/acceptance/virtiofs_submounts.py
> @@ -235,7 +235,7 @@ class VirtiofsSubmountsTest(BootLinux):
>  
>          self.ssh_key = os.path.join(self.workdir, 'id_ed25519')
>  
> -        self.run(('ssh-keygen', '-t', 'ed25519', '-f', self.ssh_key))
> +        self.run(('ssh-keygen', '-N', '', '-t', 'ed25519', '-f', self.ssh_key))
>  
>          pubkey = open(self.ssh_key + '.pub').read()
>  
> -- 
> 2.25.4
> 

Reviewed-by: Beraldo Leal <bleal@redhat.com>
diff mbox series

Patch

diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virtiofs_submounts.py
index 68d3cd6869..3b5a242385 100644
--- a/tests/acceptance/virtiofs_submounts.py
+++ b/tests/acceptance/virtiofs_submounts.py
@@ -235,7 +235,7 @@  class VirtiofsSubmountsTest(BootLinux):
 
         self.ssh_key = os.path.join(self.workdir, 'id_ed25519')
 
-        self.run(('ssh-keygen', '-t', 'ed25519', '-f', self.ssh_key))
+        self.run(('ssh-keygen', '-N', '', '-t', 'ed25519', '-f', self.ssh_key))
 
         pubkey = open(self.ssh_key + '.pub').read()