mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2026-02-23 21:45:36 +08:00
阶段性提交
This commit is contained in:
35
internal/installers/installer_node_test.go
Normal file
35
internal/installers/installer_node_test.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package installers
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNodeInstaller_Install(t *testing.T) {
|
||||
var installer InstallerInterface = &NodeInstaller{}
|
||||
err := installer.Login(&Credentials{
|
||||
Host: "192.168.2.30",
|
||||
Port: 22,
|
||||
Username: "root",
|
||||
Password: "123456",
|
||||
PrivateKey: "",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// 关闭连接
|
||||
defer func() {
|
||||
err := installer.Close()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}()
|
||||
|
||||
// 安装
|
||||
err = installer.Install("/opt/edge", &NodeParams{
|
||||
Endpoint: "192.168.2.40:8003",
|
||||
NodeId: "313fdb1b90d0a63c736f307b4d1ca358",
|
||||
Secret: "Pl3u5kYqBDZddp7raw6QfHiuGPRCWF54",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user