Skip to content

Commit d800a4e

Browse files
committed
Fix integration-cli suite setup requirements
This PR moves the testRequires check from within setupRegistry and setupNotary to when the Suite itself starts up. This fixes a bug where testRequires() in setupRegistry() would succeed and start registry, but testRequires() in setupNotary() would fail. This immediately exits the goroutine with registry still running. Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
1 parent 35ef3ef commit d800a4e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

integration-cli/check_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type DockerRegistrySuite struct {
4848
}
4949

5050
func (s *DockerRegistrySuite) SetUpTest(c *check.C) {
51-
testRequires(c, DaemonIsLinux)
51+
testRequires(c, DaemonIsLinux, RegistryHosting)
5252
s.reg = setupRegistry(c, false, false)
5353
s.d = NewDaemon(c)
5454
}
@@ -76,7 +76,7 @@ type DockerSchema1RegistrySuite struct {
7676
}
7777

7878
func (s *DockerSchema1RegistrySuite) SetUpTest(c *check.C) {
79-
testRequires(c, DaemonIsLinux)
79+
testRequires(c, DaemonIsLinux, RegistryHosting)
8080
s.reg = setupRegistry(c, true, false)
8181
s.d = NewDaemon(c)
8282
}
@@ -104,7 +104,7 @@ type DockerRegistryAuthSuite struct {
104104
}
105105

106106
func (s *DockerRegistryAuthSuite) SetUpTest(c *check.C) {
107-
testRequires(c, DaemonIsLinux)
107+
testRequires(c, DaemonIsLinux, RegistryHosting)
108108
s.reg = setupRegistry(c, false, true)
109109
s.d = NewDaemon(c)
110110
}
@@ -158,6 +158,7 @@ type DockerTrustSuite struct {
158158
}
159159

160160
func (s *DockerTrustSuite) SetUpTest(c *check.C) {
161+
testRequires(c, RegistryHosting, NotaryHosting)
161162
s.reg = setupRegistry(c, false, false)
162163
s.not = setupNotary(c)
163164
}

integration-cli/docker_utils.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,6 @@ func daemonTime(c *check.C) time.Time {
15731573
}
15741574

15751575
func setupRegistry(c *check.C, schema1, auth bool) *testRegistryV2 {
1576-
testRequires(c, RegistryHosting)
15771576
reg, err := newTestRegistryV2(c, schema1, auth)
15781577
c.Assert(err, check.IsNil)
15791578

@@ -1590,7 +1589,6 @@ func setupRegistry(c *check.C, schema1, auth bool) *testRegistryV2 {
15901589
}
15911590

15921591
func setupNotary(c *check.C) *testNotary {
1593-
testRequires(c, NotaryHosting)
15941592
ts, err := newTestNotary(c)
15951593
c.Assert(err, check.IsNil)
15961594

0 commit comments

Comments
 (0)