|
| 1 | +/* |
| 2 | +Copyright 2019 The Kubernetes Authors. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package apimachinery |
| 18 | + |
| 19 | +import ( |
| 20 | + "k8s.io/apimachinery/pkg/version" |
| 21 | + "k8s.io/kubernetes/test/e2e/framework" |
| 22 | + |
| 23 | + "github.com/onsi/ginkgo" |
| 24 | +) |
| 25 | + |
| 26 | +var _ = SIGDescribe("get-code-version", func() { |
| 27 | + f := framework.NewDefaultFramework("get-code-version") |
| 28 | + ginkgo.It("should find the server version", func() { |
| 29 | + |
| 30 | + ginkgo.By("Request ServerVersion") |
| 31 | + |
| 32 | + var version *version.Info |
| 33 | + version, err := f.ClientSet.Discovery().ServerVersion() |
| 34 | + framework.ExpectNoError(err, "Fail to access ServerVersion") |
| 35 | + |
| 36 | + ginkgo.By("Confirm major version") |
| 37 | + framework.ExpectEqual(version.Major, "1", "unable to find major version") |
| 38 | + framework.Logf("Major version: %v", version.Major) |
| 39 | + |
| 40 | + ginkgo.By("Confirm minor version") |
| 41 | + framework.ExpectEqual(version.Minor, "19+", "unable to find minor version") |
| 42 | + framework.Logf("Minor version: %v", version.Minor) |
| 43 | + }) |
| 44 | +}) |
0 commit comments