You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests: Remove asserts on the value of local Vsock CID (#2975)
### Motivation:
We have some tests for our Vsock support that only run when we detect
the system supports Vsock. These weren't running in CI but, now we've
migrated CI to GitHub Actions, they can. In prototyping this though, I
discovered that one of our tests was too strict, and will fail for VMs
running on Hyper-V, which is the hypervisor used by GitHub actions.
Specifically, we have support for getting the local context ID by a
channel option. This is implemented by an ioctl, but the semantics of
the return value differ between the various Vsock transport kernel
modules:
- `virtio_transport`: returns the guest CID, which is a number greater
than `VMADDR_CID_HOST`, but less than `VMADDR_CID_ANY`, and returns
`VMADDR_CID_ANY` as an error.
- `vsock_loopback`: returns `VMADDR_CID_LOCAL` always.
- `vmci_transport`: returns the guest CID if the guest and host
transport are active; `VMADDR_CID_HOST` if only the host transport is
active; and `VMCI_INVALID_ID` otherwise, which happens to be the same
value as `VMADDR_CID_ANY`.
- `hyperv_transport`: returns `VMADDR_CID_ANY` always.
For this reason, we should probably remove any attempts to interpret the
validity of the value that comes back from the driver and users will
need to know what to do with it.
### Modifications:
- tests: Only run Vsock echo tests on Linux, when `vsock_loopback` is
loaded.
- tests: Remove asserts on the value of local Vsock CID.
- ci: Add pipeline that runs Vsock tests.
### Result:
- Vsock tests will no longer run unless `vsock_loopback` kernel module
is loaded.
- Vsock tests will no longer fail in Hyper-V VMs.
- Vsock tests will now run in CI.
(cherry picked from commit 64eb8bf)
0 commit comments