setup mac tests
This commit is contained in:
parent
f20f589fbf
commit
a22c10cd67
6 changed files with 62 additions and 32 deletions
27
agent/system/system_linux_test.go
Normal file
27
agent/system/system_linux_test.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package system_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/amidaware/rmmagent/agent/system"
|
||||
)
|
||||
|
||||
func TestRunScript(t *testing.T) {
|
||||
stdout, stderr, exitcode, err := system.RunScript("#!/bin/sh\ncat /etc/os-release", "/bin/sh", 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue