From ff13142093d8c6f5a705d72b7278db13c532323a Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Tue, 29 Oct 2024 14:45:05 -0500 Subject: [PATCH] winfsp unit tests and fixes --- .../include/fixtures/winfsp_fixture.hpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp b/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp index 5e4cd951..d91bb193 100644 --- a/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp +++ b/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp @@ -64,7 +64,11 @@ protected: "winfsp_test", std::to_string(static_cast(provider_t::type)), }); - mount_location = "U:"; + + ASSERT_TRUE(utils::file::directory(test_directory).remove_recursively()); + + mount_location = utils::path::combine(test_directory, {"mount"}); + ASSERT_TRUE(utils::file::directory(mount_location).create_directory()); cfg_directory = utils::path::combine(test_directory, {"cfg"}); ASSERT_TRUE(utils::file::directory(cfg_directory).create_directory()); @@ -83,7 +87,6 @@ protected: config->set_s3_config(src_cfg.get_s3_config()); } - comm = std::make_unique(config->get_s3_config()); drive_args = std::vector({ "-s3", "-na", @@ -103,8 +106,6 @@ protected: config->set_sia_config(src_cfg.get_sia_config()); } - comm = std::make_unique(config->get_host_config()); - drive_args = std::vector({ "-na", "sia", @@ -122,10 +123,6 @@ protected: // config->set_event_level(event_level::trace); // config->set_s3_config(src_cfg.get_s3_config()); // } - // - // comm = std::make_unique(config->get_s3_config()); - // provider = std::make_unique(*config, *comm); - // drive_args = std::vector({"-en"}); // } break; default: @@ -133,7 +130,6 @@ protected: return; } - provider = std::make_unique(*config, *comm); drive_args.push_back(mount_location); execute_mount(); } @@ -199,7 +195,7 @@ public: } static void execute_mount() { - auto mount_cmd = ".\\repertory.exe -dd \"" + config->get_data_directory() + + auto mount_cmd = "start .\\repertory.exe -dd \"" + config->get_data_directory() + "\"" + " " + utils::string::join(drive_args, ' '); std::cout << "mount command: " << mount_cmd << std::endl; ASSERT_EQ(0, system(mount_cmd.c_str()));