From fc444048432b160ac7eb21439eb6351d8a6c032e Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 5 Oct 2026 07:25:54 +0200 Subject: [PATCH] test: keep integration ssh independent of user ssh config (#39600) The SSH integration tests read the user's `~/.ssh/config`, so options like `ControlMaster` reused a connection authenticated with another test's key and the tests failed with "Cannot find key". Pass `-F none` so ssh reads no config files. --- tests/integration/git_helper_for_declarative_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/git_helper_for_declarative_test.go b/tests/integration/git_helper_for_declarative_test.go index ce536544478..9cefc50ead9 100644 --- a/tests/integration/git_helper_for_declarative_test.go +++ b/tests/integration/git_helper_for_declarative_test.go @@ -38,13 +38,13 @@ func withKeyFile(t *testing.T, keyname string, callback func(string)) { assert.NoError(t, err) err = os.WriteFile(filepath.Join(tmpDir, "ssh"), []byte("#!/bin/bash\n"+ - "ssh -o \"UserKnownHostsFile=/dev/null\" -o \"StrictHostKeyChecking=no\" -o \"IdentitiesOnly=yes\" -i \""+keyFile+"\" \"$@\""), 0o700) + "ssh -F none -o \"UserKnownHostsFile=/dev/null\" -o \"StrictHostKeyChecking=no\" -o \"IdentitiesOnly=yes\" -i \""+keyFile+"\" \"$@\""), 0o700) assert.NoError(t, err) // Setup ssh wrapper t.Setenv("GIT_SSH", filepath.Join(tmpDir, "ssh")) t.Setenv("GIT_SSH_COMMAND", - "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i \""+keyFile+"\"") + "ssh -F none -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i \""+keyFile+"\"") t.Setenv("GIT_SSH_VARIANT", "ssh") callback(keyFile)