diff --git a/test/conformance/testdata/conformance.yaml b/test/conformance/testdata/conformance.yaml index 8c77c17b3c7..11e4e74191c 100755 --- a/test/conformance/testdata/conformance.yaml +++ b/test/conformance/testdata/conformance.yaml @@ -933,6 +933,13 @@ visible to subsequent reads. release: v1.22 file: test/e2e/apps/statefulset.go +- testname: Conformance tests minimum number of nodes. + codename: '[sig-architecture] Conformance Tests should have at least two untainted + nodes [Conformance]' + description: Conformance tests requires at least two untainted nodes where pods + can be scheduled. + release: v1.23 + file: test/e2e/architecture/conformance.go - testname: CertificateSigningRequest API codename: '[sig-auth] Certificates API [Privileged:ClusterAdmin] should support CSR API operations [Conformance]' diff --git a/test/e2e/architecture/OWNERS b/test/e2e/architecture/OWNERS new file mode 100644 index 00000000000..44aad16962a --- /dev/null +++ b/test/e2e/architecture/OWNERS @@ -0,0 +1,16 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +# This is the owner of the test code. The test data itself is owned by sig-architecture. +reviewers: + - aojea + - cheftako + - oomichi + - johnbelamaric +approvers: + - cheftako + - spiffxp + - johnbelamaric +emeritus_approvers: +labels: + - area/conformance + - sig/architecture diff --git a/test/e2e/architecture/conformance.go b/test/e2e/architecture/conformance.go new file mode 100644 index 00000000000..3b0c6a591de --- /dev/null +++ b/test/e2e/architecture/conformance.go @@ -0,0 +1,45 @@ +/* +Copyright 2021 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 architecture + +import ( + "time" + + "github.com/onsi/ginkgo" + + "k8s.io/kubernetes/test/e2e/framework" + e2enode "k8s.io/kubernetes/test/e2e/framework/node" +) + +var _ = SIGDescribe("Conformance Tests", func() { + f := framework.NewDefaultFramework("conformance-tests") + + /* + Release: v1.23 + Testname: Conformance tests minimum number of nodes. + Description: Conformance tests requires at least two untainted nodes where pods can be scheduled. + */ + framework.ConformanceIt("should have at least two untainted nodes", func() { + ginkgo.By("Getting node addresses") + framework.ExpectNoError(framework.WaitForAllNodesSchedulable(f.ClientSet, 10*time.Minute)) + nodeList, err := e2enode.GetReadySchedulableNodes(f.ClientSet) + framework.ExpectNoError(err) + if len(nodeList.Items) < 2 { + framework.Failf("Conformance requires at least two nodes") + } + }) +}) diff --git a/test/e2e/architecture/framework.go b/test/e2e/architecture/framework.go new file mode 100644 index 00000000000..94c34d187c0 --- /dev/null +++ b/test/e2e/architecture/framework.go @@ -0,0 +1,24 @@ +/* +Copyright 2021 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 architecture + +import "github.com/onsi/ginkgo" + +// SIGDescribe annotates the test with the SIG label. +func SIGDescribe(text string, body func()) bool { + return ginkgo.Describe("[sig-architecture] "+text, body) +} diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 3d6bb5ceceb..1c2227881ef 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -44,6 +44,7 @@ import ( // test sources _ "k8s.io/kubernetes/test/e2e/apimachinery" _ "k8s.io/kubernetes/test/e2e/apps" + _ "k8s.io/kubernetes/test/e2e/architecture" _ "k8s.io/kubernetes/test/e2e/auth" _ "k8s.io/kubernetes/test/e2e/autoscaling" _ "k8s.io/kubernetes/test/e2e/cloud"