rmmagent/agent/system/system_darwin_test.go
2022-06-28 14:52:31 -07:00

27 lines
436 B
Go

//go:build darwin
// +build darwin
package system_test
import (
"testing"
"github.com/amidaware/rmmagent/agent/system"
)
func TestRunScript(t *testing.T) {
stdout, stderr, exitcode, err := system.RunScript("#!/bin/sh\nuname -av", "/bin/bash", nil, 30)
if err != nil {
t.Fatal(err)
}
if stderr != "" {
t.Fatal(stderr)
}
if exitcode != 0 {
t.Fatalf("Error: Exit Code %d", exitcode)
}
t.Logf("Result: %s", stdout)
}