k8s.io/kubernetes@v1.29.3/test/e2e/architecture/conformance.go (about) 1 /* 2 Copyright 2021 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 architecture 18 19 import ( 20 "context" 21 "time" 22 23 "github.com/onsi/ginkgo/v2" 24 25 "k8s.io/kubernetes/test/e2e/framework" 26 e2enode "k8s.io/kubernetes/test/e2e/framework/node" 27 admissionapi "k8s.io/pod-security-admission/api" 28 ) 29 30 var _ = SIGDescribe("Conformance Tests", func() { 31 f := framework.NewDefaultFramework("conformance-tests") 32 f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged 33 34 /* 35 Release: v1.23 36 Testname: Conformance tests minimum number of nodes. 37 Description: Conformance tests requires at least two untainted nodes where pods can be scheduled. 38 */ 39 framework.ConformanceIt("should have at least two untainted nodes", func(ctx context.Context) { 40 ginkgo.By("Getting node addresses") 41 framework.ExpectNoError(e2enode.WaitForAllNodesSchedulable(ctx, f.ClientSet, 10*time.Minute)) 42 nodeList, err := e2enode.GetReadySchedulableNodes(ctx, f.ClientSet) 43 framework.ExpectNoError(err) 44 if len(nodeList.Items) < 2 { 45 framework.Failf("Conformance requires at least two nodes") 46 } 47 }) 48 })