Skip to content
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

USHIFT-2226: Test Multus - Bridge CNI #3137

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

pmtk
Copy link
Member

@pmtk pmtk commented Mar 11, 2024

No description provided.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 11, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 11, 2024

@pmtk: This pull request references USHIFT-2226 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.16.0" version, but no target version was set.

In response to this:

/cc

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 11, 2024
Copy link
Contributor

openshift-ci bot commented Mar 11, 2024

@pmtk: GitHub didn't allow me to request PR reviews from the following users: pmtk.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 11, 2024
@pmtk
Copy link
Member Author

pmtk commented Mar 12, 2024

/test ?

Copy link
Contributor

openshift-ci bot commented Mar 12, 2024

@pmtk: The following commands are available to trigger required jobs:

  • /test images
  • /test metal-periodic-test
  • /test metal-periodic-test-arm
  • /test microshift-metal-cache
  • /test microshift-metal-cache-arm
  • /test microshift-metal-tests
  • /test microshift-metal-tests-arm
  • /test ocp-conformance-rhel-eus
  • /test ocp-conformance-rhel-eus-arm
  • /test test-rpm
  • /test test-unit
  • /test verify

The following commands are available to trigger optional jobs:

  • /test test-rebase

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-microshift-main-images
  • pull-ci-openshift-microshift-main-microshift-metal-tests
  • pull-ci-openshift-microshift-main-microshift-metal-tests-arm
  • pull-ci-openshift-microshift-main-test-unit
  • pull-ci-openshift-microshift-main-verify

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@pmtk
Copy link
Member Author

pmtk commented Mar 12, 2024

/test metal-periodic-test metal-periodic-test-arm

@pmtk pmtk changed the title WIP USHIFT-2226: Test Multus - Bridge CNI USHIFT-2226: Test Multus - Bridge CNI Mar 12, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 12, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 12, 2024

@pmtk: This pull request references USHIFT-2226 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.16.0" version, but no target version was set.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@pmtk
Copy link
Member Author

pmtk commented Mar 12, 2024

Copy link
Contributor

@dhellmann dhellmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. One suggestion about a potential race condition, but I see you're trying to work around that so I'll leave it up to you and other reviewers to decide how risky it is.

... work correctly if there is no pre-existing bridge
... interface - it needs to be created.
[Setup] Run Keywords
... Make Sure Interface Does Not Exist ${BRIDGE_INTERFACE}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the same interface for both tests might be a little brittle, especially if we find a race condition. Can we use separate interfaces to avoid that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, though it'll need two (or single templated) NetworkAttachmentDefinition and Pod manifests.
We'll have similar problem with ipvlan / macvlan tests, because:

A single master interface can not be enslaved by both macvlan and ipvlan. (src)

Perhaps we want to add more interface to the VM to avoid that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we need more than 2? The bridge test doesn't need a new one, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, bridge plugin doesn't have this exclusivity rule. Other solution is to (probably) reboot the host after the test, so the other *vlan can enslave main interface

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which approach seems like it will be most reliable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have data on that, but adding two nics will be faster (if we keep random order of the tests, then we'll have two reboots).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the extra NICs sounds like a good place to start, then.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made changes to the bridge tests. I decided to duplicate the files as we don't have any templating of such sort yet in RF, so it felt like over-engineering and waste of time.

Regarding the two interfaces for macvlan/ipvlan - that's for another PR(s).

Copy link
Contributor

@dhellmann dhellmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've addressed my comments, so I'm happy with this version. I had one philosophical question inline, but it shouldn't block merging this.

You have listed other reviewers, so I'll wait to lgtm to give them a chance to review it.

*** Test Cases ***
Pre-Existing Bridge Interface
[Documentation] Test verifies if Bridge CNI plugin will work correctly with pre-existing interface.
[Setup] Run Keywords
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to change it, but I'm curious why there are so many individual keywords in the setup for this case. Why not include them in the test body, or write a separate keyword?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not include them in the test body

I was being literal - test setup in [Setup]

or write a separate keyword?

I didn't like how this requires a jump to different location in the file - this way everything is single place.

So I think I just felt like it :D It's not perfect though, this keyword (in this or future PR) is maxing out the length, but separate keyword was "context jump" and writing general function for both Bridge tests was quite ugly and required some mental processing on what happens with which arguments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can definitely be hard to find a balance between inline and separate code blocks. That max keyword aspect to the linter is a nudge towards what the linter author thought we should be doing, but there have definitely been cases where we overrode the rule. Maybe we should have written more of those cases in Python? I don't know. As I said, there's no need to change anything here, I was just curious about the evolution of the code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have written more of those cases in Python?

Perhaps, but python function don't support so great support for log.html. We'll see in the future

@s1061123
Copy link

Regarding of CNI config in net-attach-def, it looks good to me.

@pliurh
Copy link
Contributor

pliurh commented Mar 26, 2024

LGTM

- 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"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add "sleep" here not to burn CPU?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't spin furiously - nc blocks until a client arrives, so the loop has a many iterations as many GETs.

- 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"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add "sleep" here not to burn CPU?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't spin furiously - nc blocks until a client arrives, so the loop has a many iterations as many GETs.

${PREEXISTING_BRIDGE_POD_NAME} test-bridge-preexisting
${PREEXISTING_BRIDGE_IP} 10.10.1.10/24

${NS} default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a special reason we're not using a dedicated namespace for this test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, let me have a look

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

... Oc Delete -f ${nad}
Command Should Work ip link delete ${if}

Curl Pod Over Local Interface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Curl is an implementation detail. Should we call it Connect Pod or something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Connect To Pod Over Local Interface? Because in future PRs there's Curl Pod From The Hypervisor so we need to be more specific

Comment on lines 110 to 116
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels as if we would benefit from Command Should Not Work keyword.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@ggiguash
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 26, 2024
Copy link
Contributor

openshift-ci bot commented Mar 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ggiguash, pmtk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

openshift-ci bot commented Mar 26, 2024

@pmtk: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit ec8258e into openshift:main Mar 26, 2024
6 checks passed
@pmtk pmtk deleted the multus/test/bridge branch March 26, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants