raven/base/docker/docker-20.10.17-Skip-kubeconfig-and-loadcontext-tests-that-require-root.patch
2024-02-21 17:40:51 +06:00

55 lines
1.9 KiB
Diff

From 4c4d58519541008ef8982e1fcffe76c60e1389f5 Mon Sep 17 00:00:00 2001
From: Sai Harsha <ssuryad@amazon.com>
Date: Tue, 14 Jun 2022 06:39:31 +0000
Subject: [PATCH 1/1] Skip TestSaveLoadContexts and TestExportKubeconfig
Skipping TestExportKubeconfig and TestSaveLoadContexts tests which require root access
---
cli/command/context/export-import_test.go | 2 ++
cli/context/kubernetes/endpoint_test.go | 2 ++
2 files changed, 4 insertions(+)
diff --git a/cli/command/context/export-import_test.go b/cli/command/context/export-import_test.go
index bf0cd88..6be9384 100644
--- a/cli/command/context/export-import_test.go
+++ b/cli/command/context/export-import_test.go
@@ -8,6 +8,7 @@ import (
"path/filepath"
"testing"
+ "github.com/docker/docker/testutil"
"github.com/docker/cli/cli/streams"
"gotest.tools/v3/assert"
)
@@ -71,6 +72,7 @@ func TestExportImportPipe(t *testing.T) {
}
func TestExportKubeconfig(t *testing.T) {
+ testutil.RequiresRoot(t)
contextFile := filepath.Join(t.TempDir(), "exported")
cli := makeFakeCli(t)
createTestContextWithKube(t, cli)
diff --git a/cli/context/kubernetes/endpoint_test.go b/cli/context/kubernetes/endpoint_test.go
index 89eeb9d..700e21e 100644
--- a/cli/context/kubernetes/endpoint_test.go
+++ b/cli/context/kubernetes/endpoint_test.go
@@ -5,6 +5,7 @@ import (
"os"
"testing"
+ "github.com/docker/docker/testutil"
"github.com/docker/cli/cli/context"
"github.com/docker/cli/cli/context/store"
"gotest.tools/v3/assert"
@@ -41,6 +42,7 @@ var testStoreCfg = store.NewConfig(
)
func TestSaveLoadContexts(t *testing.T) {
+ testutil.RequiresRoot(t)
store := store.New(t.TempDir(), testStoreCfg)
assert.NilError(t, save(store, testEndpoint("https://test", "test", nil, nil, nil, false), "raw-notls"))
assert.NilError(t, save(store, testEndpoint("https://test", "test", nil, nil, nil, true), "raw-notls-skip"))
--
2.32.0