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

test: add uts for cni add function #3069

Merged
merged 9 commits into from
Oct 16, 2024
Merged

test: add uts for cni add function #3069

merged 9 commits into from
Oct 16, 2024

Conversation

QxBytes
Copy link
Contributor

@QxBytes QxBytes commented Oct 14, 2024

Reason for Change:

Adds unit tests to test that endpoint info struct creation is as expected based on args, cns/ipam invoker response, and network configuration for the following scenarios:

  • swiftv2 linux ipam response (infra + delegated) -> endpoint info
  • swiftv2 windows ipam response (infra + delegated) -> endpoint info
  • swiftv1 windows multitenancy dual nic ipam response (infra + infra) -> endpoint info
  • swiftv1 linux multitenancy (infra) ipam response -> endpoint info

Each scenario tests the Add method from ipam response until we call an EndpointCreate, given args, ipam response, and network configuration and ensure the endpoint info struct generated exactly matches what is expected (so all fields are checked) except for the interface name and endpoint id as they are nondeterministic identifiers generated during runtime.

Adds a check to ensure each endpoint info's Option and Data fields are separate.
Adds a check to ensure swiftv2 linux's endpoint info interface name is overwritten with the correct interface name.

Issue Fixed:

Requirements:

Notes:
This does not add tests for swiftv2 ib. It also does not explicitly add tests for swiftv1 non multitenancy scenarios as they are mostly covered by the multitenancy ones (singletenancy is just a single ipam response). This does not test anything that happens inside EndpointCreate.

@QxBytes QxBytes self-assigned this Oct 14, 2024
@QxBytes QxBytes added cni Related to CNI. ci Infra or tooling. labels Oct 14, 2024
@QxBytes QxBytes marked this pull request as ready for review October 14, 2024 20:57
@QxBytes QxBytes requested review from a team as code owners October 14, 2024 20:57
@QxBytes
Copy link
Contributor Author

QxBytes commented Oct 15, 2024

/azp run Azure Container Networking PR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@paulyufan2 paulyufan2 added this pull request to the merge queue Oct 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 16, 2024
@QxBytes QxBytes added this pull request to the merge queue Oct 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 16, 2024
@QxBytes QxBytes added this pull request to the merge queue Oct 16, 2024
Merged via the queue into master with commit 2e88813 Oct 16, 2024
101 of 104 checks passed
@QxBytes QxBytes deleted the alew/add-createpinfouts branch October 16, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Infra or tooling. cni Related to CNI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants