diff --git a/tests/e2e-openshift/monolithic-route/chainsaw-test.yaml b/tests/e2e-openshift/monolithic-route/chainsaw-test.yaml index 2dac7e15c..410f1d13e 100755 --- a/tests/e2e-openshift/monolithic-route/chainsaw-test.yaml +++ b/tests/e2e-openshift/monolithic-route/chainsaw-test.yaml @@ -10,4 +10,9 @@ spec: - apply: file: install-tempo.yaml - assert: - file: install-tempo-assert.yaml \ No newline at end of file + file: install-tempo-assert.yaml + - name: Run the must-gather and verify the contents + try: + - script: + timeout: 5m + content: ./check-must-gahter.sh diff --git a/tests/e2e-openshift/monolithic-route/check-must-gahter.sh b/tests/e2e-openshift/monolithic-route/check-must-gahter.sh new file mode 100755 index 000000000..1cba22ef1 --- /dev/null +++ b/tests/e2e-openshift/monolithic-route/check-must-gahter.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Check if must gather directory exists +MUST_GATHER_DIR=/tmp/monolithic-route +mkdir -p $MUST_GATHER_DIR + +# Run the must-gather script +oc adm must-gather --dest-dir=$MUST_GATHER_DIR --image=quay.io/rhn_support_ikanse/tempo-must-gather:latest -- /usr/bin/must-gather --operator-namespace tempo-operator + +# Define required files and directories +REQUIRED_ITEMS=( + "event-filter.html" + "timestamp" + "*sha*/deployment-tempo-operator-controller.yaml" + "*sha*/olm/operator-servicemeshoperator-openshift-operators.yaml" + "*sha*/olm/installplan-install-*.yaml" + "*sha*/olm/clusterserviceversion-tempo-operator-*.yaml" + "*sha*/olm/operator-opentelemetry-product-openshift-opentelemetry-operator.yaml" + "*sha*/olm/operator-tempo-operator-tempo-operator.yaml" + "*sha*/olm/operator-tempo-product-openshift-tempo-operator.yaml" + "*sha*/olm/subscription-tempo-operator-*-sub.yaml" + "*sha*/namespaces/chainsaw-mono-route/tempomonolithic/mono-route/tempomonolithic-mono-route.yaml" + "*sha*/namespaces/chainsaw-mono-route/tempomonolithic/mono-route/service-tempo-mono-route-jaegerui.yaml" + "*sha*/namespaces/chainsaw-mono-route/tempomonolithic/mono-route/configmap-tempo-mono-route-serving-cabundle.yaml" + "*sha*/namespaces/chainsaw-mono-route/tempomonolithic/mono-route/statefulset-tempo-mono-route.yaml" + "*sha*/namespaces/chainsaw-mono-route/tempomonolithic/mono-route/service-tempo-mono-route.yaml" + "*sha*/namespaces/chainsaw-mono-route/tempomonolithic/mono-route/route-tempo-mono-route-jaegerui.yaml" + "*sha*/namespaces/chainsaw-mono-route/tempomonolithic/mono-route/configmap-tempo-mono-route-config.yaml" + "*sha*/namespaces/chainsaw-mono-route/tempomonolithic/mono-route/serviceaccount-tempo-mono-route.yaml" + "*sha*/tempo-operator-controller-*" +) + +# Verify each required item +for item in "${REQUIRED_ITEMS[@]}"; do + if ! find "$MUST_GATHER_DIR" -path "$MUST_GATHER_DIR/$item" -print -quit | grep -q .; then + echo "Missing: $item" + exit 1 + else + echo "Found: $item" + fi +done + +# Cleanup the must-gather directory +rm -rf $MUST_GATHER_DIR \ No newline at end of file diff --git a/tests/e2e-openshift/route/chainsaw-test.yaml b/tests/e2e-openshift/route/chainsaw-test.yaml index a3ab3f7e7..c6e031a3f 100755 --- a/tests/e2e-openshift/route/chainsaw-test.yaml +++ b/tests/e2e-openshift/route/chainsaw-test.yaml @@ -23,3 +23,8 @@ spec: - script: timeout: 5m content: kubectl get --namespace $NAMESPACE tempo simplest -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' | grep True + - name: Run the must-gather and verify the contents + try: + - script: + timeout: 5m + content: ./check-must-gahter.sh diff --git a/tests/e2e-openshift/route/check-must-gahter.sh b/tests/e2e-openshift/route/check-must-gahter.sh new file mode 100755 index 000000000..736dff03f --- /dev/null +++ b/tests/e2e-openshift/route/check-must-gahter.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Check if must gather directory exists +MUST_GATHER_DIR=/tmp/route +mkdir -p $MUST_GATHER_DIR + +# Run the must-gather script +oc adm must-gather --dest-dir=$MUST_GATHER_DIR --image=quay.io/rhn_support_ikanse/tempo-must-gather:latest -- /usr/bin/must-gather --operator-namespace tempo-operator + +# Define required files and directories +REQUIRED_ITEMS=( + "event-filter.html" + "timestamp" + "*sha*/deployment-tempo-operator-controller.yaml" + "*sha*/olm/installplan-install-*" + "*sha*/olm/clusterserviceversion-tempo-operator-*.yaml" + "*sha*/olm/operator-opentelemetry-product-openshift-opentelemetry-operator.yaml" + "*sha*/olm/operator-tempo-operator-tempo-operator.yaml" + "*sha*/olm/operator-tempo-product-openshift-tempo-operator.yaml" + "*sha*/olm/subscription-tempo-operator-*-sub.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/service-tempo-simplest-distributor.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/service-tempo-simplest-ingester.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/deployment-tempo-simplest-distributor.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/service-tempo-simplest-querier.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/configmap-tempo-simplest.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/service-tempo-simplest-compactor.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/service-tempo-simplest-query-frontend.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/deployment-tempo-simplest-querier.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/tempostack-simplest.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/serviceaccount-tempo-simplest-query-frontend.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/statefulset-tempo-simplest-ingester.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/deployment-tempo-simplest-query-frontend.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/route-tempo-simplest-query-frontend.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/service-tempo-simplest-gossip-ring.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/configmap-tempo-simplest-ca-bundle.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/serviceaccount-tempo-simplest.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/deployment-tempo-simplest-compactor.yaml" + "*sha*/namespaces/chainsaw-route/tempostack/simplest/service-tempo-simplest-query-frontend-discovery.yaml" + "*sha*/tempo-operator-controller-*" +) + +# Verify each required item +for item in "${REQUIRED_ITEMS[@]}"; do + if ! find "$MUST_GATHER_DIR" -path "$MUST_GATHER_DIR/$item" -print -quit | grep -q .; then + echo "Missing: $item" + exit 1 + else + echo "Found: $item" + fi +done + +# Cleanup the must-gather directory +rm -rf $MUST_GATHER_DIR \ No newline at end of file