From b1f1455f9d2abc1d7d3adf08d8e4f764308a5f90 Mon Sep 17 00:00:00 2001 From: Yevhen Vydolob Date: Tue, 19 Mar 2024 12:30:58 +0200 Subject: [PATCH] Add "IdentitiesOnly" SSH option to fix running tests when known_hosts has multiple records Signed-off-by: Yevhen Vydolob --- test/suite_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/suite_test.go b/test/suite_test.go index d4955472..67534dbb 100644 --- a/test/suite_test.go +++ b/test/suite_test.go @@ -206,6 +206,7 @@ func scp(src, dst string) error { sshCmd := exec.Command("scp", "-o", "UserKnownHostsFile=/dev/null", "-o", "StrictHostKeyChecking=no", + "-o", "IdentitiesOnly=yes", "-i", privateKeyFile, "-P", strconv.Itoa(sshPort), src, @@ -223,6 +224,7 @@ func sshCommand(cmd ...string) *exec.Cmd { sshCmd := exec.Command("ssh", "-o", "UserKnownHostsFile=/dev/null", "-o", "StrictHostKeyChecking=no", + "-o", "IdentitiesOnly=yes", "-i", privateKeyFile, "-p", strconv.Itoa(sshPort), fmt.Sprintf("%s@127.0.0.1", ignitionUser), "--", strings.Join(cmd, " ")) // #nosec G204