-
Notifications
You must be signed in to change notification settings - Fork 230
USHIFT-6746: migrate 23 OTP router tests to Robot Framework #6730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
agullon
wants to merge
12
commits into
openshift:main
Choose a base branch
from
agullon:USHIFT-6746
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
42f5ec7
USHIFT-6746: migrate 23 OTP router tests to Robot Framework
agullon ba69fa0
USHIFT-6746: move router-extended scenarios to releases only
agullon d8a7c7f
USHIFT-6746: refactor router tests to comply with robocop limits
agullon 28add89
USHIFT-6746: fix three bugs found during review
agullon 4954eb6
USHIFT-6746: apply CodeRabbit suggestions
agullon f0d4200
USHIFT-6746: remove unused syslog_ip arg from Verify Syslog Log Delivery
agullon 0d51bcf
USHIFT-6746: split router-extended scenario into 5 scenarios (~30 min…
agullon 90bf135
USHIFT-6746: rename router.robot to router-basic.robot
agullon cdd3f02
USHIFT-6746: split router-config.robot into 4 dedicated .robot files
agullon 7f6e4a7
USHIFT-6746: fix SSL error assertion and add workload cleanup to tear…
agullon 3958dfd
USHIFT-6746: add Cleanup Test Workloads to fix cross-test resource co…
agullon 1a4ce68
USHIFT-6746: add run-single-test.sh helper for manual test execution
agullon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| HTTP/1.0 404 Not Found | ||
| Connection: close | ||
| Content-Type: text/html | ||
|
|
||
| <html> | ||
| <head><title>Custom:Not Found</title></head> | ||
| <body> | ||
| <p>Custom error page:The requested document was not found.</p> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| HTTP/1.0 503 Service Unavailable | ||
| Connection: close | ||
| Content-Type: text/html | ||
|
|
||
| <html> | ||
| <head><title>Custom:Application Unavailable</title></head> | ||
| <body> | ||
| <p>Custom error page:The requested application is not available.</p> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: ingress-ms-reen | ||
| annotations: | ||
| route.openshift.io/destination-ca-certificate-secret: service-secret | ||
| route.openshift.io/termination: reencrypt | ||
| spec: | ||
| rules: | ||
| - host: service-secure-test.example.com | ||
| http: | ||
| paths: | ||
| - backend: | ||
| service: | ||
| name: service-secure | ||
| port: | ||
| number: 27443 | ||
| path: "/" | ||
| pathType: Prefix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: ingress-on-microshift | ||
| spec: | ||
| rules: | ||
| - host: service-unsecure-test.example.com | ||
| http: | ||
| paths: | ||
| - backend: | ||
| service: | ||
| name: service-unsecure | ||
| port: | ||
| number: 27017 | ||
| path: "/" | ||
| pathType: Prefix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| kind: Pod | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: rsyslogd-pod | ||
| labels: | ||
| name: rsyslogd | ||
| spec: | ||
| containers: | ||
| - image: quay.io/openshifttest/rsyslogd-container@sha256:e806eb41f05d7cc6eec96bf09c7bcb692f97562d4a983cb019289bd048d9aee2 | ||
| name: rsyslogd-container | ||
| securityContext: | ||
| privileged: true | ||
| ports: | ||
| - containerPort: 514 | ||
| protocol: TCP | ||
| - containerPort: 514 | ||
| protocol: UDP | ||
| resources: | ||
| limits: | ||
| memory: 340Mi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| labels: | ||
| app: hello-pod | ||
| name: hello-pod | ||
| spec: | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| containers: | ||
| - image: quay.io/openshifttest/nginx-alpine@sha256:cee6930776b92dc1e93b73f9e5965925d49cff3d2e91e1d071c2f0ff72cbca29 | ||
| name: hello-pod | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| ports: | ||
| - containerPort: 8080 | ||
| - containerPort: 8443 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| apiVersion: v1 | ||
| kind: List | ||
| items: | ||
| - apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: web-server-deploy | ||
| labels: | ||
| app: web-server-deploy | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| name: web-server-deploy | ||
| template: | ||
| metadata: | ||
| labels: | ||
| name: web-server-deploy | ||
| spec: | ||
| containers: | ||
| - name: nginx | ||
| image: quay.io/openshifttest/nginx-alpine@sha256:cee6930776b92dc1e93b73f9e5965925d49cff3d2e91e1d071c2f0ff72cbca29 | ||
| ports: | ||
| - containerPort: 8080 | ||
| name: http | ||
| protocol: TCP | ||
| - containerPort: 8443 | ||
| name: https | ||
| protocol: TCP | ||
| - kind: Service | ||
| apiVersion: v1 | ||
| metadata: | ||
| labels: | ||
| name: service-secure | ||
| name: service-secure | ||
| spec: | ||
| ports: | ||
| - name: https | ||
| protocol: TCP | ||
| port: 27443 | ||
| targetPort: 8443 | ||
| selector: | ||
| name: web-server-deploy | ||
| - apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| labels: | ||
| name: service-unsecure | ||
| name: service-unsecure | ||
| spec: | ||
| ports: | ||
| - name: http | ||
| port: 27017 | ||
| protocol: TCP | ||
| targetPort: 8080 | ||
| selector: | ||
| name: web-server-deploy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| apiVersion: v1 | ||
| kind: List | ||
| items: | ||
| - apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: nginx-config | ||
| data: | ||
| nginx.conf: | | ||
| events { | ||
| worker_connections 1024; | ||
| } | ||
|
|
||
| http { | ||
| server { | ||
| listen 8080; | ||
| listen [::]:8080; | ||
| location / { | ||
| root /data/http; | ||
| } | ||
| } | ||
|
|
||
| server { | ||
| listen 8443 ssl http2 default; | ||
| listen [::]:8443 ssl http2 default; | ||
| server_name _; | ||
| ssl_certificate certs/tls.crt; | ||
| ssl_certificate_key certs/tls.key; | ||
| location / { | ||
| root /data/https-default; | ||
| } | ||
| } | ||
| } | ||
| - apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: web-server-deploy | ||
| labels: | ||
| name: web-server-deploy | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchExpressions: | ||
| - {key: name, operator: In, values: [web-server-deploy]} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| name: web-server-deploy | ||
| spec: | ||
| containers: | ||
| - name: nginx | ||
| image: quay.io/openshifttest/nginx-alpine@sha256:cee6930776b92dc1e93b73f9e5965925d49cff3d2e91e1d071c2f0ff72cbca29 | ||
| volumeMounts: | ||
| - name: service-secret | ||
| mountPath: /etc/nginx/certs/ | ||
| - name: nginx-config | ||
| mountPath: /etc/nginx/ | ||
| volumes: | ||
| - name: service-secret | ||
| secret: | ||
| secretName: service-secret | ||
| - name: nginx-config | ||
| configMap: | ||
| name: nginx-config | ||
| - kind: Service | ||
| apiVersion: v1 | ||
| metadata: | ||
| annotations: | ||
| service.beta.openshift.io/serving-cert-secret-name: service-secret | ||
| labels: | ||
| name: service-secure | ||
| name: service-secure | ||
| spec: | ||
| ports: | ||
| - name: https | ||
| protocol: TCP | ||
| port: 27443 | ||
| targetPort: 8443 | ||
| selector: | ||
| name: web-server-deploy | ||
| - apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| labels: | ||
| name: service-unsecure | ||
| name: service-unsecure | ||
| spec: | ||
| ports: | ||
| - name: http | ||
| port: 27017 | ||
| protocol: TCP | ||
| targetPort: 8080 | ||
| selector: | ||
| name: web-server-deploy | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| # Run a single Robot Framework test against a remote MicroShift cluster. | ||
| # | ||
| # Usage: | ||
| # ./test/bin/run-single-test.sh <variables.yaml> <robot-file> [test-name] | ||
| # | ||
| # Examples: | ||
| # ./test/bin/run-single-test.sh test/variables.yaml suites/router/router-config-infra.robot | ||
| # ./test/bin/run-single-test.sh test/variables.yaml suites/router/router-config-infra.robot 'Custom Listening IPs And Ports' | ||
|
|
||
| VARIABLES_FILE="$(cd "$(dirname "${1:?Usage: $0 <variables.yaml> <robot-file> [test-name]}")" && pwd)/$(basename "$1")" | ||
| ROBOT_FILE="${2:?Usage: $0 <variables.yaml> <robot-file> [test-name]}" | ||
| TEST_NAME="${3:-}" | ||
|
|
||
| ROOTDIR="$(cd "$(dirname "$0")/../.." && pwd)" | ||
| TESTDIR="${ROOTDIR}/test" | ||
| RF_VENV="${ROOTDIR}/_output/robotenv" | ||
| OUTDIR="${ROOTDIR}/_output/rf-single-$(date +%Y%m%d-%H%M%S)" | ||
|
|
||
| if [[ ! -f "${VARIABLES_FILE}" ]]; then | ||
| echo "ERROR: Variables file not found: ${VARIABLES_FILE}" | ||
| echo "" | ||
| echo "Create one from the example:" | ||
| echo " cp test/variables.yaml.example test/variables.yaml" | ||
| echo "" | ||
| echo "Required fields:" | ||
| echo " USHIFT_HOST: <host-ip>" | ||
| echo " USHIFT_USER: <ssh-user>" | ||
| echo " SSH_PRIV_KEY: <path-to-key-or-empty-for-agent>" | ||
| echo " SSH_PORT: 22" | ||
| echo " API_PORT: 6443" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ ! -d "${RF_VENV}" ]]; then | ||
| echo "Setting up Robot Framework venv..." | ||
| "${ROOTDIR}/scripts/fetch_tools.sh" robotframework | ||
| fi | ||
|
|
||
| RF_BINARY="${RF_VENV}/bin/robot" | ||
| if [[ ! -f "${RF_BINARY}" ]]; then | ||
| echo "ERROR: robot binary not found at ${RF_BINARY}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| mkdir -p "${OUTDIR}" | ||
|
|
||
| TEST_FLAG=() | ||
| if [[ -n "${TEST_NAME}" ]]; then | ||
| TEST_FLAG=(-t "${TEST_NAME}") | ||
| echo "=== Running test: ${TEST_NAME} ===" | ||
| else | ||
| echo "=== Running all tests ===" | ||
| fi | ||
| echo "Variables: ${VARIABLES_FILE}" | ||
| echo "Robot file: ${ROBOT_FILE}" | ||
| echo "Output dir: ${OUTDIR}" | ||
| echo "" | ||
|
|
||
| cd "${TESTDIR}" | ||
|
|
||
| exec "${RF_BINARY}" \ | ||
| --loglevel TRACE \ | ||
| -V "${VARIABLES_FILE}" \ | ||
| --outputdir "${OUTDIR}" \ | ||
| --pythonpath resources \ | ||
| ${TEST_FLAG+"${TEST_FLAG[@]}"} \ | ||
| "${ROBOT_FILE}" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.