Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(not(target_os = "macos"))]

use easy_fuser::prelude::*;
use easy_fuser::templates::{DefaultFuseHandler, mirror_fs::*};

Expand Down Expand Up @@ -99,20 +97,20 @@ fn test_mirror_fs_operations() {
}

eprintln!("Unmounting filesystem...");
#[cfg(not(target_os = "freebsd"))]
{
let _ = std::process::Command::new("fusermount")
.arg("-u")
.arg(&mntpoint)
.status();
handle.join().unwrap();
}
#[cfg(not(any(target_os = "freebsd", target_os = "macos")))]
let _ = std::process::Command::new("fusermount")
.arg("-u")
.arg(&mntpoint)
.status();
#[cfg(any(target_os = "freebsd", target_os = "macos"))]
let _ = std::process::Command::new("umount")
.arg(&mntpoint)
.status();
#[cfg(not(any(target_os = "freebsd", target_os = "macos")))]
handle.join().unwrap();
#[cfg(target_os = "freebsd")] // TODO: explore why error: no such file or directory happens there
{
let _ = std::process::Command::new("umount")
.arg(&mntpoint)
.status();
let _ = handle.join();
}
let _ = handle.join();
#[cfg(target_os = "macos")] // TODO: why handle.join is blocking ?
drop(handle);
drop(mntpoint);
}
7 changes: 5 additions & 2 deletions tests/mount_mirror_fs.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(not(target_os = "macos"))]

use easy_fuser::prelude::*;
use easy_fuser::templates::{DefaultFuseHandler, mirror_fs::*};
use std::path::PathBuf;
Expand All @@ -20,10 +18,15 @@ fn mount_fs<FS: MirrorFsTrait>() {
let source_dir = PathBuf::from("/tmp/easy_fuser_mirror_fs_source");

// Create directories if they don't exist
#[cfg(not(any(target_os = "freebsd", target_os = "macos")))]
let _ = std::process::Command::new("fusermount")
.arg("-u")
.arg(&mount_dir)
.status();
#[cfg(any(target_os = "freebsd", target_os = "macos"))]
let _ = std::process::Command::new("umount")
.arg(&mount_dir)
.status();
let _ = std::fs::create_dir(&mount_dir);
if !source_dir.exists() {
let _ = std::fs::create_dir(&source_dir);
Expand Down
30 changes: 14 additions & 16 deletions tests/offset_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(not(target_os = "macos"))]

use easy_fuser::prelude::*;
use easy_fuser::templates::{DefaultFuseHandler, mirror_fs::*};

Expand Down Expand Up @@ -97,20 +95,20 @@ fn test_mirror_fs_file_offsets() {
}

eprintln!("Unmounting filesystem...");
#[cfg(not(target_os = "freebsd"))]
{
let _ = std::process::Command::new("fusermount")
.arg("-u")
.arg(&mntpoint)
.status();
handle.join().unwrap();
}
#[cfg(not(any(target_os = "freebsd", target_os = "macos")))]
let _ = std::process::Command::new("fusermount")
.arg("-u")
.arg(&mntpoint)
.status();
#[cfg(any(target_os = "freebsd", target_os = "macos"))]
let _ = std::process::Command::new("umount")
.arg(&mntpoint)
.status();
#[cfg(not(any(target_os = "freebsd", target_os = "macos")))]
handle.join().unwrap();
#[cfg(target_os = "freebsd")] // TODO: explore why error: no such file or directory happens there
{
let _ = std::process::Command::new("umount")
.arg(&mntpoint)
.status();
let _ = handle.join();
}
let _ = handle.join();
#[cfg(target_os = "macos")] // TODO: why handle.join is blocking ?
drop(handle);
drop(mntpoint);
}
31 changes: 14 additions & 17 deletions tests/test_recursion.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(not(target_os = "macos"))]

use easy_fuser::prelude::*;
use easy_fuser::templates::{DefaultFuseHandler, mirror_fs::*};

Expand Down Expand Up @@ -77,21 +75,20 @@ fn test_mirror_fs_recursion() {
println!("Test passed: No infinite recursion detected.");

eprintln!("Unmounting filesystem...");
#[cfg(not(target_os = "freebsd"))]
{
let _ = std::process::Command::new("fusermount")
.arg("-u")
.arg(&mntpoint)
.status();
handle.join().unwrap();
}
#[cfg(not(any(target_os = "freebsd", target_os = "macos")))]
let _ = std::process::Command::new("fusermount")
.arg("-u")
.arg(&mntpoint)
.status();
#[cfg(any(target_os = "freebsd", target_os = "macos"))]
let _ = std::process::Command::new("umount")
.arg(&mntpoint)
.status();
#[cfg(not(any(target_os = "freebsd", target_os = "macos")))]
handle.join().unwrap();
#[cfg(target_os = "freebsd")] // TODO: explore why error: no such file or directory happens there
{
let _ = std::process::Command::new("umount")
.arg(&mntpoint)
.status();
let _ = handle.join();
}
let _ = handle.join();
#[cfg(target_os = "macos")] // TODO: why handle.join is blocking ?
drop(handle);
drop(mntpoint);

}