diff --git a/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp b/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp index b5719f17..5e4cd951 100644 --- a/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp +++ b/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp @@ -49,6 +49,7 @@ public: static std::unique_ptr config; static std::filesystem::path current_directory; static std::unique_ptr drive; + static std::vector drive_args; static std::string mount_location; static std::unique_ptr provider; static std::string test_directory; @@ -70,8 +71,6 @@ protected: config = std::make_unique(provider_t::type, cfg_directory); - std::vector drive_args{}; - switch (provider_t::type) { case provider_type::s3: { { @@ -99,11 +98,17 @@ protected: utils::path::combine(test::get_test_config_dir(), {"sia"}), }; config->set_enable_drive_events(true); - config->set_event_level(event_level::debug); + config->set_event_level(event_level::trace); config->set_host_config(src_cfg.get_host_config()); + config->set_sia_config(src_cfg.get_sia_config()); } comm = std::make_unique(config->get_host_config()); + + drive_args = std::vector({ + "-na", + "sia", + }); } break; // case 0U: { // config = @@ -130,6 +135,7 @@ protected: provider = std::make_unique(*config, *comm); drive_args.push_back(mount_location); + execute_mount(); } static void TearDownTestCase() { @@ -192,7 +198,7 @@ public: EXPECT_FALSE(utils::file::file(file_path).exists()); } - static void execute_mount(auto &&drive_args) { + static void execute_mount() { auto mount_cmd = ".\\repertory.exe -dd \"" + config->get_data_directory() + "\"" + " " + utils::string::join(drive_args, ' '); std::cout << "mount command: " << mount_cmd << std::endl; @@ -205,10 +211,11 @@ public: auto unmounted{false}; auto unmount_cmd = ".\\repertory.exe -dd \"" + - config->get_data_directory() + "\" -unmount"; + config->get_data_directory() + "\"" + " " + + utils::string::join(drive_args, ' ') + " -unmount"; for (int i = 0; not unmounted && (i < 50); i++) { std::cout << "unmount command: " << unmount_cmd << std::endl; - ASSERT_EQ(0, system(unmount_cmd.c_str())); + system(unmount_cmd.c_str()); unmounted = not utils::file::directory{mount_location}.exists(); if (not unmounted) { std::this_thread::sleep_for(5s); @@ -222,6 +229,9 @@ public: template std::string winfsp_test::cfg_directory; +template +std::unique_ptr winfsp_test::comm; + template std::unique_ptr winfsp_test::config; @@ -229,7 +239,10 @@ template std::filesystem::path winfsp_test::current_directory; template -std::unique_ptr winfsp_test::comm; +std::unique_ptr winfsp_test::drive; + +template +std::vector winfsp_test::drive_args; template std::string winfsp_test::mount_location; @@ -240,9 +253,6 @@ std::unique_ptr winfsp_test::provider; template std::string winfsp_test::test_directory; -template -std::unique_ptr winfsp_test::drive; - using winfsp_provider_types = ::testing::Types; // using winfsp_provider_types = ::testing::Types; } // namespace repertory