-
Notifications
You must be signed in to change notification settings - Fork 231
USHIFT-6747: Migrate 14 QE networking/router tests to Robot Framework #7261
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
Open
agullon
wants to merge
8
commits into
openshift:main
Choose a base branch
from
agullon:USHIFT-6747
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.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8384445
test: add shared network-testing resource keywords
agullon da029e0
test: add host-networking RF tests (60550, 65838, 64752)
agullon d78881e
test: add NetworkPolicy RF tests (60331, 60332, 60426)
agullon 87a5e50
test: add service-types RF tests (60968, 61218, 60290)
agullon 49cb22c
test: add route-types RF tests (60149, 60266, 60283, 60136, 73152)
agullon 36be446
test: add network-features release scenario
agullon 7f640b1
test: apply CodeRabbit suggestions from PR #7261
agullon 90f9703
test: fix robocop lint and format violations in networking suites
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
Some comments aren't visible on the classic Files Changed page.
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,27 @@ | ||
| kind: Pod | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: hostport-pod | ||
| labels: | ||
| app: hostport-pod | ||
| spec: | ||
| terminationGracePeriodSeconds: 0 | ||
| containers: | ||
| - name: hostport-pod | ||
| image: quay.io/microshift/busybox:1.36 | ||
| command: ["/bin/sh"] | ||
| args: ["-c", "while true; do echo -ne \"HTTP/1.0 200 OK\r\nContent-Length: 16\r\n\r\nHello MicroShift\" | nc -l -p 8080 ; done"] | ||
| ports: | ||
| - containerPort: 8080 | ||
| hostPort: 9500 | ||
| protocol: TCP | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| runAsNonRoot: true | ||
| runAsUser: 1001 | ||
| runAsGroup: 1001 | ||
| seccompProfile: | ||
| type: RuntimeDefault |
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,26 @@ | ||
| kind: Pod | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: udp-pod | ||
| labels: | ||
| app: udp-pod | ||
| spec: | ||
| terminationGracePeriodSeconds: 0 | ||
| containers: | ||
| - name: udp-listener | ||
| image: quay.io/microshift/busybox:1.36 | ||
| command: ["/bin/sh"] | ||
| args: ["-c", "nc -u -l -p 8080 -e /bin/cat; sleep infinity"] | ||
| ports: | ||
| - containerPort: 8080 | ||
| protocol: UDP | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| runAsNonRoot: true | ||
| runAsUser: 1001 | ||
| runAsGroup: 1001 | ||
| seccompProfile: | ||
| type: RuntimeDefault |
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,11 @@ | ||
| kind: NetworkPolicy | ||
| apiVersion: networking.k8s.io/v1 | ||
| metadata: | ||
| name: allow-from-red | ||
| spec: | ||
| podSelector: {} | ||
| ingress: | ||
| - from: | ||
| - podSelector: | ||
| matchLabels: | ||
| type: red |
11 changes: 11 additions & 0 deletions
11
test/assets/network-policy/netpol-allow-same-namespace.yaml
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,11 @@ | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: allow-from-same-namespace | ||
| spec: | ||
| podSelector: {} | ||
| ingress: | ||
| - from: | ||
| - podSelector: {} | ||
| policyTypes: | ||
| - Ingress |
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 @@ | ||
| kind: NetworkPolicy | ||
| apiVersion: networking.k8s.io/v1 | ||
| metadata: | ||
| name: allow-to-blue | ||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| type: blue | ||
| ingress: | ||
| - {} |
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,8 @@ | ||
| kind: NetworkPolicy | ||
| apiVersion: networking.k8s.io/v1 | ||
| metadata: | ||
| name: default-deny-ingress | ||
| spec: | ||
| podSelector: {} | ||
| policyTypes: | ||
| - Ingress |
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,15 @@ | ||
| kind: NetworkPolicy | ||
| apiVersion: networking.k8s.io/v1 | ||
| metadata: | ||
| name: egress-ns-label | ||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| name: hello-microshift | ||
| egress: | ||
| - to: | ||
| - namespaceSelector: | ||
| matchLabels: | ||
| team: openshift | ||
| policyTypes: | ||
| - Egress |
18 changes: 18 additions & 0 deletions
18
test/assets/network-policy/netpol-ingress-pod-ns-label.yaml
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,18 @@ | ||
| kind: NetworkPolicy | ||
| apiVersion: networking.k8s.io/v1 | ||
| metadata: | ||
| name: ingress-pod-ns-label | ||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| name: hello-microshift | ||
| ingress: | ||
| - from: | ||
| - namespaceSelector: | ||
| matchLabels: | ||
| team: operations | ||
| podSelector: | ||
| matchLabels: | ||
| name: test-pods | ||
| policyTypes: | ||
| - Ingress |
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-reencrypt | ||
| 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-http | ||
| 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,58 @@ | ||
| 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: | ||
| automountServiceAccountToken: false | ||
| containers: | ||
| - name: nginx | ||
| image: quay.io/microshift/hello-world:latest | ||
| 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/microshift/hello-world:latest | ||
| 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 |
35 changes: 35 additions & 0 deletions
35
test/assets/service-types/deployment-hello-2-replicas.yaml
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,35 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: hello-deploy | ||
| labels: | ||
| app: hello-deploy | ||
| spec: | ||
| replicas: 2 | ||
| selector: | ||
| matchLabels: | ||
| app: hello-deploy | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: hello-deploy | ||
| spec: | ||
| terminationGracePeriodSeconds: 0 | ||
| containers: | ||
| - name: hello-microshift | ||
| image: quay.io/microshift/busybox:1.36 | ||
| command: ["/bin/sh"] | ||
| args: ["-c", "while true; do echo -ne \"HTTP/1.0 200 OK\r\nContent-Length: 16\r\n\r\nHello MicroShift\" | nc -l -p 8080 ; done"] | ||
| ports: | ||
| - containerPort: 8080 | ||
| protocol: TCP | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| runAsNonRoot: true | ||
| runAsUser: 1001 | ||
| runAsGroup: 1001 | ||
| seccompProfile: | ||
| type: RuntimeDefault |
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,14 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: hello-deploy | ||
| labels: | ||
| app: hello-deploy | ||
| spec: | ||
| type: ClusterIP | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| protocol: TCP | ||
| selector: | ||
| app: hello-deploy |
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.