This commit is contained in:
Scott E. Graves 2024-10-24 20:08:40 -05:00
parent 18d05ca635
commit b5cf2de900

View File

@ -189,23 +189,15 @@ public:
static void execute_mount() { static void execute_mount() {
auto mount_cmd = "./repertory -dd \"" + config->get_data_directory() + auto mount_cmd = "./repertory -dd \"" + config->get_data_directory() +
"\"" + " " + utils::string::join(drive_args, ' '); "\"" + " " + utils::string::join(drive_args, ' ');
std::cout << "mount command: " << mount_cmd << std::endl;
ASSERT_EQ(0, system(mount_cmd.c_str())); ASSERT_EQ(0, system(mount_cmd.c_str()));
std::this_thread::sleep_for(5s); std::this_thread::sleep_for(5s);
ASSERT_TRUE(utils::file::directory{mount_location}.exists()); ASSERT_TRUE(utils::file::directory{mount_location}.exists());
} }
static void execute_unmount() { static void execute_unmount() {
#if FUSE_USE_VERSION >= 30
auto unmount_cmd = "fusermount3 -u \"" + mount_location + "\"";
#else
auto unmount_cmd = "fusermount -u \"" + mount_location + "\"";
#endif
auto unmounted{false}; auto unmounted{false};
for (int i = 0; not unmounted && (i < 50); i++) { for (int i = 0; not unmounted && (i < 50); i++) {
std::cout << "unmount command: " << unmount_cmd << std::endl; auto res = fuse_base::unmount(mount_location);
auto res = system(unmount_cmd.c_str());
unmounted = res == 0; unmounted = res == 0;
ASSERT_EQ(0, res); ASSERT_EQ(0, res);
if (not unmounted) { if (not unmounted) {