Skip to content

Commit

Permalink
Add ip override test for wireguard
Browse files Browse the repository at this point in the history
  • Loading branch information
hulthe committed Mar 27, 2024
1 parent 36a4dc3 commit 912c110
Show file tree
Hide file tree
Showing 4 changed files with 473 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mullvad-types/src/constraints/constraint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ impl<T> From<Option<T>> for Constraint<T> {
}
}

impl<T> From<T> for Constraint<T> {
fn from(value: T) -> Self {
Constraint::Only(value)
}
}

impl<T: Copy> Copy for Constraint<T> {}

impl<T: fmt::Debug + Clone + FromStr> FromStr for Constraint<T> {
Expand Down
12 changes: 12 additions & 0 deletions mullvad-types/src/relay_constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ impl RelaySettings {
}
}

impl From<CustomTunnelEndpoint> for RelaySettings {
fn from(value: CustomTunnelEndpoint) -> Self {
Self::CustomTunnelEndpoint(value)
}
}

impl From<RelayConstraints> for RelaySettings {
fn from(value: RelayConstraints) -> Self {
Self::Normal(value)
}
}

pub struct RelaySettingsFormatter<'a> {
pub settings: &'a RelaySettings,
pub custom_lists: &'a CustomListsSettings,
Expand Down
1 change: 1 addition & 0 deletions test/test-manager/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub mod config;
mod dns;
mod helpers;
mod install;
mod relay_ip_overrides;
mod settings;
mod software;
mod split_tunnel;
Expand Down
Loading

0 comments on commit 912c110

Please sign in to comment.