-
Notifications
You must be signed in to change notification settings - Fork 349
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
Migrate testing repo #5189
Migrate testing repo #5189
Conversation
dbfe49b
to
c60bb86
Compare
354c7a4
to
e33dd83
Compare
66215b3
to
42e0c49
Compare
13e8f40
to
c9c0c55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 69 files reviewed, 1 unresolved discussion
test/BUILD_OS_IMAGE.md
line 27 at r1 (raw file):
## Dependencies to install in the image `xvfb` must be installed on the guest system. You will also need
xvfb
and wireguard-tools
are installed over SSH, so this is only true for the legacy method. The other packages are assumed to exist, though.
test/BUILD_OS_IMAGE.md
line 40 at r1 (raw file):
```bash dnf install libnss3 libgbm1 libasound2 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-0 wireguard-tools xorg-x11-server-Xvfb
Is this list really correct? I'm surprised the packages are named exactly the same on Fedora.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 69 of 69 files at r1, all commit messages.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @dlon)
test/ci-runtests.sh
line 26 at r1 (raw file):
if [[ "$#" -lt 1 ]]; then print_usage
No need for function, just print "usage: $0 TEST_OS"
test/test-manager/src/tests/account.rs
line 180 at r1 (raw file):
// Ensure that the tunnel state transitions to "error". Fail if it transitions to some other // state. let new_state = next_state.await?;
No need to put future into next_state
, just await it here?
test/test-manager/src/tests/install.rs
line 118 at r1 (raw file):
// NOTE: Many packets will likely be observed for API traffic. Rather than filtering all // of those specifically, simply fail if our probes are observed. packet.source.ip() == guest_ip && packet.destination.ip() == inet_destination.ip()
It seems nicer to have a whitelist for API endpoints rather than to just check if our specific pings are getting out. Since this functionality already existed why remove it? Hard to maintain?
test/test-manager/src/tests/tunnel.rs
line 70 at r1 (raw file):
log::info!("Test whether tunnel traffic works"); let geoip_lookup = geoip_lookup_with_retries(&rpc).await.unwrap(); assert!(geoip_lookup.mullvad_exit_ip, "Exit ip is not from Mullvad");
This seems to be reused often enough to warrant a helper function. Seems especially good since we may want to add other sanity checks to a working internet in the future.
test/test-manager/src/tests/ui.rs
line 90 at r1 (raw file):
// Set relays to use log::info!("Select relay"); let relay_filter = |relay: &types::Relay| {
Nit: I feel like separating the closure into it's own variable reduces readability. What is nice about having the closure right in the function call is that I know at first glance that 1) the closure and the function call definitely relate to each other and 2) the closure will never be used in the future
Obviously not a problem for this PR
test/test-manager/src/tests/ui.rs
line 91 at r1 (raw file):
log::info!("Select relay"); let relay_filter = |relay: &types::Relay| { relay.active && relay.endpoint_type == i32::from(types::relay::RelayType::Wireguard)
Is there a reason we only pick wireguard relays here?
test/test-manager/src/vm/network/macos.rs
line 61 at r1 (raw file):
if let Some(address) = addr.address.as_ref().and_then(|addr| addr.as_sockaddr_in()) { let interface_ip = *SocketAddrV4::from(*address).ip(); if interface_ip == NON_TUN_GATEWAY {
If Tart assigns this, how come this works? Is it always the same atm?
test/test-manager/src/vm/network/macos.rs
line 74 at r1 (raw file):
async fn enable_forwarding() -> Result<()> { // Check if forwarding is enabled
Why check if forwarding is enabled if we won't act on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 61 of 69 files reviewed, 6 unresolved discussions (waiting on @Jontified)
test/ci-runtests.sh
line 26 at r1 (raw file):
Previously, Jontified wrote…
No need for function, just print
"usage: $0 TEST_OS"
Done.
test/test-manager/src/tests/account.rs
line 180 at r1 (raw file):
Previously, Jontified wrote…
No need to put future into
next_state
, just await it here?
It's saved so that we can print it when the assertion fails.
test/test-manager/src/tests/install.rs
line 118 at r1 (raw file):
Previously, Jontified wrote…
It seems nicer to have a whitelist for API endpoints rather than to just check if our specific pings are getting out. Since this functionality already existed why remove it? Hard to maintain?
That would be nicer, yeah. It's harder to do now that we only use the CLI for the old client. We might eventually want to send relays.json
from the guest to the host and parse it, but, for now, I think this is fine.
test/test-manager/src/tests/tunnel.rs
line 70 at r1 (raw file):
Previously, Jontified wrote…
This seems to be reused often enough to warrant a helper function. Seems especially good since we may want to add other sanity checks to a working internet in the future.
Done.
test/test-manager/src/tests/ui.rs
line 90 at r1 (raw file):
Previously, Jontified wrote…
Nit: I feel like separating the closure into it's own variable reduces readability. What is nice about having the closure right in the function call is that I know at first glance that 1) the closure and the function call definitely relate to each other and 2) the closure will never be used in the future
Obviously not a problem for this PR
Done.
test/test-manager/src/tests/ui.rs
line 91 at r1 (raw file):
Previously, Jontified wrote…
Is there a reason we only pick wireguard relays here?
I've added an explanation in a comment now.
test/test-manager/src/vm/network/macos.rs
line 61 at r1 (raw file):
Previously, Jontified wrote…
If Tart assigns this, how come this works? Is it always the same atm?
It's a horrible assumption that seems to hold true, yeah.
test/test-manager/src/vm/network/macos.rs
line 74 at r1 (raw file):
Previously, Jontified wrote…
Why check if forwarding is enabled if we won't act on this?
Good find. Removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 8 of 8 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion
21a86af
to
8b9a4b7
Compare
Co-authored-by: Jonathan <[email protected]> Co-authored-by: Markus Pettersson <[email protected]>
Mostly a move of the old repository. Of the changes, the important ones are:
ci-runtests.sh
, the version under test is alwaysHEAD
. The correct way to runci-runtests.sh
for an arbitrary commit, tag, or release is to check out that commit first and just run the script. This makes it easy to make changes without breaking tests for older commits/versions.This change is