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

integration-test: Use veth pair instead of lo #915

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kevinji
Copy link
Contributor

@kevinji kevinji commented Mar 29, 2024

Fixes #422. I split the initial codegen commit out to #919 to clean this PR up.

I would like some help debugging the last 4 test failures:

---- tests::smoke::list_loaded_maps stdout ----
Entered network namespace aya-test-404672-4
thread 'tests::smoke::list_loaded_maps' panicked at test/integration-test/src/tests/smoke.rs:117:23:
called `Result::unwrap()` on an `Err` value: LoadError { io_error: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }, verifier_log:  }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Exited network namespace aya-test-404672-4

---- tests::smoke::list_loaded_programs stdout ----
Entered network namespace aya-test-404672-5
thread 'tests::smoke::list_loaded_programs' panicked at test/integration-test/src/tests/smoke.rs:84:23:
called `Result::unwrap()` on an `Err` value: LoadError { io_error: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }, verifier_log:  }
Exited network namespace aya-test-404672-5

---- tests::xdp::af_xdp stdout ----
Entered network namespace aya-test-404672-6
thread 'tests::xdp::af_xdp' panicked at test/integration-test/src/tests/xdp.rs:57:22:
called `Result::unwrap()` on an `Err` value: Errno(19: No such device)
Exited network namespace aya-test-404672-6

---- tests::xdp::cpumap_chain stdout ----
Entered network namespace aya-test-404672-7
thread 'tests::xdp::cpumap_chain' panicked at test/integration-test/src/tests/xdp.rs:182:5:
assertion `left == right` failed
  left: 0
 right: 1
Exited network namespace aya-test-404672-7

I'm not sure if introducing the network namespace caused behavior to now be different.

@kevinji kevinji changed the title integration-test: Use veth pair instead of lol integration-test: Use veth pair instead of lo Mar 29, 2024
Copy link

netlify bot commented Mar 29, 2024

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 7150c85
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/6619fe58f40ef200080c7215
😎 Deploy Preview https://deploy-preview-915--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mergify mergify bot added aya This is about aya (userspace) aya-obj Relating to the aya-obj crate test A PR that improves test cases or CI labels Mar 29, 2024
@kevinji kevinji force-pushed the create-veth-pair branch 2 times, most recently from 80a87e3 to 5c69049 Compare April 2, 2024 06:28
@mergify mergify bot added the aya-bpf This is about aya-bpf (kernel) label Apr 2, 2024
@kevinji kevinji force-pushed the create-veth-pair branch 22 times, most recently from e342d15 to d29ecc0 Compare April 2, 2024 20:03
@kevinji kevinji force-pushed the create-veth-pair branch 4 times, most recently from 841ba92 to 3e2225c Compare April 4, 2024 17:06
@astoycos astoycos mentioned this pull request Apr 5, 2024
@astoycos
Copy link
Member

astoycos commented Apr 5, 2024

Thanks for starting this @kevinji!! I'm going to start checking this out, Looks like we're still failing on macos though

Failed to set up veth pair (aya-test-1, aya-test-2): Not supported (os error 95)

@astoycos astoycos self-assigned this Apr 5, 2024
@astoycos
Copy link
Member

astoycos commented Apr 5, 2024

Additionally you consider using dummy interfaces here rather than veth pairs? (as mentioned in #422) ?

@kevinji
Copy link
Contributor Author

kevinji commented Apr 5, 2024

@astoycos I saw a comment in #561 suggesting veth pairs instead of dummies so that's why I went with this approach. I'll look into why the macOS VM tests are failing.

@astoycos
Copy link
Member

astoycos commented Apr 5, 2024

Ack just read that, sounds good thanks!

`netlink_add_veth_pair`, `netlink_delete_link`,
`netlink_set_link_down`, and `netlink_add_ip_addr` are used in setting
up and tearing down a veth pair for integration tests.
@kevinji kevinji force-pushed the create-veth-pair branch 11 times, most recently from 8ba5b71 to a9a704e Compare April 13, 2024 02:46
@kevinji
Copy link
Contributor Author

kevinji commented Apr 13, 2024

@astoycos I'm having trouble debugging the exact issue as I'm unable to get the QEMU setup working locally, so have been (slowly) trying to debug while pushing changes to CI.

My current hypothesis is that since the integration tests run as the /init process on initramfs, perhaps some veth module is not yet loaded which causes creation to fail. I ran the equivalent ip link command to try to create a veth and ran into similar issues. It's also possible that veth creation relies on something on the filesystem that it can't access for some reason during the /init script.

Copy link

mergify bot commented May 3, 2024

@kevinji, this pull request is now in conflict and requires a rebase.

@mergify mergify bot added the needs-rebase label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api/needs-review Makes an API change that needs review aya This is about aya (userspace) aya-bpf This is about aya-bpf (kernel) aya-obj Relating to the aya-obj crate needs-rebase test A PR that improves test cases or CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

integration-tests: Don't use lo interface for XDP, create some veths instead
2 participants