test: enforce tenv usage in tests

This commit is contained in:
TheFox0x7 2024-07-17 23:07:41 +02:00
parent 20f5f050f3
commit 3fca6c0bf5
No known key found for this signature in database
GPG key ID: 6CA33903484AF7C2
5 changed files with 8 additions and 11 deletions

View file

@ -40,10 +40,10 @@ func withKeyFile(t *testing.T, keyname string, callback func(string)) {
assert.NoError(t, err)
// Setup ssh wrapper
os.Setenv("GIT_SSH", path.Join(tmpDir, "ssh"))
os.Setenv("GIT_SSH_COMMAND",
t.Setenv("GIT_SSH", path.Join(tmpDir, "ssh"))
t.Setenv("GIT_SSH_COMMAND",
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i \""+keyFile+"\"")
os.Setenv("GIT_SSH_VARIANT", "ssh")
t.Setenv("GIT_SSH_VARIANT", "ssh")
callback(keyFile)
}