[Agent] [Executor] 优化Functional Executor
This commit is contained in:
@@ -14,6 +14,11 @@ var callShellScript = []string{
|
||||
"/root/IdeaProjects/ProjectOctopus/agent-go/tmp/simple.sh",
|
||||
}
|
||||
|
||||
var shutdownFirewalld = []string{
|
||||
// wrong usage of &&
|
||||
"systemctl", "stop", "firewalld", "&&", "systemctl", "disable", "firewalld",
|
||||
}
|
||||
|
||||
var ifconfigCommand = []string{"ifconfig"}
|
||||
|
||||
func TestReadTimeOutput(t *testing.T) {
|
||||
@@ -23,7 +28,7 @@ func TestReadTimeOutput(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAllCommandExecutor(t *testing.T) {
|
||||
ok, result := AllCommandExecutor(ifconfigCommand)
|
||||
ok, result := AllCommandExecutor(shutdownFirewalld)
|
||||
|
||||
t.Logf("执行结果为 => %#v", ok)
|
||||
t.Logf("执行日志为 => %#v", result)
|
||||
|
||||
Reference in New Issue
Block a user