From bb38c9a7a6232bc5786bdab0385a7bdd09f66360 Mon Sep 17 00:00:00 2001 From: runkecheng <1131648942@qq.com> Date: Tue, 28 Dec 2021 18:45:05 +0800 Subject: [PATCH] e2e: Quick and simple test case. --- test/e2e/namespace/namespace.go | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test/e2e/namespace/namespace.go diff --git a/test/e2e/namespace/namespace.go b/test/e2e/namespace/namespace.go new file mode 100644 index 00000000..18a2275e --- /dev/null +++ b/test/e2e/namespace/namespace.go @@ -0,0 +1,45 @@ +/* +Copyright 2021 RadonDB. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package namespace + +import ( + "context" + "fmt" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/radondb/radondb-mysql-kubernetes/test/e2e/framework" +) + +var _ = Describe("Namespece test", func() { + f := framework.NewFramework("mc-1") + + BeforeEach(func() { + By("before each") + }) + + It("test list namespace", func() { + namespaces, err := f.ClientSet.CoreV1().Namespaces().List(context.TODO(), metav1.ListOptions{}) + Expect(err).Should(BeNil()) + Expect(len(namespaces.Items)).ShouldNot(BeZero()) + for _, ns := range namespaces.Items { + fmt.Fprintln(GinkgoWriter, ns.Name) + } + }) +})