Skip to content

Commit

Permalink
Add new QE test for tenant namespace operator installation validation…
Browse files Browse the repository at this point in the history
… check
  • Loading branch information
bnshr committed Feb 18, 2025
1 parent d151a38 commit 9952f06
Show file tree
Hide file tree
Showing 4 changed files with 404 additions and 12 deletions.
13 changes: 13 additions & 0 deletions tests/operator/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,16 @@ func updateCsv(namespace string, csv *v1alpha1.ClusterServiceVersion) error {

return nil
}

func DeployTestOperatorGroupWithTargetNamespace(operatorGroupName, namespace string, targetNamespaces []string) error {
if globalhelper.IsOperatorGroupInstalled(operatorGroupName,
namespace) != nil {
return globalhelper.DeployOperatorGroup(namespace,
utils.DefineOperatorGroup(operatorGroupName,
namespace,
targetNamespaces),
)
}

return nil
}
Binary file added tests/operator/operator.test
Binary file not shown.
33 changes: 21 additions & 12 deletions tests/operator/parameters/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (
"app": "test",
}
CertsuiteTargetOperatorLabels = fmt.Sprintf("%s: %s", "redhat-best-practices-for-k8s.com/operator", "target")
CertsuiteTargetCrdFilters = []string{"nginxingresses.charts.nginx.org"}
CertsuiteTargetCrdFilters = []string{"nginxingresses.charts.nginx.org"} // "anchoreengines.charts.anchore.io"
OperatorGroupName = "operator-test-operator-group"
OperatorLabel = map[string]string{"redhat-best-practices-for-k8s.com/operator": "target"}
CertifiedOperatorGroup = "certified-operators"
Expand All @@ -50,21 +50,30 @@ var (
SubscriptionNameOpenvino = "ovms-operator-subscription"
UncertifiedOperatorPrefixCockroach = "cockroachdb"
CertifiedOperatorPrefixCockroachCertified = "cockroach-operator"
SingleOrMultiNamespacedOperatorGroup = "single-or-multi-og"

TestDeploymentLabels = map[string]string{
testPodLabelPrefixName: testPodLabelValue,
"app": "test",
}

TestPodName = "operator-test-pod"
)

const (
OperatorNamespace = "operator-ns"

// Certsuite test case names.
CertsuiteOperatorInstallSource = "operator-install-source"
CertsuiteOperatorInstallStatusNoPrivileges = "operator-install-status-no-privileges"
CertsuiteOperatorInstallStatus = "operator-install-status-succeeded"
CertsuiteOperatorSemanticVersioning = "operator-semantic-versioning"
CertsuiteOperatorCrdVersioning = "operator-crd-versioning"
CertsuiteOperatorCrdOpenAPISchema = "operator-crd-openapi-schema"
CertsuiteOperatorNonRoot = "operator-run-as-non-root"
CertsuiteOperatorPodAutomountToken = "operator-automount-tokens"
CertsuiteOperatorPodRunAsUserID = "operator-run-as-user-id"
CertsuiteOperatorMultipleInstalled = "operator-multiple-same-operators"
CertsuiteOperatorBundleCount = "operator-catalogsource-bundle-count"
CertsuiteOperatorInstallSource = "operator-install-source"
CertsuiteOperatorInstallStatusNoPrivileges = "operator-install-status-no-privileges"
CertsuiteOperatorInstallStatus = "operator-install-status-succeeded"
CertsuiteOperatorSemanticVersioning = "operator-semantic-versioning"
CertsuiteOperatorCrdVersioning = "operator-crd-versioning"
CertsuiteOperatorCrdOpenAPISchema = "operator-crd-openapi-schema"
CertsuiteOperatorSingleOrMultiNamespacedAllowedInTenantNamespaces = "operator-single-or-multi-namespaced-allowed-in-tenant-namespaces"
CertsuiteOperatorNonRoot = "operator-run-as-non-root"
CertsuiteOperatorPodAutomountToken = "operator-automount-tokens"
CertsuiteOperatorPodRunAsUserID = "operator-run-as-user-id"
CertsuiteOperatorMultipleInstalled = "operator-multiple-same-operators"
CertsuiteOperatorBundleCount = "operator-catalogsource-bundle-count"
)
Loading

0 comments on commit 9952f06

Please sign in to comment.