diff --git a/tests/dast/rapid-lca/03-rapidast-job.yaml b/tests/dast/rapid-lca/03-rapidast-job.yaml index 51dec66..5204fa7 100644 --- a/tests/dast/rapid-lca/03-rapidast-job.yaml +++ b/tests/dast/rapid-lca/03-rapidast-job.yaml @@ -1,4 +1,3 @@ ---- apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -36,17 +35,15 @@ spec: - command: - sh - -c - - rapidast.py --log-level debug --config - /helm/config/rapidastconfig.yaml && find /opt/rapidast/results/lca - -name zap-report.json -exec cat {} \; + - rapidast.py --log-level debug --config /helm/config/rapidastconfig.yaml && find /opt/rapidast/results/ -name zap-report.json -exec cat {} \; image: quay.io/redhatproductsecurity/rapidast:latest imagePullPolicy: Always name: rapidast-chart resources: {} securityContext: privileged: true - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File volumeMounts: - mountPath: /helm/config name: config-volume @@ -62,5 +59,5 @@ spec: name: rapidast-configmap name: config-volume - name: results-volume - persistentVolumeClaim: null - claimName: rapidast-pvc + persistentVolumeClaim: + claimName: rapidast-pvc diff --git a/tests/dast/rapid-lca/04-assert.yaml b/tests/dast/rapid-lca/04-assert.yaml index 7fdd4a3..9c571cc 100644 --- a/tests/dast/rapid-lca/04-assert.yaml +++ b/tests/dast/rapid-lca/04-assert.yaml @@ -2,4 +2,4 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert timeout: 180 commands: - - script: ./tests/e2e-rh-sdl/rapidast-lca/results.sh + - script: ./tests/dast/rapidast-lca/results.sh diff --git a/tests/dast/rapid-lca/chainsaw-test.yaml b/tests/dast/rapid-lca/chainsaw-test.yaml index 8a53caa..2280e0c 100644 --- a/tests/dast/rapid-lca/chainsaw-test.yaml +++ b/tests/dast/rapid-lca/chainsaw-test.yaml @@ -5,38 +5,38 @@ metadata: name: rapidast-lca spec: steps: - - name: step-00 - try: + - name: step-00 + try: - apply: file: 00-create-project.yaml - assert: file: 00-assert.yaml - - name: step-01 - try: + - name: step-01 + try: - apply: file: 01-create-sa.yaml - assert: file: 01-assert.yaml - - name: step-02 - try: + - name: step-02 + try: - script: timeout: 30s content: ./create_rapidast_configmap.sh - assert: file: 02-assert.yaml - - name: step-03 - try: + - name: step-03 + try: - apply: file: 03-rapidast-job.yaml - assert: file: 03-assert.yaml - - name: step-04 - try: + - name: step-04 + try: - script: timeout: 6m content: ./results.sh - finally: - - command: + finally: + - command: timeout: 1m entrypoint: oc args: @@ -45,7 +45,7 @@ spec: - delete - pod - rapiterm-lca - - command: + - command: timeout: 1m entrypoint: oc args: diff --git a/tests/dast/rapid-lca/oobt_test_data/cr_example.yaml b/tests/dast/rapid-lca/oobt_test_data/cr_example.yaml deleted file mode 100644 index 85547d8..0000000 --- a/tests/dast/rapid-lca/oobt_test_data/cr_example.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: operator.openshift.io/v1 -kind: RunOnceDurationOverride -metadata: - name: cluster -spec: - runOnceDurationOverride: - spec: - activeDeadlineSeconds: 3600 diff --git a/tests/dast/rapid-lca/oobt_test_data/v5-none-oobt-template.yaml b/tests/dast/rapid-lca/oobt_test_data/v5-none-oobt-template.yaml deleted file mode 100644 index 5cee815..0000000 --- a/tests/dast/rapid-lca/oobt_test_data/v5-none-oobt-template.yaml +++ /dev/null @@ -1,12 +0,0 @@ -config: - configVersion: 5 - -# `application` contains data related to the application, not to the scans. -application: - shortName: "oobttest" - -scanners: - generic_trivy: - inline: > - "trivy k8s --kubeconfig=/home/rapidast/.kube/config -n openshift-operator-lifecycle-manager - pod --severity=HIGH,CRITICAL --scanners=misconfig --report all --format json" diff --git a/tests/dast/rapid-lca/test_oobt.py b/tests/dast/rapid-lca/test_oobt.py deleted file mode 100644 index e299ee6..0000000 --- a/tests/dast/rapid-lca/test_oobt.py +++ /dev/null @@ -1,29 +0,0 @@ -import os -import subprocess -import random - -import subprocess -import re - -RAPIDAST_IMAGE = "quay.io/redhatproductsecurity/rapidast:2.5.0" - -def test_oobt_basic(): - # 1. place kubeconfig in the TEST_DATA_DIR directory - - TEST_DATA_DIR = "oobt_test_data" - - port = random.randint(10000, 30000) - - # prep for testing - os.system(f"chmod 666 {TEST_DATA_DIR}/kubeconfig") - # Run the command and capture stdout - command = f"podman run -it --rm -v ./{TEST_DATA_DIR}/kubeconfig:/home/rapidast/.kube/config:Z -v ./results:/opt/rapidast/results:Z -v $PWD:/test:Z -p {port}:{port} {RAPIDAST_IMAGE} rapidast.py --config /test/rapidast_runtime_cfg.yaml" - - process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) - stdout, stderr = process.communicate() - -# print(stdout) - print("test completed. See the results directory") - -if __name__ == "__main__": - test_oobt_basic() diff --git a/tests/dast/rapid-nrop/03-rapidast-job.yaml b/tests/dast/rapid-nrop/03-rapidast-job.yaml index 7fd4332..851a445 100644 --- a/tests/dast/rapid-nrop/03-rapidast-job.yaml +++ b/tests/dast/rapid-nrop/03-rapidast-job.yaml @@ -36,9 +36,7 @@ spec: - command: - sh - -c - - rapidast.py --log-level debug --config - /helm/config/rapidastconfig.yaml && find /opt/rapidast/results/nrop - -name zap-report.json -exec cat {} \; + - rapidast.py --log-level debug --config /helm/config/rapidastconfig.yaml && find /opt/rapidast/results/nrop -name zap-report.json -exec cat {} \; image: quay.io/redhatproductsecurity/rapidast:latest imagePullPolicy: Always name: rapidast-chart @@ -63,4 +61,4 @@ spec: name: config-volume - name: results-volume persistentVolumeClaim: null - claimName: rapidast-pvc + claimName: rapidast-pvc diff --git a/tests/dast/rapid-nrop/04-assert.yaml b/tests/dast/rapid-nrop/04-assert.yaml index 79a27c5..c6c14a4 100644 --- a/tests/dast/rapid-nrop/04-assert.yaml +++ b/tests/dast/rapid-nrop/04-assert.yaml @@ -2,4 +2,4 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert timeout: 180 commands: - - script: ./tests/e2e-rh-sdl/rapidast-nrop/results.sh + - script: ./tests/dast/rapidast-nrop/results.sh diff --git a/tests/dast/rapid-nrop/chainsaw-test.yaml b/tests/dast/rapid-nrop/chainsaw-test.yaml index eda6774..e02d8b4 100644 --- a/tests/dast/rapid-nrop/chainsaw-test.yaml +++ b/tests/dast/rapid-nrop/chainsaw-test.yaml @@ -5,38 +5,38 @@ metadata: name: rapidast-nrop spec: steps: - - name: step-00 - try: + - name: step-00 + try: - apply: file: 00-create-project.yaml - assert: file: 00-assert.yaml - - name: step-01 - try: + - name: step-01 + try: - apply: file: 01-create-sa.yaml - assert: file: 01-assert.yaml - - name: step-02 - try: + - name: step-02 + try: - script: timeout: 30s content: ./create_rapidast_configmap.sh - assert: file: 02-assert.yaml - - name: step-03 - try: + - name: step-03 + try: - apply: file: 03-rapidast-job.yaml - assert: file: 03-assert.yaml - - name: step-04 - try: + - name: step-04 + try: - script: timeout: 6m content: ./results.sh - finally: - - command: + finally: + - command: timeout: 1m entrypoint: oc args: @@ -45,7 +45,7 @@ spec: - delete - pod - rapiterm-nrop - - command: + - command: timeout: 1m entrypoint: oc args: diff --git a/tests/dast/rapid-ptp/03-rapidast-job.yaml b/tests/dast/rapid-ptp/03-rapidast-job.yaml index 0f74bef..20e099e 100644 --- a/tests/dast/rapid-ptp/03-rapidast-job.yaml +++ b/tests/dast/rapid-ptp/03-rapidast-job.yaml @@ -36,9 +36,7 @@ spec: - command: - sh - -c - - rapidast.py --log-level debug --config - /helm/config/rapidastconfig.yaml && find /opt/rapidast/results/ptp - -name zap-report.json -exec cat {} \; + - rapidast.py --log-level debug --config /helm/config/rapidastconfig.yaml && find /opt/rapidast/results/ptp -name zap-report.json -exec cat {} \; image: quay.io/redhatproductsecurity/rapidast:latest imagePullPolicy: Always name: rapidast-chart @@ -63,4 +61,4 @@ spec: name: config-volume - name: results-volume persistentVolumeClaim: null - claimName: rapidast-pvc + claimName: rapidast-pvc diff --git a/tests/dast/rapid-ptp/04-assert.yaml b/tests/dast/rapid-ptp/04-assert.yaml index 51410cb..7d7531a 100644 --- a/tests/dast/rapid-ptp/04-assert.yaml +++ b/tests/dast/rapid-ptp/04-assert.yaml @@ -2,4 +2,4 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert timeout: 180 commands: - - script: ./tests/e2e-rh-sdl/rapidast-ptp/results.sh + - script: ./tests/dast/rapidast-ptp/results.sh diff --git a/tests/dast/rapid-ptp/chainsaw-test.yaml b/tests/dast/rapid-ptp/chainsaw-test.yaml index 83505f3..1dbc082 100644 --- a/tests/dast/rapid-ptp/chainsaw-test.yaml +++ b/tests/dast/rapid-ptp/chainsaw-test.yaml @@ -5,27 +5,27 @@ metadata: name: rapidast-ptp spec: steps: - - name: step-00 - try: + - name: step-00 + try: - apply: file: 00-create-project.yaml - assert: file: 00-assert.yaml - - name: step-01 - try: + - name: step-01 + try: - apply: file: 01-create-sa.yaml - assert: file: 01-assert.yaml - - name: step-02 - try: + - name: step-02 + try: - script: timeout: 30s content: ./create_rapidast_configmap.sh - assert: file: 02-assert.yaml - - name: step-03 - try: + - name: step-03 + try: - apply: file: 03-rapidast-job.yaml - assert: @@ -35,8 +35,8 @@ spec: - script: timeout: 6m content: ./results.sh - finally: - - command: + finally: + - command: timeout: 1m entrypoint: oc args: @@ -45,7 +45,7 @@ spec: - delete - pod - rapiterm-ptp - - command: + - command: timeout: 1m entrypoint: oc args: diff --git a/tests/dast/rapid-talm/03-rapidast-job.yaml b/tests/dast/rapid-talm/03-rapidast-job.yaml index a354de4..2b1d1a6 100644 --- a/tests/dast/rapid-talm/03-rapidast-job.yaml +++ b/tests/dast/rapid-talm/03-rapidast-job.yaml @@ -36,9 +36,7 @@ spec: - command: - sh - -c - - rapidast.py --log-level debug --config - /helm/config/rapidastconfig.yaml && find /opt/rapidast/results/talm - -name zap-report.json -exec cat {} \; + - rapidast.py --log-level debug --config /helm/config/rapidastconfig.yaml && find /opt/rapidast/results/talm -name zap-report.json -exec cat {} \; image: quay.io/redhatproductsecurity/rapidast:latest imagePullPolicy: Always name: rapidast-chart @@ -63,4 +61,4 @@ spec: name: config-volume - name: results-volume persistentVolumeClaim: null - claimName: rapidast-pvc + claimName: rapidast-pvc diff --git a/tests/dast/rapid-talm/04-assert.yaml b/tests/dast/rapid-talm/04-assert.yaml index 055850b..91c9f2e 100644 --- a/tests/dast/rapid-talm/04-assert.yaml +++ b/tests/dast/rapid-talm/04-assert.yaml @@ -2,4 +2,4 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert timeout: 180 commands: - - script: ./tests/e2e-rh-sdl/rapidast-talm/results.sh + - script: ./tests/dast/rapidast-talm/results.sh diff --git a/tests/dast/rapid-talm/chainsaw-test.yaml b/tests/dast/rapid-talm/chainsaw-test.yaml index a12658c..984550a 100644 --- a/tests/dast/rapid-talm/chainsaw-test.yaml +++ b/tests/dast/rapid-talm/chainsaw-test.yaml @@ -5,38 +5,38 @@ metadata: name: rapidast-talm spec: steps: - - name: step-00 - try: + - name: step-00 + try: - apply: file: 00-create-project.yaml - assert: file: 00-assert.yaml - - name: step-01 - try: + - name: step-01 + try: - apply: file: 01-create-sa.yaml - assert: file: 01-assert.yaml - - name: step-02 - try: + - name: step-02 + try: - script: timeout: 30s content: ./create_rapidast_configmap.sh - assert: file: 02-assert.yaml - - name: step-03 - try: + - name: step-03 + try: - apply: file: 03-rapidast-job.yaml - assert: file: 03-assert.yaml - - name: step-04 - try: + - name: step-04 + try: - script: timeout: 6m content: ./results.sh - finally: - - command: + finally: + - command: timeout: 1m entrypoint: oc args: @@ -45,7 +45,7 @@ spec: - delete - pod - rapiterm-talm - - command: + - command: timeout: 1m entrypoint: oc args: