|
1 | 1 | package cvo |
2 | 2 |
|
3 | 3 | import ( |
4 | | - . "github.com/onsi/ginkgo/v2" |
5 | | - . "github.com/onsi/gomega" |
| 4 | + "context" |
| 5 | + |
| 6 | + g "github.com/onsi/ginkgo/v2" |
| 7 | + o "github.com/onsi/gomega" |
| 8 | + kerrors "k8s.io/apimachinery/pkg/api/errors" |
| 9 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 10 | + "k8s.io/client-go/kubernetes" |
| 11 | + |
| 12 | + "github.com/openshift/cluster-version-operator/test/utilities" |
6 | 13 | ) |
7 | 14 |
|
8 | | -var _ = Describe("[Jira:Cluster Version Operator] cluster-version-operator-tests", func() { |
9 | | - It("should support passing tests", func() { |
10 | | - Expect(true).To(BeTrue()) |
| 15 | +var _ = g.Describe("[Jira:Cluster Version Operator] The cluster version operator", g.Ordered, g.Label("cvo"), func() { |
| 16 | + defer g.GinkgoRecover() |
| 17 | + var client *kubernetes.Clientset |
| 18 | + |
| 19 | + g.BeforeAll(func() { |
| 20 | + client = utilities.MustGetKubeClient() |
| 21 | + }) |
| 22 | + |
| 23 | + |
| 24 | + g.It("the removed resources are not created in a fresh installed cluster", g.Label("High", "42543"), func() { |
| 25 | + g.By("Service controller-manager-service should not be installed") |
| 26 | + _, err := client.CoreV1().Services("openshift-cloud-credential-operator").Get(context.TODO(), "controller-manager-service", metav1.GetOptions{}) |
| 27 | + o.Expect(kerrors.IsNotFound(err)).To(o.BeTrue(), "Service controller-manager-service was accidentally installed") |
| 28 | + |
| 29 | + g.By("ClusterRoleBindings default-account-openshift-machine-config-operator should not be installed") |
| 30 | + _, err = client.RbacV1().ClusterRoleBindings().Get(context.TODO(), "default-account-openshift-machine-config-operator", metav1.GetOptions{}) |
| 31 | + o.Expect(kerrors.IsNotFound(err)).To(o.BeTrue(), "ClusterRoleBinding default-account-openshift-machine-config-operator was accidentally installed") |
| 32 | + |
| 33 | + g.By("CronJobs machine-config-nodes-crd-cleanup should not be installed") |
| 34 | + _, err = client.BatchV1().CronJobs("openshift-machine-config-operator").Get(context.TODO(), "machine-config-nodes-crd-cleanup", metav1.GetOptions{}) |
| 35 | + o.Expect(kerrors.IsNotFound(err)).To(o.BeTrue(), "CronJob machine-config-nodes-crd-cleanup was accidentally installed") |
11 | 36 | }) |
12 | 37 | }) |
0 commit comments