Skip to content

Commit 1539760

Browse files
committed
Use new reset_settings
1 parent da1a74b commit 1539760

File tree

1 file changed

+4
-101
lines changed
  • test/test-manager/src/tests

1 file changed

+4
-101
lines changed

test/test-manager/src/tests/mod.rs

+4-101
Original file line numberDiff line numberDiff line change
@@ -91,111 +91,14 @@ pub async fn prepare_daemon(
9191
.context("Failed to restart daemon")?;
9292

9393
helpers::ensure_logged_in(&mut mullvad_client).await?;
94-
helpers::disconnect_and_wait(&mut mullvad_client)
95-
.await
96-
.context("Failed to disconnect daemon after test")?;
97-
98-
// Bring all the settings into scope so we remember to reset them.
99-
let mullvad_types::settings::Settings {
100-
relay_settings,
101-
bridge_settings,
102-
obfuscation_settings,
103-
bridge_state,
104-
custom_lists,
105-
api_access_methods,
106-
allow_lan,
107-
block_when_disconnected,
108-
auto_connect,
109-
tunnel_options,
110-
relay_overrides,
111-
show_beta_releases,
112-
#[cfg(target_os = "macos")]
113-
split_tunnel: _,
114-
settings_version: _, // N/A
115-
} = Default::default();
116-
117-
mullvad_client
118-
.clear_custom_access_methods()
119-
.await
120-
.context("Could not clear custom api access methods")?;
121-
for access_method in api_access_methods.iter() {
122-
mullvad_client
123-
.update_access_method(access_method.clone())
124-
.await
125-
.context("Could not reset default access method")?;
126-
}
127-
128-
mullvad_client
129-
.set_relay_settings(relay_settings)
130-
.await
131-
.context("Could not set relay settings")?;
132-
133-
let _ = relay_overrides;
134-
mullvad_client
135-
.clear_all_relay_overrides()
136-
.await
137-
.context("Could not set relay overrides")?;
138-
139-
mullvad_client
140-
.set_auto_connect(auto_connect)
141-
.await
142-
.context("Could not set auto connect in cleanup")?;
143-
144-
mullvad_client
145-
.set_allow_lan(allow_lan)
146-
.await
147-
.context("Could not set allow lan in cleanup")?;
148-
149-
mullvad_client
150-
.set_show_beta_releases(show_beta_releases)
151-
.await
152-
.context("Could not set show beta releases in cleanup")?;
153-
154-
mullvad_client
155-
.set_bridge_state(bridge_state)
156-
.await
157-
.context("Could not set bridge state in cleanup")?;
158-
159-
mullvad_client
160-
.set_bridge_settings(bridge_settings.clone())
161-
.await
162-
.context("Could not set bridge settings in cleanup")?;
163-
164-
mullvad_client
165-
.set_obfuscation_settings(obfuscation_settings.clone())
166-
.await
167-
.context("Could set obfuscation settings in cleanup")?;
168-
169-
mullvad_client
170-
.set_block_when_disconnected(block_when_disconnected)
171-
.await
172-
.context("Could not set block when disconnected setting in cleanup")?;
173-
174-
mullvad_client
175-
.clear_split_tunnel_apps()
176-
.await
177-
.context("Could not clear split tunnel apps in cleanup")?;
178-
179-
mullvad_client
180-
.clear_split_tunnel_processes()
181-
.await
182-
.context("Could not clear split tunnel processes in cleanup")?;
183-
184-
mullvad_client
185-
.set_dns_options(tunnel_options.dns_options.clone())
186-
.await
187-
.context("Could not clear dns options in cleanup")?;
18894

18995
mullvad_client
190-
.set_quantum_resistant_tunnel(tunnel_options.wireguard.quantum_resistant)
96+
.reset_settings()
19197
.await
192-
.context("Could not clear PQ options in cleanup")?;
193-
194-
let _ = custom_lists;
195-
mullvad_client
196-
.clear_custom_lists()
98+
.context("Failed to reset settings")?;
99+
helpers::disconnect_and_wait(&mut mullvad_client)
197100
.await
198-
.context("Could not remove custom list")?;
101+
.context("Failed to disconnect daemon after test")?;
199102

200103
Ok(())
201104
}

0 commit comments

Comments
 (0)