From 6dc650cd53b6f23989b2412ebceef698519db42a Mon Sep 17 00:00:00 2001 From: liuwei Date: Fri, 1 May 2020 15:03:13 +0800 Subject: [PATCH] prepare integration test --- test/integration-test.mk | 5 +++-- test/integration/integration_suite_test.go | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/test/integration-test.mk b/test/integration-test.mk index 2fa9eb589..7c1305122 100644 --- a/test/integration-test.mk +++ b/test/integration-test.mk @@ -6,14 +6,15 @@ K8S_VERSION ?=1.16.4 KB_TOOLS_ARCHIVE_NAME :=kubebuilder-tools-$(K8S_VERSION)-$(GOHOSTOS)-$(GOHOSTARCH).tar.gz KB_TOOLS_ARCHIVE_PATH := $(TEST_TMP)/$(KB_TOOLS_ARCHIVE_NAME) +# download the kubebuilder-tools to get kube-apiserver binaries from it ensure-kubebuilder-tools: ifeq "" "$(wildcard $(KUBEBUILDER_ASSETS))" - $(info Downloading kubebuilder-tools into '$(KUBEBUILDER_ASSETS)') + $(info Downloading kube-apiserver into '$(KUBEBUILDER_ASSETS)') mkdir -p '$(KUBEBUILDER_ASSETS)' curl -s -f -L https://storage.googleapis.com/kubebuilder-tools/$(KB_TOOLS_ARCHIVE_NAME) -o '$(KB_TOOLS_ARCHIVE_PATH)' tar -C '$(KUBEBUILDER_ASSETS)' --strip-components=2 -zvxf '$(KB_TOOLS_ARCHIVE_PATH)' else - $(info Using existing kubebuilder-tools from "$(KUBEBUILDER_ASSETS)") + $(info Using existing kube-apiserver from "$(KUBEBUILDER_ASSETS)") endif .PHONY: ensure-kubebuilder-tools diff --git a/test/integration/integration_suite_test.go b/test/integration/integration_suite_test.go index d81af59ab..f993e94d2 100644 --- a/test/integration/integration_suite_test.go +++ b/test/integration/integration_suite_test.go @@ -23,7 +23,11 @@ var k8sClient client.Client func TestIntegration(t *testing.T) { RegisterFailHandler(Fail) - // TODO add test cases + // TODO test cases + // - spoke registration agent creates CSR, hub authorizes, spoke agent creates hub kubeconfig and connects back to hub for successful join + // - spoke registration agent recovery from invalid bootstrap kubeconfig + // - spoke registration agent recovery from invalid hub kubeconfig + // - spoke registration rotate its certificate after its certificate is expired RunSpecsWithDefaultAndCustomReporters(t, "Integration Suite", []Reporter{printer.NewlineReporter{}}) } @@ -32,6 +36,7 @@ var _ = BeforeSuite(func(done Done) { By("bootstrapping test environment") + // install cluster CRD and start a local kube-apiserver testEnv = &envtest.Environment{ CRDDirectoryPaths: []string{ filepath.Join("..", "..", "vendor", "github.com", "open-cluster-management", "api", "cluster", "v1"),