Skip to content

Commit

Permalink
feat : QE - Validation of operator installation in tenant operator na…
Browse files Browse the repository at this point in the history
…mespace (#1084)

* Add new QE test for tenant namespace operator installation validation check

* Fix linter issue
  • Loading branch information
bnshr authored Feb 19, 2025
1 parent 9b4a9ab commit 0219ce9
Show file tree
Hide file tree
Showing 4 changed files with 423 additions and 11 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ linters-settings:
line-length: 135
wsl:
strict-append: false
allow-assign-and-anything: true
gocognit:
min-complexity: 36
gofmt:
Expand Down
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
}
31 changes: 20 additions & 11 deletions tests/operator/parameters/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 0219ce9

Please sign in to comment.