Skip to content

Commit

Permalink
ci/cli: fix ssh client config
Browse files Browse the repository at this point in the history
Don't use known_hosts file, could lead to sporadic issues when the ssh
keys are changed.

Signed-off-by: Loic Devulder <ldevulder@suse.com>
  • Loading branch information
ldevulder committed Dec 4, 2024
1 parent 71a31d1 commit 9e16669
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/assets/ssh_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
RequestTTY auto
BatchMode no
HostbasedAuthentication no
CheckHostIP no
StrictHostKeyChecking no
TCPKeepAlive yes
LogLevel QUIET
16 changes: 16 additions & 0 deletions tests/e2e/configure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@ var _ = Describe("E2E - Configure test", Label("configure"), func() {
},
}

By("Configuring SSH client", func() {
home := os.Getenv("HOME")

err := exec.Command("mkdir", "-p", home+"/.ssh").Run()
Expect(err).To(Not(HaveOccurred()))

err = exec.Command("chmod", "700", home+"/.ssh").Run()
Expect(err).To(Not(HaveOccurred()))

err = exec.Command("cp", sshConfigFile, home+"/.ssh/config").Run()
Expect(err).To(Not(HaveOccurred()))

err = exec.Command("chmod", "600", home+"/.ssh/config").Run()
Expect(err).To(Not(HaveOccurred()))
})

By("Creating a cluster", func() {
// Create Yaml file
for _, p := range basePatterns {
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const (
numberOfNodesMax = 30
resetMachineInv = "../assets/reset_machine_inventory.yaml"
restoreYaml = "../assets/restore.yaml"
sshConfigFile = "../assets/ssh_config"
upgradeSkelYaml = "../assets/upgrade_skel.yaml"
userName = "root"
userPassword = "r0s@pwd1"
Expand Down

0 comments on commit 9e16669

Please sign in to comment.