mirror of
https://github.com/golang/sys.git
synced 2026-02-08 19:56:04 +03:00
add test for delayed start
This commit is contained in:
@@ -80,6 +80,9 @@ func testConfig(t *testing.T, s *mgr.Service, should mgr.Config) mgr.Config {
|
||||
if err != nil {
|
||||
t.Fatalf("Config failed: %s", err)
|
||||
}
|
||||
if should.DelayedAutoStart != is.DelayedAutoStart {
|
||||
t.Fatalf("config mismatch: DelayedAutoStart is %q, but should have %q", is.DelayedAutoStart, should.DelayedAutoStart)
|
||||
}
|
||||
if should.DisplayName != is.DisplayName {
|
||||
t.Fatalf("config mismatch: DisplayName is %q, but should have %q", is.DisplayName, should.DisplayName)
|
||||
}
|
||||
@@ -257,6 +260,15 @@ func TestMyService(t *testing.T) {
|
||||
|
||||
testConfig(t, s, c)
|
||||
|
||||
c.StartType = mgr.StartAutomatic
|
||||
c.DelayedAutoStart = mgr.ServiceDelayedAutoStartTrue
|
||||
err = s.UpdateConfig(c)
|
||||
if err != nil {
|
||||
t.Fatalf("UpdateConfig failed: %v", err)
|
||||
}
|
||||
|
||||
testConfig(t, s, c)
|
||||
|
||||
svcnames, err := m.ListServices()
|
||||
if err != nil {
|
||||
t.Fatalf("ListServices failed: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user