Files
ProjectOctopus/agent-go/executor/BaseFunction_test.go
2023-06-26 16:04:46 +08:00

61 lines
1.4 KiB
Go

package executor
import (
"agent-go/register"
"testing"
)
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: &register.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.Exec("shutdownFirewall")
//agentOP.Exec("modifyHostname")
//agentOP.Exec("disableSwap")
//agentOP.Exec("enableSwap")
//agentOP.Exec("removeDocker")
agentOP.Exec("installDocker", "20")
//agentOP.Exec("removeDockerCompose")
//agentOP.Exec("installDockerCompose")
//agentOP.Exec("installHelm")
//agentOP.Exec("installHarbor")
//agentOP.Exec("chronyToPublicNTP")
//agentOP.Exec("chronyToMaster", "192.168.0.8")
//agentOP.Exec("installZSH")
}