Skip to content

Commit 9d362fb

Browse files
Merge pull request #1297 from neisw/revert-1279-rewrite-46922
Revert "OTA-1604: migrate ocp-46922 from otp to cvo repo"
2 parents 386018b + 278da7b commit 9d362fb

3 files changed

Lines changed: 0 additions & 120 deletions

File tree

.openshift-tests-extension/openshift_payload_cluster-version-operator.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,5 @@
1818
"source": "openshift:payload:cluster-version-operator",
1919
"lifecycle": "blocking",
2020
"environmentSelector": {}
21-
},
22-
{
23-
"name": "[Jira:\"Cluster Version Operator\"] cluster-version-operator should have correct runlevel and scc",
24-
"labels": {},
25-
"resources": {
26-
"isolation": {}
27-
},
28-
"source": "openshift:payload:cluster-version-operator",
29-
"lifecycle": "blocking",
30-
"environmentSelector": {}
3121
}
3222
]

test/cvo/cvo.go

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
package cvo
22

33
import (
4-
"context"
5-
6-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
7-
"k8s.io/client-go/kubernetes"
8-
"k8s.io/client-go/rest"
9-
104
. "github.com/onsi/ginkgo/v2"
115
. "github.com/onsi/gomega"
126

@@ -16,8 +10,6 @@ import (
1610

1711
var logger = GinkgoLogr.WithName("cluster-version-operator-tests")
1812

19-
const cvoNamespace = "openshift-cluster-version"
20-
2113
var _ = Describe(`[Jira:"Cluster Version Operator"] cluster-version-operator-tests`, func() {
2214
It("should support passing tests", func() {
2315
Expect(true).To(BeTrue())
@@ -33,49 +25,3 @@ var _ = Describe(`[Jira:"Cluster Version Operator"] cluster-version-operator-tes
3325
Expect(output).To(ContainSubstring("Client Version:"))
3426
})
3527
})
36-
37-
// CVO tests which need access the live cluster will be placed here
38-
var _ = Describe(`[Jira:"Cluster Version Operator"] cluster-version-operator`, func() {
39-
var (
40-
restCfg *rest.Config
41-
kubeClient kubernetes.Interface
42-
)
43-
44-
BeforeEach(func() {
45-
var err error
46-
// Respects KUBECONFIG env var
47-
restCfg, err = GetRestConfig()
48-
Expect(err).NotTo(HaveOccurred(), "Failed to load Kubernetes configuration. Please ensure KUBECONFIG environment variable is set.")
49-
50-
kubeClient, err = GetKubeClient(restCfg)
51-
Expect(err).NotTo(HaveOccurred(), "Failed to create Kubernetes client")
52-
})
53-
54-
// Migrated from case NonHyperShiftHOST-Author:jiajliu-Low-46922-check runlevel and scc in cvo ns
55-
// Refer to https://github.com/openshift/openshift-tests-private/blob/40374cf20946ff03c88712839a5626af2c88ab31/test/extended/ota/cvo/cvo.go#L1081
56-
It("should have correct runlevel and scc", func() {
57-
ctx := context.Background()
58-
err := SkipIfHypershift(ctx, restCfg)
59-
Expect(err).NotTo(HaveOccurred(), "Failed to determine if cluster is HyperShift")
60-
61-
By("Checking that the 'openshift.io/run-level' label exists on the namespace and has the empty value")
62-
ns, err := kubeClient.CoreV1().Namespaces().Get(ctx, cvoNamespace, metav1.GetOptions{})
63-
Expect(err).NotTo(HaveOccurred(), "Failed to get namespace %s", cvoNamespace)
64-
65-
runLevel, exists := ns.ObjectMeta.Labels["openshift.io/run-level"]
66-
Expect(exists).To(BeTrue(), "The 'openshift.io/run-level' label on namespace %s does not exist", cvoNamespace)
67-
Expect(runLevel).To(BeEmpty(), "Expected the 'openshift.io/run-level' label value on namespace %s has the empty value, but got %s", cvoNamespace, runLevel)
68-
69-
By("Checking that the annotation 'openshift.io/scc annotation' on the CVO pod has the value hostaccess")
70-
podList, err := kubeClient.CoreV1().Pods(cvoNamespace).List(ctx, metav1.ListOptions{
71-
LabelSelector: "k8s-app=cluster-version-operator",
72-
FieldSelector: "status.phase=Running",
73-
})
74-
Expect(err).NotTo(HaveOccurred(), "Failed to list running CVO pods")
75-
Expect(podList.Items).To(HaveLen(1), "Expected exactly one running CVO pod, but found: %d", len(podList.Items))
76-
77-
cvoPod := podList.Items[0]
78-
sccAnnotation := cvoPod.ObjectMeta.Annotations["openshift.io/scc"]
79-
Expect(sccAnnotation).To(Equal("hostaccess"), "Expected the annotation 'openshift.io/scc annotation' on pod %s to have the value 'hostaccess', but got %s", cvoPod.Name, sccAnnotation)
80-
})
81-
})

test/cvo/util.go

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)