mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-23 12:15:42 +00:00
Reconcile concurrent archive validation commits
This commit is contained in:
@@ -168,21 +168,6 @@ func TestRunDownloadedBinarySelfTestPropagatesFailureWithoutTokenArg(t *testing.
|
||||
}
|
||||
}
|
||||
|
||||
func TestRestartProcess(t *testing.T) {
|
||||
orig := execFn
|
||||
t.Cleanup(func() { execFn = orig })
|
||||
|
||||
execFn = func(string, []string, []string) error { return nil }
|
||||
if err := restartProcess("/bin/true"); err != nil {
|
||||
t.Fatalf("expected nil error, got %v", err)
|
||||
}
|
||||
|
||||
execFn = func(string, []string, []string) error { return errors.New("boom") }
|
||||
if err := restartProcess("/bin/false"); err == nil {
|
||||
t.Fatalf("expected error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDetermineArchOverrides(t *testing.T) {
|
||||
origOS, origArch, origUname := runtimeGOOS, runtimeGOARCH, unameCommand
|
||||
t.Cleanup(func() {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//go:build !windows
|
||||
|
||||
package agentupdate
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRestartProcess(t *testing.T) {
|
||||
orig := execFn
|
||||
t.Cleanup(func() { execFn = orig })
|
||||
|
||||
execFn = func(string, []string, []string) error { return nil }
|
||||
if err := restartProcess("/bin/true"); err != nil {
|
||||
t.Fatalf("expected nil error, got %v", err)
|
||||
}
|
||||
|
||||
execFn = func(string, []string, []string) error { return errors.New("boom") }
|
||||
if err := restartProcess("/bin/false"); err == nil {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user