mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-06 00:57:18 -04:00
windows: add support for automatic delayed start in windows service
Change-Id: Iad33ea0f6627ac98c89dbaab0b41b3dd724c3163 GitHub-Last-Rev: 8764fdbd3200eb38d482cfffb5bd98f565f4395f GitHub-Pull-Request: golang/sys#36 Reviewed-on: https://go-review.googlesource.com/c/sys/+/187198 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
committed by
Alex Brainman
parent
cbf593c0f2
commit
51ab0e2dea
@@ -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 %v, but should have %v", 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 = true
|
||||
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