Skip to content

Add test for connectivity between localnet VMs #464

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

Merged

Conversation

sbahar619
Copy link
Contributor

@sbahar619 sbahar619 commented Mar 13, 2025

Short description:

Add test for connectivity between localnet VMs

More details:

Add test for connectivity between localnet VMs

Introduced a new test to verify connectivity between VMs on the
localnet network. This test ensures that VMs within the localnet
network have connectivity.
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:

https://issues.redhat.com/browse/CNV-55290

@sbahar619
Copy link
Contributor Author

/wip

@ghost
Copy link

ghost commented Mar 13, 2025

Report bugs in Issues

The following are automatically added:

  • Add reviewers from OWNER file (in the root of the repository) under reviewers section.
  • Set PR size label.
  • New issue is created for the PR. (Closed when PR is merged/closed)
  • Run pre-commit if .pre-commit-config.yaml exists in the repo.

Available user actions:

  • To mark PR as WIP comment /wip to the PR, To remove it from the PR comment /wip cancel to the PR.
  • To block merging of PR comment /hold, To un-block merging of PR comment /hold cancel.
  • To mark PR as verified comment /verified to the PR, to un-verify comment /verified cancel to the PR.
    verified label removed on each new commit push.
  • To cherry pick a merged PR comment /cherry-pick <target branch to cherry-pick to> in the PR.
    • Multiple target branches can be cherry-picked, separated by spaces. (/cherry-pick branch1 branch2)
    • Cherry-pick will be started when PR is merged
  • To build and push container image command /build-and-push-container in the PR (tag will be the PR number).
    • You can add extra args to the Podman build command
      • Example: /build-and-push-container --build-arg OPENSHIFT_PYTHON_WRAPPER_COMMIT=<commit_hash>
  • To add a label by comment use /<label name>, to remove, use /<label name> cancel
  • To assign reviewers based on OWNERS file use /assign-reviewers
  • To check if PR can be merged use /check-can-merge
  • to assign reviewer to PR use /assign-reviewer @<reviewer>
Supported /retest check runs
  • /retest tox: Retest tox
  • /retest build-container: Retest build-container
  • /retest all: Retest all
Supported labels
  • hold
  • verified
  • wip
  • lgtm

@ghost ghost requested a review from duyanyan March 13, 2025 09:53
@ghost ghost added the branch-main label Mar 13, 2025
@ghost ghost added the wip label Mar 13, 2025
@ghost ghost requested a review from RoniKishner March 13, 2025 09:53
@ghost ghost changed the title Add test for connectivity between localnet VMs WIP: Add test for connectivity between localnet VMs Mar 13, 2025
@sbahar619
Copy link
Contributor Author

/verified

@ghost ghost added the verified label Apr 30, 2025
Copy link
Contributor

@EdDev EdDev left a comment

Choose a reason for hiding this comment

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

/approve

@ghost ghost added the lgtm-EdDev label Apr 30, 2025
@EdDev
Copy link
Contributor

EdDev commented Apr 30, 2025

/approve

@ghost ghost added the approved-EdDev label Apr 30, 2025
Copy link
Contributor

@Anatw Anatw left a comment

Choose a reason for hiding this comment

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

Thank you!

@EdDev
Copy link
Contributor

EdDev commented May 4, 2025

/check-can-merge

@vsibirsk
Copy link
Collaborator

vsibirsk commented May 4, 2025

/approve

@sbahar619
Copy link
Contributor Author

/check-can-merge

1 similar comment
@sbahar619
Copy link
Contributor Author

/check-can-merge

@vsibirsk vsibirsk disabled auto-merge May 4, 2025 10:21
@vsibirsk vsibirsk merged commit f22bb6c into RedHatQE:main May 4, 2025
7 checks passed
@ghost
Copy link

ghost commented May 4, 2025

Successfully removed PR tag: quay.io/openshift-cnv/openshift-virtualization-tests:pr-464.

@sbahar619
Copy link
Contributor Author

/cherry-pick cnv-4.18

sbahar619 added a commit to sbahar619/openshift-virtualization-tests that referenced this pull request May 12, 2025
* Ensure boot disk is first in list of VM disks and volumes

The default boot image must be the first disk for correct VM behavior.
Changed disk and volume insertion to use insert instead of append
so the boot image appears first in the disks and volumes lists.

Signed-off-by: Shahaf Bahar <[email protected]>

* Add test for connectivity between localnet VMs

Introduced a new test to verify connectivity between VMs on the
localnet network. This test ensures that VMs within the localnet
network have connectivity.

Signed-off-by: Shahaf Bahar <[email protected]>

---------

Signed-off-by: Shahaf Bahar <[email protected]>
sbahar619 added a commit to sbahar619/openshift-virtualization-tests that referenced this pull request May 15, 2025
* Ensure boot disk is first in list of VM disks and volumes

The default boot image must be the first disk for correct VM behavior.
Changed disk and volume insertion to use insert instead of append
so the boot image appears first in the disks and volumes lists.

Signed-off-by: Shahaf Bahar <[email protected]>

