From dd38d8670b7ad6e79cf2dced1a476bde6e591f1e Mon Sep 17 00:00:00 2001 From: Patryk Matuszak <305846+pmtk@users.noreply.github.com> Date: Tue, 27 Feb 2024 09:46:48 +0100 Subject: [PATCH 1/4] USHIFT-2226: Test Multus - Bridge CNI --- test/assets/multus/bridge-nad.yaml | 25 +++ test/assets/multus/bridge-pod.yaml | 28 ++++ .../assets/multus/bridge-preexisting-nad.yaml | 25 +++ .../assets/multus/bridge-preexisting-pod.yaml | 28 ++++ .../group1/rhel92-source-with-optionals.toml | 4 + test/resources/DataFormats.py | 2 + test/resources/oc.resource | 8 +- test/suites/optional/multus.robot | 151 ++++++++++++++++++ 8 files changed, 267 insertions(+), 4 deletions(-) create mode 100644 test/assets/multus/bridge-nad.yaml create mode 100644 test/assets/multus/bridge-pod.yaml create mode 100644 test/assets/multus/bridge-preexisting-nad.yaml create mode 100644 test/assets/multus/bridge-preexisting-pod.yaml create mode 100644 test/suites/optional/multus.robot diff --git a/test/assets/multus/bridge-nad.yaml b/test/assets/multus/bridge-nad.yaml new file mode 100644 index 0000000000..1025a132b1 --- /dev/null +++ b/test/assets/multus/bridge-nad.yaml @@ -0,0 +1,25 @@ +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: bridge-conf +spec: + config: '{ + "cniVersion": "0.4.0", + "type": "bridge", + "bridge": "br-test", + "mode": "bridge", + "ipam": { + "type": "host-local", + "ranges": [ + [ + { + "subnet": "10.10.0.0/24", + "rangeStart": "10.10.0.20", + "rangeEnd": "10.10.0.50", + "gateway": "10.10.0.254" + } + ] + ], + "dataDir": "/var/lib/cni/br-test" + } + }' diff --git a/test/assets/multus/bridge-pod.yaml b/test/assets/multus/bridge-pod.yaml new file mode 100644 index 0000000000..59e3832636 --- /dev/null +++ b/test/assets/multus/bridge-pod.yaml @@ -0,0 +1,28 @@ +kind: Pod +apiVersion: v1 +metadata: + name: test-bridge + annotations: + k8s.v1.cni.cncf.io/networks: bridge-conf + labels: + app: test-bridge +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 diff --git a/test/assets/multus/bridge-preexisting-nad.yaml b/test/assets/multus/bridge-preexisting-nad.yaml new file mode 100644 index 0000000000..0fdda25c9a --- /dev/null +++ b/test/assets/multus/bridge-preexisting-nad.yaml @@ -0,0 +1,25 @@ +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: bridge-preexisting-conf +spec: + config: '{ + "cniVersion": "0.4.0", + "type": "bridge", + "bridge": "br-preexisting", + "mode": "bridge", + "ipam": { + "type": "host-local", + "ranges": [ + [ + { + "subnet": "10.10.1.0/24", + "rangeStart": "10.10.1.20", + "rangeEnd": "10.10.1.50", + "gateway": "10.10.1.254" + } + ] + ], + "dataDir": "/var/lib/cni/br-preexisting" + } + }' diff --git a/test/assets/multus/bridge-preexisting-pod.yaml b/test/assets/multus/bridge-preexisting-pod.yaml new file mode 100644 index 0000000000..4ffd6e4e49 --- /dev/null +++ b/test/assets/multus/bridge-preexisting-pod.yaml @@ -0,0 +1,28 @@ +kind: Pod +apiVersion: v1 +metadata: + name: test-bridge-preexisting + annotations: + k8s.v1.cni.cncf.io/networks: bridge-preexisting-conf + labels: + app: test-bridge-preexisting +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 diff --git a/test/image-blueprints/layer3-periodic/group1/rhel92-source-with-optionals.toml b/test/image-blueprints/layer3-periodic/group1/rhel92-source-with-optionals.toml index cf1d7197d7..a3a292785c 100644 --- a/test/image-blueprints/layer3-periodic/group1/rhel92-source-with-optionals.toml +++ b/test/image-blueprints/layer3-periodic/group1/rhel92-source-with-optionals.toml @@ -25,6 +25,10 @@ version = "{{ .Env.SOURCE_VERSION }}" name = "microshift-olm" version = "{{ .Env.SOURCE_VERSION }}" +[[packages]] +name = "microshift-multus" +version = "{{ .Env.SOURCE_VERSION }}" + [[packages]] name = "microshift-test-agent" version = "*" diff --git a/test/resources/DataFormats.py b/test/resources/DataFormats.py index 3448dc43b9..1b3fd3732d 100644 --- a/test/resources/DataFormats.py +++ b/test/resources/DataFormats.py @@ -14,6 +14,8 @@ def json_parse(data): if not data: return DotDict() parsed = json.loads(data) + if type(parsed) == list: + return DotDict({"list": parsed})["list"] return DotDict(parsed) diff --git a/test/resources/oc.resource b/test/resources/oc.resource index 459d6eb11c..a4d843de04 100644 --- a/test/resources/oc.resource +++ b/test/resources/oc.resource @@ -46,8 +46,8 @@ Oc Delete Oc Exec [Documentation] Run 'oc exec' on a specific pod in the curret test namespace ... Returns the command's combined STDOUT/STDER - [Arguments] ${pod} ${cmd} - ${output}= Run With Kubeconfig oc exec -n ${NAMESPACE} pod/${pod} -- /bin/bash -c '${cmd}' + [Arguments] ${pod} ${cmd} ${ns}=${NAMESPACE} + ${output}= Run With Kubeconfig oc exec -n ${ns} pod/${pod} -- /bin/bash -c '${cmd}' RETURN ${output} Named Pod Should Be Ready @@ -57,7 +57,7 @@ Named Pod Should Be Ready ... ${timeout} Period of time to wait for pod to reach ready status. Default 30s. [Arguments] ${name} ${ns}=${NAMESPACE} ${timeout}=30s - Run With Kubeconfig oc wait -n ${NAMESPACE} pod/${name} --for="condition=Ready" --timeout=${timeout} + Run With Kubeconfig oc wait -n ${ns} pod/${name} --for="condition=Ready" --timeout=${timeout} Named Pod Should Be Deleted [Documentation] Wait for pod with ${name} to be deleted @@ -65,7 +65,7 @@ Named Pod Should Be Deleted ... ${ns} Namespace of named pod. Defaults to NAMESPACE suite variable ... ${timeout} Period of time to wait for pod to reach ready status. Default 30s. [Arguments] ${name} ${ns}=${NAMESPACE} ${timeout}=30s - Run With Kubeconfig oc wait -n ${NAMESPACE} pod/${name} --for=delete --timeout=${timeout} + Run With Kubeconfig oc wait -n ${ns} pod/${name} --for=delete --timeout=${timeout} Labeled Pod Should Be Ready [Documentation] Wait for pod(s) ready by ${label} to become "Ready" diff --git a/test/suites/optional/multus.robot b/test/suites/optional/multus.robot new file mode 100644 index 0000000000..7a5fb0f5a3 --- /dev/null +++ b/test/suites/optional/multus.robot @@ -0,0 +1,151 @@ +*** Settings *** +Documentation Tests for Multus and Bridge plugin on MicroShift + +Resource ../../resources/common.resource +Resource ../../resources/microshift-process.resource + +Suite Setup Setup +Suite Teardown Teardown + + +*** Variables *** +${BRIDGE_INTERFACE} br-test +${BRIDGE_NAD_YAML} ./assets/multus/bridge-nad.yaml +${BRIDGE_POD_YAML} ./assets/multus/bridge-pod.yaml +${BRIDGE_POD_NAME} test-bridge +${BRIDGE_IP} 10.10.0.10/24 + +${PREEXISTING_BRIDGE_INTERFACE} br-preexisting +${PREEXISTING_BRIDGE_NAD_YAML} ./assets/multus/bridge-preexisting-nad.yaml +${PREEXISTING_BRIDGE_POD_YAML} ./assets/multus/bridge-preexisting-pod.yaml +${PREEXISTING_BRIDGE_POD_NAME} test-bridge-preexisting +${PREEXISTING_BRIDGE_IP} 10.10.1.10/24 + +${NS} default + + +*** Test Cases *** +Pre-Existing Bridge Interface + [Documentation] Test verifies if Bridge CNI plugin will work correctly with pre-existing interface. + [Setup] Run Keywords + ... Interface Should Not Exist ${PREEXISTING_BRIDGE_INTERFACE} + ... AND + ... Create Interface ${PREEXISTING_BRIDGE_INTERFACE} + ... AND + ... Create NAD And Pod ${PREEXISTING_BRIDGE_NAD_YAML} ${PREEXISTING_BRIDGE_POD_YAML} + ... AND + ... Named Pod Should Be Ready ${PREEXISTING_BRIDGE_POD_NAME} ${NS} + ... AND + ... Interface Should Exist ${PREEXISTING_BRIDGE_INTERFACE} + ... AND + ... Set IP For Host Interface ${PREEXISTING_BRIDGE_INTERFACE} ${PREEXISTING_BRIDGE_IP} + + Curl Pod Over Local Interface ${PREEXISTING_BRIDGE_POD_NAME} ${NS} ${PREEXISTING_BRIDGE_INTERFACE} + + [Teardown] Cleanup Bridge Test + ... ${PREEXISTING_BRIDGE_NAD_YAML} + ... ${PREEXISTING_BRIDGE_POD_YAML} + ... ${PREEXISTING_BRIDGE_INTERFACE} + +No Pre-Existing Bridge Interface + [Documentation] Test verifies if Bridge CNI plugin will + ... work correctly if there is no pre-existing bridge + ... interface - it needs to be created. + [Setup] Run Keywords + ... Interface Should Not Exist ${BRIDGE_INTERFACE} + ... AND + ... Create NAD And Pod ${BRIDGE_NAD_YAML} ${BRIDGE_POD_YAML} + ... AND + ... Named Pod Should Be Ready ${BRIDGE_POD_NAME} ${NS} + ... AND + ... Interface Should Exist ${BRIDGE_INTERFACE} + ... AND + ... Set IP For Host Interface ${BRIDGE_INTERFACE} ${BRIDGE_IP} + + Curl Pod Over Local Interface ${BRIDGE_POD_NAME} ${NS} ${BRIDGE_INTERFACE} + + [Teardown] Cleanup Bridge Test + ... ${BRIDGE_NAD_YAML} + ... ${BRIDGE_POD_YAML} + ... ${BRIDGE_INTERFACE} + + +*** Keywords *** +Setup + [Documentation] Test suite setup + Check Required Env Variables + Login MicroShift Host + Setup Kubeconfig + +Teardown + [Documentation] Test suite teardown + Logout MicroShift Host + Remove Kubeconfig + +Create NAD And Pod + [Documentation] Creates provided NetworkAttachmentDefinition and Pod. + [Arguments] ${nad} ${pod} + Oc Create -f ${nad} + Oc Create -f ${pod} + +Cleanup Bridge Test + [Documentation] Removes provided NetworkAttachmentDefinition, Pod and network interface to allow for test rerun. + [Arguments] ${nad} ${pod} ${if} + Run Keyword And Continue On Failure + ... Oc Delete -f ${pod} + Run Keyword And Continue On Failure + ... Oc Delete -f ${nad} + Command Should Work ip link delete ${if} + +Curl Pod Over Local Interface + [Documentation] Makes a HTTP request to 8080 for a given Pod over given interface. + [Arguments] ${pod} ${ns} ${if} + + ${networks}= Get And Verify Pod Networks ${pod} ${ns} + ${extra_ip}= Set Variable ${networks}[1][ips][0] + + ${stdout}= Command Should Work curl -v --interface ${if} ${extra_ip}:8080 + Should Contain ${stdout} Hello MicroShift + +Interface Should Not Exist + [Documentation] Verifies that network interface does not exist. + [Arguments] ${if} + ${stdout} ${rc}= Execute Command + ... ip link show ${if} + ... sudo=True return_rc=True + Should Be Equal As Integers ${rc} 1 + +Create Interface + [Documentation] Creates network interface. + [Arguments] ${if} ${type}=bridge + Command Should Work ip link add dev ${if} type ${type} + +Interface Should Exist + [Documentation] Verifies that interface exists on the host. + [Arguments] ${if} + Command Should Work ip link show ${if} + +Set IP For Host Interface + [Documentation] Sets IP address for the interface. + [Arguments] ${if} ${cidr} + Command Should Work ip addr add ${cidr} dev ${if} + +Get And Verify Pod Networks + [Documentation] Obtains interfaces of the Pod from its annotation. + ... The annotation is managed by Multus. + [Arguments] ${pod} ${ns} + + ${networks_str}= Oc Get JsonPath + ... pod + ... ${ns} + ... ${pod} + ... .metadata.annotations.k8s\\.v1\\.cni\\.cncf\\.io/network-status + Should Not Be Empty ${networks_str} + + ${networks}= Json Parse ${networks_str} + ${n}= Get Length ${networks} + Should Be Equal As Integers ${n} 2 + Should Be Equal As Strings ${networks}[0][name] ovn-kubernetes + Should Match ${networks}[1][name] default/bridge*-conf + + RETURN ${networks} From 5dac32a1a07fb6fe68b7feb7aea3fd74ed25a987 Mon Sep 17 00:00:00 2001 From: Patryk Matuszak <305846+pmtk@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:23:41 +0100 Subject: [PATCH 2/4] introduce `Command Should Fail` keyword --- test/resources/microshift-host.resource | 11 +++++++++++ test/suites/optional/multus.robot | 5 +---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/resources/microshift-host.resource b/test/resources/microshift-host.resource index ec596f35b6..408ab725d8 100644 --- a/test/resources/microshift-host.resource +++ b/test/resources/microshift-host.resource @@ -122,3 +122,14 @@ Command Should Work Log ${stderr} Should Be Equal As Integers 0 ${rc} RETURN ${stdout} + +Command Should Fail + [Documentation] Run a command remotely, expect command to fail + [Arguments] ${command} + ${stdout} ${stderr} ${rc}= SSHLibrary.Execute Command + ... ${command} + ... sudo=True + ... return_rc=True + ... return_stderr=True + ... return_stdout=True + Should Not Be Equal As Integers 0 ${rc} diff --git a/test/suites/optional/multus.robot b/test/suites/optional/multus.robot index 7a5fb0f5a3..03ca900279 100644 --- a/test/suites/optional/multus.robot +++ b/test/suites/optional/multus.robot @@ -110,10 +110,7 @@ Curl Pod Over Local Interface Interface Should Not Exist [Documentation] Verifies that network interface does not exist. [Arguments] ${if} - ${stdout} ${rc}= Execute Command - ... ip link show ${if} - ... sudo=True return_rc=True - Should Be Equal As Integers ${rc} 1 + Command Should Fail ip link show ${if} Create Interface [Documentation] Creates network interface. From 2a95a68724157e5e6b6d4cd92f518e9922b5a387 Mon Sep 17 00:00:00 2001 From: Patryk Matuszak <305846+pmtk@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:23:54 +0100 Subject: [PATCH 3/4] rename 'Curl Pod...' to 'Connecto To Pod...' --- test/suites/optional/multus.robot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/suites/optional/multus.robot b/test/suites/optional/multus.robot index 03ca900279..6d9e9c4b6f 100644 --- a/test/suites/optional/multus.robot +++ b/test/suites/optional/multus.robot @@ -40,7 +40,7 @@ Pre-Existing Bridge Interface ... AND ... Set IP For Host Interface ${PREEXISTING_BRIDGE_INTERFACE} ${PREEXISTING_BRIDGE_IP} - Curl Pod Over Local Interface ${PREEXISTING_BRIDGE_POD_NAME} ${NS} ${PREEXISTING_BRIDGE_INTERFACE} + Connect To Pod Over Local Interface ${PREEXISTING_BRIDGE_POD_NAME} ${NS} ${PREEXISTING_BRIDGE_INTERFACE} [Teardown] Cleanup Bridge Test ... ${PREEXISTING_BRIDGE_NAD_YAML} @@ -62,7 +62,7 @@ No Pre-Existing Bridge Interface ... AND ... Set IP For Host Interface ${BRIDGE_INTERFACE} ${BRIDGE_IP} - Curl Pod Over Local Interface ${BRIDGE_POD_NAME} ${NS} ${BRIDGE_INTERFACE} + Connect To Pod Over Local Interface ${BRIDGE_POD_NAME} ${NS} ${BRIDGE_INTERFACE} [Teardown] Cleanup Bridge Test ... ${BRIDGE_NAD_YAML} @@ -97,7 +97,7 @@ Cleanup Bridge Test ... Oc Delete -f ${nad} Command Should Work ip link delete ${if} -Curl Pod Over Local Interface +Connect To Pod Over Local Interface [Documentation] Makes a HTTP request to 8080 for a given Pod over given interface. [Arguments] ${pod} ${ns} ${if} From f1cd4f117cb1dda8b711f3978b0397c6fabfe4ea Mon Sep 17 00:00:00 2001 From: Patryk Matuszak <305846+pmtk@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:33:00 +0100 Subject: [PATCH 4/4] use dynamic namespace --- test/suites/optional/multus.robot | 71 +++++++++++++------------------ 1 file changed, 29 insertions(+), 42 deletions(-) diff --git a/test/suites/optional/multus.robot b/test/suites/optional/multus.robot index 6d9e9c4b6f..0ba5ecff1d 100644 --- a/test/suites/optional/multus.robot +++ b/test/suites/optional/multus.robot @@ -4,48 +4,46 @@ Documentation Tests for Multus and Bridge plugin on MicroShift Resource ../../resources/common.resource Resource ../../resources/microshift-process.resource -Suite Setup Setup -Suite Teardown Teardown +Suite Setup Setup Suite With Namespace +Suite Teardown Teardown Suite With Namespace *** Variables *** -${BRIDGE_INTERFACE} br-test -${BRIDGE_NAD_YAML} ./assets/multus/bridge-nad.yaml -${BRIDGE_POD_YAML} ./assets/multus/bridge-pod.yaml -${BRIDGE_POD_NAME} test-bridge -${BRIDGE_IP} 10.10.0.10/24 +${BRIDGE_INTERFACE} br-test +${BRIDGE_NAD_YAML} ./assets/multus/bridge-nad.yaml +${BRIDGE_POD_YAML} ./assets/multus/bridge-pod.yaml +${BRIDGE_POD_NAME} test-bridge +${BRIDGE_IP} 10.10.0.10/24 -${PREEXISTING_BRIDGE_INTERFACE} br-preexisting -${PREEXISTING_BRIDGE_NAD_YAML} ./assets/multus/bridge-preexisting-nad.yaml -${PREEXISTING_BRIDGE_POD_YAML} ./assets/multus/bridge-preexisting-pod.yaml -${PREEXISTING_BRIDGE_POD_NAME} test-bridge-preexisting -${PREEXISTING_BRIDGE_IP} 10.10.1.10/24 - -${NS} default +${PE_BRIDGE_INTERFACE} br-preexisting +${PE_BRIDGE_NAD_YAML} ./assets/multus/bridge-preexisting-nad.yaml +${PE_BRIDGE_POD_YAML} ./assets/multus/bridge-preexisting-pod.yaml +${PE_BRIDGE_POD_NAME} test-bridge-preexisting +${PE_BRIDGE_IP} 10.10.1.10/24 *** Test Cases *** Pre-Existing Bridge Interface [Documentation] Test verifies if Bridge CNI plugin will work correctly with pre-existing interface. [Setup] Run Keywords - ... Interface Should Not Exist ${PREEXISTING_BRIDGE_INTERFACE} + ... Interface Should Not Exist ${PE_BRIDGE_INTERFACE} ... AND - ... Create Interface ${PREEXISTING_BRIDGE_INTERFACE} + ... Create Interface ${PE_BRIDGE_INTERFACE} ... AND - ... Create NAD And Pod ${PREEXISTING_BRIDGE_NAD_YAML} ${PREEXISTING_BRIDGE_POD_YAML} + ... Create NAD And Pod ${PE_BRIDGE_NAD_YAML} ${PE_BRIDGE_POD_YAML} ... AND - ... Named Pod Should Be Ready ${PREEXISTING_BRIDGE_POD_NAME} ${NS} + ... Named Pod Should Be Ready ${PE_BRIDGE_POD_NAME} ${NAMESPACE} ... AND - ... Interface Should Exist ${PREEXISTING_BRIDGE_INTERFACE} + ... Interface Should Exist ${PE_BRIDGE_INTERFACE} ... AND - ... Set IP For Host Interface ${PREEXISTING_BRIDGE_INTERFACE} ${PREEXISTING_BRIDGE_IP} + ... Set IP For Host Interface ${PE_BRIDGE_INTERFACE} ${PE_BRIDGE_IP} - Connect To Pod Over Local Interface ${PREEXISTING_BRIDGE_POD_NAME} ${NS} ${PREEXISTING_BRIDGE_INTERFACE} + Connect To Pod Over Local Interface ${PE_BRIDGE_POD_NAME} ${NAMESPACE} ${PE_BRIDGE_INTERFACE} [Teardown] Cleanup Bridge Test - ... ${PREEXISTING_BRIDGE_NAD_YAML} - ... ${PREEXISTING_BRIDGE_POD_YAML} - ... ${PREEXISTING_BRIDGE_INTERFACE} + ... ${PE_BRIDGE_NAD_YAML} + ... ${PE_BRIDGE_POD_YAML} + ... ${PE_BRIDGE_INTERFACE} No Pre-Existing Bridge Interface [Documentation] Test verifies if Bridge CNI plugin will @@ -56,13 +54,13 @@ No Pre-Existing Bridge Interface ... AND ... Create NAD And Pod ${BRIDGE_NAD_YAML} ${BRIDGE_POD_YAML} ... AND - ... Named Pod Should Be Ready ${BRIDGE_POD_NAME} ${NS} + ... Named Pod Should Be Ready ${BRIDGE_POD_NAME} ${NAMESPACE} ... AND ... Interface Should Exist ${BRIDGE_INTERFACE} ... AND ... Set IP For Host Interface ${BRIDGE_INTERFACE} ${BRIDGE_IP} - Connect To Pod Over Local Interface ${BRIDGE_POD_NAME} ${NS} ${BRIDGE_INTERFACE} + Connect To Pod Over Local Interface ${BRIDGE_POD_NAME} ${NAMESPACE} ${BRIDGE_INTERFACE} [Teardown] Cleanup Bridge Test ... ${BRIDGE_NAD_YAML} @@ -71,30 +69,19 @@ No Pre-Existing Bridge Interface *** Keywords *** -Setup - [Documentation] Test suite setup - Check Required Env Variables - Login MicroShift Host - Setup Kubeconfig - -Teardown - [Documentation] Test suite teardown - Logout MicroShift Host - Remove Kubeconfig - Create NAD And Pod [Documentation] Creates provided NetworkAttachmentDefinition and Pod. [Arguments] ${nad} ${pod} - Oc Create -f ${nad} - Oc Create -f ${pod} + Oc Create -n ${NAMESPACE} -f ${nad} + Oc Create -n ${NAMESPACE} -f ${pod} Cleanup Bridge Test [Documentation] Removes provided NetworkAttachmentDefinition, Pod and network interface to allow for test rerun. [Arguments] ${nad} ${pod} ${if} Run Keyword And Continue On Failure - ... Oc Delete -f ${pod} + ... Oc Delete -n ${NAMESPACE} -f ${pod} Run Keyword And Continue On Failure - ... Oc Delete -f ${nad} + ... Oc Delete -n ${NAMESPACE} -f ${nad} Command Should Work ip link delete ${if} Connect To Pod Over Local Interface @@ -143,6 +130,6 @@ Get And Verify Pod Networks ${n}= Get Length ${networks} Should Be Equal As Integers ${n} 2 Should Be Equal As Strings ${networks}[0][name] ovn-kubernetes - Should Match ${networks}[1][name] default/bridge*-conf + Should Match ${networks}[1][name] ${NAMESPACE}/bridge*-conf RETURN ${networks}