62 lines
1.4 KiB
Go
62 lines
1.4 KiB
Go
package executor
|
|
|
|
import (
|
|
"testing"
|
|
"wdd.io/agent-go/register"
|
|
)
|
|
|
|
var agentOP = &AgentOsOperator{
|
|
InstallCommandPrefix: []string{
|
|
"apt-get", "install", "-y",
|
|
},
|
|
RemoveCommandPrefix: []string{"apt", "remove", "-y"},
|
|
CanAccessInternet: true,
|
|
IsOsTypeUbuntu: true,
|
|
IsAgentInnerWall: true,
|
|
AgentArch: "amd64",
|
|
AgentOSReleaseCode: "focal",
|
|
AgentServerInfo: ®ister.AgentServerInfo{
|
|
ServerName: "",
|
|
ServerIPPbV4: "",
|
|
ServerIPInV4: "192.168.0.8",
|
|
ServerIPPbV6: "",
|
|
ServerIPInV6: "",
|
|
Location: "",
|
|
Provider: "",
|
|
ManagePort: "",
|
|
CPUCore: "",
|
|
CPUBrand: "",
|
|
OSInfo: "",
|
|
OSKernelInfo: "",
|
|
TCPControl: "",
|
|
Virtualization: "",
|
|
IoSpeed: "",
|
|
MemoryTotal: "",
|
|
DiskTotal: "",
|
|
DiskUsage: "",
|
|
Comment: "",
|
|
MachineID: "",
|
|
AgentVersion: "",
|
|
TopicName: "",
|
|
},
|
|
}
|
|
|
|
func TestBaseFunc(t *testing.T) {
|
|
|
|
//agentOP.Command("shutdownFirewall")
|
|
//agentOP.Command("modifyHostname")
|
|
//agentOP.Command("disableSwap")
|
|
//agentOP.Command("enableSwap")
|
|
//agentOP.Command("removeDocker")
|
|
//agentOP.Command("installDocker", "20")
|
|
//agentOP.Command("removeDockerCompose")
|
|
//agentOP.Command("installDockerCompose")
|
|
//agentOP.Command("installHelm")
|
|
//agentOP.Command("installHarbor")
|
|
//agentOP.Command("chronyToPublicNTP")
|
|
//agentOP.Command("chronyToMaster", "192.168.0.8")
|
|
//agentOP.Command("installZSH")
|
|
agentOP.Command("ok")
|
|
|
|
}
|