diff --git a/pkg/registry/client_http_test.go b/pkg/registry/client_http_test.go index fdb708fa3..a8d2c4758 100644 --- a/pkg/registry/client_http_test.go +++ b/pkg/registry/client_http_test.go @@ -57,21 +57,21 @@ func (suite *HTTPRegistryClientTestSuite) Test_0_Login() { } func (suite *HTTPRegistryClientTestSuite) Test_1_Push() { - if suite.protocol != "" { + if suite.protocol != "" || suite.Repo != "" { return } testPush(&suite.TestSuite) } func (suite *HTTPRegistryClientTestSuite) Test_2_Pull() { - if suite.protocol != "" { + if suite.protocol != "" || suite.Repo != "" { return } testPull(&suite.TestSuite) } func (suite *HTTPRegistryClientTestSuite) Test_3_Tags() { - if suite.protocol != "" { + if suite.protocol != "" || suite.Repo != "" { return } testTags(&suite.TestSuite) @@ -88,6 +88,9 @@ func (suite *HTTPRegistryClientTestSuite) Test_4_ManInTheMiddle() { func TestHTTPRegistryClientTestSuite(t *testing.T) { suite.Run(t, new(HTTPRegistryClientTestSuite)) + var suiteWithRepo = new(HTTPRegistryClientTestSuite) + suiteWithRepo.Repo = "/testrepo/" + suite.Run(t, suiteWithRepo) for _, protocol := range []string{"oci://", "http://", "https://"} { var protocolSpecificTestSuite = new(HTTPRegistryClientTestSuite) protocolSpecificTestSuite.protocol = protocol diff --git a/pkg/registry/utils_test.go b/pkg/registry/utils_test.go index 703eb127b..c47c8587d 100644 --- a/pkg/registry/utils_test.go +++ b/pkg/registry/utils_test.go @@ -65,6 +65,7 @@ type TestSuite struct { CompromisedRegistryHost string WorkspaceDir string RegistryClient *Client + Repo string // A mock DNS server needed for TLS connection testing. srv *mockdns.Server @@ -128,10 +129,10 @@ func setup(suite *TestSuite, tlsEnabled, insecure bool) *registry.Registry { // This is required because Docker enforces HTTP if the registry // host is localhost/127.0.0.1. if suite.DockerRegistryHost == "" { - suite.DockerRegistryHost = fmt.Sprintf("helm-test-registry:%d", port) + suite.DockerRegistryHost = fmt.Sprintf("helm-test-registry:%d%s", port, suite.Repo) } else { // may programmatically set this for custom protocol handling - suite.DockerRegistryHost = fmt.Sprintf("%s:%d", suite.DockerRegistryHost, port) + suite.DockerRegistryHost = fmt.Sprintf("%s:%d%s", suite.DockerRegistryHost, port, suite.Repo) } suite.srv, err = mockdns.NewServer(map[string]mockdns.Zone{ "helm-test-registry.": {