diff --git a/internal/script/script.go b/internal/script/script.go index e19f9fe..4f970c1 100644 --- a/internal/script/script.go +++ b/internal/script/script.go @@ -21,19 +21,6 @@ import ( //go:embed resources var Resources embed.FS -type ScriptDefinition struct { - Name string // just a name - Script string // the bash script that will be run - Architectures []string // architectures, i.e., x86_64, arm64. If empty, it will run on all architectures. - Families []string // families, e.g., 6, 7. If empty, it will run on all families. - Models []string // models, e.g., 62, 63. If empty, it will run on all models. - Lkms []string // loadable kernel modules - Depends []string // binary dependencies that must be available for the script to run - Superuser bool // requires sudo or root - Sequential bool // run script sequentially (not at the same time as others) - Timeout int // seconds -} - type ScriptOutput struct { ScriptDefinition Stdout string @@ -254,7 +241,7 @@ func RunScriptAsync(myTarget target.Target, script ScriptDefinition, localTempDi }() } cmd := prepareCommand(script, myTarget.GetTempDirectory()) - err = myTarget.RunCommandAsync(cmd, stdoutChannel, stderrChannel, exitcodeChannel, script.Timeout, cmdChannel) + err = myTarget.RunCommandAsync(cmd, stdoutChannel, stderrChannel, exitcodeChannel, 0, cmdChannel) errorChannel <- err } diff --git a/internal/script/script_defs.go b/internal/script/script_defs.go index 65465a2..42bf16d 100644 --- a/internal/script/script_defs.go +++ b/internal/script/script_defs.go @@ -11,6 +11,18 @@ import ( "strings" ) +type ScriptDefinition struct { + Name string // just a name + Script string // the bash script that will be run + Architectures []string // architectures, i.e., x86_64, arm64. If empty, it will run on all architectures. + Families []string // families, e.g., 6, 7. If empty, it will run on all families. + Models []string // models, e.g., 62, 63. If empty, it will run on all models. + Lkms []string // loadable kernel modules + Depends []string // binary dependencies that must be available for the script to run + Superuser bool // requires sudo or root + Sequential bool // run script sequentially (not at the same time as others) +} + const ( HostnameScriptName = "hostname" DateScriptName = "date" diff --git a/internal/script/script_test.go b/internal/script/script_test.go index b3ea5c9..66ed591 100644 --- a/internal/script/script_test.go +++ b/internal/script/script_test.go @@ -38,7 +38,6 @@ func TestRunScript(t *testing.T) { Superuser: superuser, Lkms: []string{}, Depends: []string{}, - Timeout: 0, } tempDir, err := os.MkdirTemp(os.TempDir(), "test") if err != nil { @@ -73,7 +72,6 @@ echo "Core Count: $num_cores_per_socket"`, Superuser: superuser, Lkms: []string{}, Depends: []string{}, - Timeout: 0, } tempDir, err = os.MkdirTemp(os.TempDir(), "test") if err != nil { @@ -109,7 +107,6 @@ mpstat -u -T -I SCPU -P ALL 1 $count`, Superuser: superuser, Lkms: []string{}, Depends: []string{"mpstat"}, - Timeout: 0, } tempDir, err := os.MkdirTemp(os.TempDir(), "test") if err != nil {