Skip to content

Commit

Permalink
Implement find_cache_traces on Window & macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusPettersson98 committed Nov 27, 2023
1 parent 6f81224 commit 29e1974
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test-runner/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ pub fn find_traces() -> Result<Vec<AppTrace>, Error> {
Error::Syscall
})?;

let caches = find_cache_traces()?;
let mut traces = vec![
Path::new(r"C:\Program Files\Mullvad VPN"),
// NOTE: This only works as of `499c06decda37dc639e5f` in the Mullvad app.
// Older builds have no way of silently fully uninstalling the app.
Path::new(r"C:\ProgramData\Mullvad VPN"),
// NOTE: Works as of `4116ebc` (Mullvad app).
&settings_dir,
&caches,
];

filter_non_existent_paths(&mut traces)?;
Expand Down Expand Up @@ -64,7 +66,6 @@ pub fn find_traces() -> Result<Vec<AppTrace>, Error> {
.collect())
}

#[cfg(target_os = "linux")]
pub fn find_cache_traces() -> Result<PathBuf, Error> {
mullvad_paths::cache_dir().map_err(|error| Error::FileSystem(error.to_string()))
}
Expand All @@ -74,10 +75,11 @@ pub fn find_traces() -> Result<Vec<AppTrace>, Error> {
// TODO: Check GUI data
// TODO: Check temp data

let caches = find_cache_traces()?;
let mut traces = vec![
Path::new(r"/Applications/Mullvad VPN.app/"),
Path::new(r"/var/log/mullvad-vpn/"),
Path::new(r"/Library/Caches/mullvad-vpn/"),
&caches,
// management interface socket
Path::new(r"/var/run/mullvad-vpn"),
// launch daemon
Expand Down

0 comments on commit 29e1974

Please sign in to comment.