diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-02-07 15:13:12 +0800 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-02-07 02:13:12 -0500 |
commit | 2d213b64d1c897d7a0fdbc93e5cab90f84d7334a (patch) | |
tree | ef39667503752419a8b76e591759493cd5e7dd5d /integrations | |
parent | 06a17395530bdda809060442b5bb230edfa216f3 (diff) | |
download | gitea-2d213b64d1c897d7a0fdbc93e5cab90f84d7334a.tar.gz gitea-2d213b64d1c897d7a0fdbc93e5cab90f84d7334a.zip |
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
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/git_helper_for_declarative_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
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 |