Skip to content

Commit

Permalink
Merge pull request #3369 from pmtk/olm/test-amq-broker
Browse files Browse the repository at this point in the history
USHIFT-3172: OLM Test: Deploy AMQ Broker from RH Operators
  • Loading branch information
openshift-merge-bot[bot] committed Jun 10, 2024
2 parents b2848d5 + 7970586 commit a0c0364
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions test/assets/olm/catalog-source.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: redhat-community-catalog
name: redhat-operators
namespace: openshift-marketplace
spec:
sourceType: grpc
image: registry.redhat.io/redhat/community-operator-index:v4.16
displayName: Red Hat Community Operators
image: registry.redhat.io/redhat/redhat-operator-index:v4.16
displayName: Red Hat Operators
publisher: Red Hat
grpcPodConfig:
securityContextConfig: restricted
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: my-cert-manager
name: amq-broker
namespace: openshift-operators
spec:
channel: stable
name: cert-manager
source: redhat-community-catalog
name: amq-broker-rhel8
source: redhat-operators
sourceNamespace: openshift-marketplace
31 changes: 16 additions & 15 deletions test/suites/optional/olm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,29 @@ Suite Teardown Teardown

*** Variables ***
${CATALOG_SOURCE} ./assets/olm/catalog-source.yaml
${SUB_CERT_MANAGER} ./assets/olm/subscription-cert-manager.yaml
${SUBSCRIPTION} ./assets/olm/subscription.yaml
${SUBSCRIPTION_NAME} amq-broker
${MARKETPLACE_NAMESPACE} openshift-marketplace
${OPERATORS_NAMESPACE} openshift-operators


*** Test Cases ***
Deploy CertManager From OperatorHubIO
[Documentation] Deploy CertManager from OperatorHub Catalog.
Deploy AmqBroker From Red Hat Operators catalog
[Documentation] Deploy AMQ Broker from Red Hat Operators catalog.
[Setup] Run Keywords
... OLM Should Be Ready
... Create CatalogSource
... Create CertManager Subscription
... Create Subscription

${csv}= Get CSV Name From Subscription ${OPERATORS_NAMESPACE} my-cert-manager
${csv}= Get CSV Name From Subscription ${OPERATORS_NAMESPACE} ${SUBSCRIPTION_NAME}
Wait For CSV ${OPERATORS_NAMESPACE} ${csv}
@{deployments}= Get Deployments From CSV ${OPERATORS_NAMESPACE} ${csv}
Wait For Deployments ${OPERATORS_NAMESPACE} @{deployments}

[Teardown] Run Keywords
... Delete CatalogSource
... AND
... Delete CertManager Subscription
... Delete Subscription
... AND
... Delete CSV ${OPERATORS_NAMESPACE} ${csv}
... AND
Expand Down Expand Up @@ -61,19 +62,19 @@ Create CatalogSource
[Documentation] Create CatalogSource resource with Red Hat Community Catalog Index.
Oc Create -f ${CATALOG_SOURCE}
Wait Until Keyword Succeeds 120s 5s
... CatalogSource Should Be Ready ${MARKETPLACE_NAMESPACE} redhat-community-catalog
... CatalogSource Should Be Ready ${MARKETPLACE_NAMESPACE} redhat-operators

CatalogSource Should Be Ready
[Documentation] Checks if CatalogSource is ready.
[Arguments] ${namespace} ${name}
${catalog}= Oc Get catalogsources ${namespace} ${name}
Should Be Equal As Strings READY ${catalog.status.connectionState.lastObservedState}

Create CertManager Subscription
[Documentation] Creates cert-manager subscription.
Oc Create -f ${SUB_CERT_MANAGER}
Create Subscription
[Documentation] Creates subscription.
Oc Create -f ${SUBSCRIPTION}
Wait Until Keyword Succeeds 120s 5s
... Subscription Should Be AtLatestKnown ${OPERATORS_NAMESPACE} my-cert-manager
... Subscription Should Be AtLatestKnown ${OPERATORS_NAMESPACE} ${SUBSCRIPTION_NAME}

Subscription Should Be AtLatestKnown
[Documentation] Checks if subscription has state "AtLeastKnown"
Expand All @@ -84,7 +85,7 @@ Subscription Should Be AtLatestKnown
Get CSV Name From Subscription
[Documentation] Obtains Subscription's CSV name.
[Arguments] ${namespace} ${name}
${sub}= Oc Get subscriptions.operators.coreos.com ${OPERATORS_NAMESPACE} my-cert-manager
${sub}= Oc Get subscriptions.operators.coreos.com ${OPERATORS_NAMESPACE} ${SUBSCRIPTION_NAME}
RETURN ${sub.status.currentCSV}

Wait For CSV
Expand Down Expand Up @@ -122,9 +123,9 @@ Delete CatalogSource
[Documentation] Delete CatalogSource.
Oc Delete -f ${CATALOG_SOURCE}

Delete CertManager Subscription
[Documentation] Delete CertManager Subscription.
Oc Delete -f ${SUB_CERT_MANAGER}
Delete Subscription
[Documentation] Delete Subscription.
Oc Delete -f ${SUBSCRIPTION}

Delete CSV
[Documentation] Delete CSV.
Expand Down

0 comments on commit a0c0364

Please sign in to comment.