diff --git a/test/e2e/apimachinery/BUILD b/test/e2e/apimachinery/BUILD index 08bdaeaf01c..604aabc9d08 100644 --- a/test/e2e/apimachinery/BUILD +++ b/test/e2e/apimachinery/BUILD @@ -21,6 +21,7 @@ go_library( "framework.go", "garbage_collector.go", "generated_clientset.go", + "get_code_version.go", "namespace.go", "protocol.go", "resource_quota.go", diff --git a/test/e2e/apimachinery/get_code_version.go b/test/e2e/apimachinery/get_code_version.go new file mode 100644 index 00000000000..286395ef3a6 --- /dev/null +++ b/test/e2e/apimachinery/get_code_version.go @@ -0,0 +1,44 @@ +/* +Copyright 2019 The Kubernetes Authors. + +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 apimachinery + +import ( + "k8s.io/apimachinery/pkg/version" + "k8s.io/kubernetes/test/e2e/framework" + + "github.com/onsi/ginkgo" +) + +var _ = SIGDescribe("get-code-version", func() { + f := framework.NewDefaultFramework("get-code-version") + ginkgo.It("should find the server version", func() { + + ginkgo.By("Request ServerVersion") + + var version *version.Info + version, err := f.ClientSet.Discovery().ServerVersion() + framework.ExpectNoError(err, "Fail to access ServerVersion") + + ginkgo.By("Confirm major version") + framework.ExpectEqual(version.Major, "1", "unable to find major version") + framework.Logf("Major version: %v", version.Major) + + ginkgo.By("Confirm minor version") + framework.ExpectEqual(version.Minor, "19+", "unable to find minor version") + framework.Logf("Minor version: %v", version.Minor) + }) +})