rmmagent/agent/system/system_linux_test.go
2022-06-28 15:27:11 -07:00

25 lines
406 B
Go

//go:build linux
// +build linux
package system_test
import (
"testing"
"github.com/amidaware/rmmagent/agent/system"
)
func TestRunScript(t *testing.T) {
_, 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)
}
}