* Add test for connectivity between localnet VMs

Introduced a new test to verify connectivity between VMs on the
localnet network. This test ensures that VMs within the localnet
network have connectivity.

Signed-off-by: Shahaf Bahar <[email protected]>

---------

Signed-off-by: Shahaf Bahar <[email protected]>
vsibirsk pushed a commit that referenced this pull request May 15, 2025
* Utilities - Add NodeNetworkConfigurationPolicy resource to libs/net (#218)

- As part of the initiative to create simpler resources and reduce
dependency, this PR introduces a new NNCP resource in the network's team libs
directory.
- The new NNCP is used in an existing test - test_linux_bridge_functionality.

Signed-off-by: Anat Wax <[email protected]>

* tests, net, libs, nncp: On update/patch, assure correct status update (#733)

* tests, network: Cover tests.network.libs with mypy validation

Signed-off-by: Edward Haas <[email protected]>

* tests, net, libs, nncp: On update/patch, assure correct status update

When mutating an existing NNCP object, it is common to wait for a
condition status of success (condition type "Available").
However, it has been observed or bare-metal clusters that the observed
condition is the previous one and is not reflecting the actual state
after the spec update/patch.

In order to handle these cases, the condition timestamp is used to
assure it has been updated post the change.

Other alternatives have been found unsafe, like the option of waiting
for an intermediate state (e.g. "progressing"). It is unsafe because the
state is in transition and that can be quicker than the sampling
performed by the test tools.

The current NNCP object updates the spec only when performing the
clean-up step (on teardown). At that step the previous created
interfaces are being removed.
Any future exposure of update/patch requires this technique to assure
successful operation.

Signed-off-by: Edward Haas <[email protected]>

* tests, net, libs, nncp: Relocate the resource patching at clean_up

The clean_up method is used to perform teardown operations for any
resource. For the NNCP it is used to revert the interfaces additions
(by deleting them). It makes sense to place the update/patch call at the
cleanup upper level so any other future changes will be able to re-use
the same single patch operation.

Signed-off-by: Edward Haas <[email protected]>

* tests, net, libs, nncp: Drop the condition class and fix func signature

Signed-off-by: Edward Haas <[email protected]>

---------

Signed-off-by: Edward Haas <[email protected]>

* tests, net, libs: Introduce network cloud-init data structure (#754)

* tests, net, libs: Introduce network cloud-init data structure

Introduce a new data structure for network cloud-init.
It is aimed to replace the existing dict-based configuration.

Usage example:
```
from tests.network.libs import cloudinit

nd = cloudinit.NetworkData(ethernets={
    "eth0": EthernetDevice(
        dhcp4=False,
        addresses=["1.1.1.1/24", "d10:0:2::2"],
        gateway6="d10:0:2::1",
    )
})

nd_yaml = yaml.safe_dump(cloudinit.todict(netdata=nd), sort_keys=False)
cloudinit_dict = cloudinit.cloudinit(netdata=nd)
```

Signed-off-by: Edward Haas <[email protected]>

* tests, net, bond: First use of the new structured cloud-init network

Signed-off-by: Edward Haas <[email protected]>

* tests, net, libs: Introduce 'apimachinery' module

The new module is aimed to contain API related helpers.
First candidate: the dict normalization which is used to translate a
dataclass to a dict.

Signed-off-by: Edward Haas <[email protected]>

---------

Signed-off-by: Edward Haas <[email protected]>

* tests, net, libs, nncp:  Assure NNCP resource exists, status & conditions absense is treated correctly. (#876)

* tests, net, libs, nncp: Assure resource is waited for on deployment

Currently, the default resource deployment is not waiting for the
resource to appear. We are interested for the NNCP resources to assure
that the resource exists before we continue.

This change assures that the `self.instance` exists and with it the
`status`.

Signed-off-by: Edward Haas <[email protected]>

* tests, net, libs, nncp: Do not assume NNCP 'status' & 'conditions' exist

On NNCP resource creation, the status and/or conditions may not yet be
populated. Assure such scenarios are treated.

Signed-off-by: Edward Haas <[email protected]>

---------

Signed-off-by: Edward Haas <[email protected]>

* Add test for connectivity between localnet VMs (#464)

* Ensure boot disk is first in list of VM disks and volumes

The default boot image must be the first disk for correct VM behavior.
Changed disk and volume insertion to use insert instead of append
so the boot image appears first in the disks and volumes lists.

Signed-off-by: Shahaf Bahar <[email protected]>

* Add test for connectivity between localnet VMs

Introduced a new test to verify connectivity between VMs on the
localnet network. This test ensures that VMs within the localnet
network have connectivity.

Signed-off-by: Shahaf Bahar <[email protected]>

---------

Signed-off-by: Shahaf Bahar <[email protected]>

---------

Signed-off-by: Anat Wax <[email protected]>
Signed-off-by: Edward Haas <[email protected]>
Signed-off-by: Shahaf Bahar <[email protected]>
Co-authored-by: ‪Anat Wax <[email protected]>
Co-authored-by: Edward Haas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants