Skip to content

Commit

Permalink
fixup! tor-interface: add bootstrap test using pluggable transport
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Pospesel committed Jun 23, 2024
1 parent 8c30400 commit c4b5652
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/gosling/crates/tor-interface/tests/tor_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ fn test_legacy_bootstrap() -> anyhow::Result<()> {
#[cfg(feature = "legacy-tor-provider")]
fn test_legacy_pluggable_transport_bootstrap() -> anyhow::Result<()> {
let tor_path = which::which(format!("tor{}", std::env::consts::EXE_SUFFIX))?;
let mut working_directory_path = std::env::current_dir()?;
let mut working_directory_path = std::env::temp_dir();
working_directory_path.push("test_legacy_pluggable_transport_bootstrap");
let data_path = working_directory_path.clone();

Expand All @@ -389,6 +389,12 @@ fn test_legacy_pluggable_transport_bootstrap() -> anyhow::Result<()> {
return Ok(())
};

// create working directory if it is not present
if !std::path::Path::exists(&data_path) {
std::fs::create_dir(&data_path)?;
} else {
assert!(std::path::Path::is_dir(&data_path));
}
// symlink lyrebird to tor's working directory
let mut lyrebird_symlink = working_directory_path.clone();
lyrebird_symlink.push(lyrebird_bin.as_str());
Expand Down

0 comments on commit c4b5652

Please sign in to comment.