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>
This commit is contained in:
Sebastiaan van Stijn 2023-09-08 18:35:09 +02:00
parent de27973538
commit b7d29c1e23
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 0 additions and 7 deletions

View file

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

View file

@ -3,18 +3,15 @@ package registry // import "github.com/docker/docker/registry"
import (
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
"github.com/docker/docker/api/types/registry"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/skip"
)
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) {
ep, err := newV1Endpoint(index, nil)
if err != nil {
@ -34,7 +31,6 @@ func TestV1EndpointPing(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
expandEndpoint := func(index *registry.IndexInfo) *v1Endpoint {
endpoint, err := newV1Endpoint(index, nil)