From 2d213b64d1c897d7a0fdbc93e5cab90f84d7334a Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 7 Feb 2019 15:13:12 +0800 Subject: use native golang SSH library but ssh-keygen when enable built-in SSH server to remove dependent on that command lines (#5976) * use native golang SSH library but ssh-keygen when enable built-in SSH server to remove dependent on that command lines * fix tests and add comment head --- integrations/git_helper_for_declarative_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'integrations') diff --git a/integrations/git_helper_for_declarative_test.go b/integrations/git_helper_for_declarative_test.go index 572abe95a2..60c7c29f68 100644 --- a/integrations/git_helper_for_declarative_test.go +++ b/integrations/git_helper_for_declarative_test.go @@ -12,20 +12,20 @@ import ( "net/http" "net/url" "os" - "os/exec" "path/filepath" "testing" "time" "code.gitea.io/git" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/modules/ssh" "github.com/Unknwon/com" "github.com/stretchr/testify/assert" ) func withKeyFile(t *testing.T, keyname string, callback func(string)) { keyFile := filepath.Join(setting.AppDataPath, keyname) - err := exec.Command("ssh-keygen", "-f", keyFile, "-t", "rsa", "-N", "").Run() + err := ssh.GenKeyPair(keyFile) assert.NoError(t, err) //Setup ssh wrapper -- cgit v1.2.3