Skip to content

Commit

Permalink
Improve IP override testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Serock3 authored and dlon committed Aug 22, 2024
1 parent b42d608 commit dfe166d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mullvad-relay-selector/tests/relay_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,11 @@ fn test_selecting_wireguard_over_shadowsocks_extra_ips() {
match relay {
GetRelay::Wireguard {
obfuscator: Some(SelectedObfuscator { config: ObfuscatorConfig::Shadowsocks { endpoint }, .. }),
inner: WireguardConfig::Singlehop { .. },
inner: WireguardConfig::Singlehop { exit },
..
} => {
assert!(!exit.overridden_ipv4);
assert!(!exit.overridden_ipv6);
assert!(SHADOWSOCKS_RELAY_EXTRA_ADDRS.contains(&endpoint.ip()), "{} is not an additional IP", endpoint);
}
wrong_relay => panic!(
Expand Down Expand Up @@ -849,6 +851,7 @@ fn test_selecting_wireguard_ignore_extra_ips_override_v4() {
..
} => {
assert!(exit.overridden_ipv4);
assert!(!exit.overridden_ipv6);
assert_eq!(endpoint.ip(), IpAddr::from(OVERRIDE_IPV4));
}
wrong_relay => panic!(
Expand Down Expand Up @@ -887,9 +890,11 @@ fn test_selecting_wireguard_ignore_extra_ips_override_v6() {
match relay {
GetRelay::Wireguard {
obfuscator: Some(SelectedObfuscator { config: ObfuscatorConfig::Shadowsocks { endpoint }, .. }),
inner: WireguardConfig::Singlehop { .. },
inner: WireguardConfig::Singlehop { exit },
..
} => {
assert!(exit.overridden_ipv6);
assert!(!exit.overridden_ipv4);
assert_eq!(endpoint.ip(), IpAddr::from(OVERRIDE_IPV6));
}
wrong_relay => panic!(
Expand Down

0 comments on commit dfe166d

Please sign in to comment.