Преглед изворни кода

registry: un-skip some tests that don't require root

These tests seem to be running fine without being root, so let's not skip them.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn пре 1 година
родитељ
комит
b7d29c1e23
2 измењених фајлова са 0 додато и 7 уклоњено
  1. 0 3
      registry/registry_test.go
  2. 0 4
      registry/search_endpoint_v1_test.go

+ 0 - 3
registry/registry_test.go

@@ -1,14 +1,12 @@
 package registry // import "github.com/docker/docker/registry"
 package registry // import "github.com/docker/docker/registry"
 
 
 import (
 import (
-	"os"
 	"testing"
 	"testing"
 
 
 	"github.com/distribution/reference"
 	"github.com/distribution/reference"
 	"github.com/docker/docker/api/types/registry"
 	"github.com/docker/docker/api/types/registry"
 	"gotest.tools/v3/assert"
 	"gotest.tools/v3/assert"
 	is "gotest.tools/v3/assert/cmp"
 	is "gotest.tools/v3/assert/cmp"
-	"gotest.tools/v3/skip"
 )
 )
 
 
 func TestParseRepositoryInfo(t *testing.T) {
 func TestParseRepositoryInfo(t *testing.T) {
@@ -381,7 +379,6 @@ func TestNewIndexInfo(t *testing.T) {
 }
 }
 
 
 func TestMirrorEndpointLookup(t *testing.T) {
 func TestMirrorEndpointLookup(t *testing.T) {
-	skip.If(t, os.Getuid() != 0, "skipping test that requires root")
 	containsMirror := func(endpoints []APIEndpoint) bool {
 	containsMirror := func(endpoints []APIEndpoint) bool {
 		for _, pe := range endpoints {
 		for _, pe := range endpoints {
 			if pe.URL.Host == "my.mirror" {
 			if pe.URL.Host == "my.mirror" {

+ 0 - 4
registry/search_endpoint_v1_test.go

@@ -3,18 +3,15 @@ package registry // import "github.com/docker/docker/registry"
 import (
 import (
 	"net/http"
 	"net/http"
 	"net/http/httptest"
 	"net/http/httptest"
-	"os"
 	"strings"
 	"strings"
 	"testing"
 	"testing"
 
 
 	"github.com/docker/docker/api/types/registry"
 	"github.com/docker/docker/api/types/registry"
 	"gotest.tools/v3/assert"
 	"gotest.tools/v3/assert"
 	is "gotest.tools/v3/assert/cmp"
 	is "gotest.tools/v3/assert/cmp"
-	"gotest.tools/v3/skip"
 )
 )
 
 
 func TestV1EndpointPing(t *testing.T) {
 func TestV1EndpointPing(t *testing.T) {
-	skip.If(t, os.Getuid() != 0, "skipping test that requires root")
 	testPing := func(index *registry.IndexInfo, expectedStandalone bool, assertMessage string) {
 	testPing := func(index *registry.IndexInfo, expectedStandalone bool, assertMessage string) {
 		ep, err := newV1Endpoint(index, nil)
 		ep, err := newV1Endpoint(index, nil)
 		if err != nil {
 		if err != nil {
@@ -34,7 +31,6 @@ func TestV1EndpointPing(t *testing.T) {
 }
 }
 
 
 func TestV1Endpoint(t *testing.T) {
 func TestV1Endpoint(t *testing.T) {
-	skip.If(t, os.Getuid() != 0, "skipping test that requires root")
 	// Simple wrapper to fail test if err != nil
 	// Simple wrapper to fail test if err != nil
 	expandEndpoint := func(index *registry.IndexInfo) *v1Endpoint {
 	expandEndpoint := func(index *registry.IndexInfo) *v1Endpoint {
 		endpoint, err := newV1Endpoint(index, nil)
 		endpoint, err := newV1Endpoint(index, nil)