From bd913d83e122e13d5350de3fd2c8e86484786468 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 3 Sep 2025 14:42:15 -0500 Subject: [PATCH] added additional winfsp unit tests --- .../include/fixtures/winfsp_fixture.hpp | 68 ++++++++++++++++--- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp b/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp index a64f1f8a..4f697778 100644 --- a/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp +++ b/repertory/repertory_test/include/fixtures/winfsp_fixture.hpp @@ -42,34 +42,76 @@ constexpr auto SLEEP_SECONDS{1.5s}; } // namespace namespace repertory { -struct local_s3 final { +struct local_s3_no_encryption final { static constexpr provider_type type{provider_type::s3}; static constexpr provider_type type2{provider_type::s3}; static constexpr std::uint16_t remote_port{41000U}; + static constexpr bool force_legacy_encryption{false}; + static constexpr std::string encryption_token{""}; +}; + +struct local_s3_encryption final { + static constexpr provider_type type{provider_type::s3}; + static constexpr provider_type type2{provider_type::s3}; + static constexpr std::uint16_t remote_port{41000U}; + static constexpr bool force_legacy_encryption{false}; + static constexpr std::string encryption_token{"encryption_token"}; +}; + +struct local_s3_legacy_encryption final { + static constexpr provider_type type{provider_type::s3}; + static constexpr provider_type type2{provider_type::s3}; + static constexpr std::uint16_t remote_port{41000U}; + static constexpr bool force_legacy_encryption{true}; + static constexpr std::string encryption_token{"encryption_token"}; +}; + +struct remote_s3_no_encryption final { + static constexpr provider_type type{provider_type::remote}; + static constexpr provider_type type2{provider_type::s3}; + static constexpr std::uint16_t remote_port{41000U}; + static constexpr bool force_legacy_encryption{false}; + static constexpr std::string encryption_token{""}; +}; + +struct remote_s3_encryption final { + static constexpr provider_type type{provider_type::remote}; + static constexpr provider_type type2{provider_type::s3}; + static constexpr std::uint16_t remote_port{41000U}; + static constexpr bool force_legacy_encryption{false}; + static constexpr std::string encryption_token{"encryption_token"}; +}; + +struct remote_s3_legacy_encryption final { + static constexpr provider_type type{provider_type::remote}; + static constexpr provider_type type2{provider_type::s3}; + static constexpr std::uint16_t remote_port{41000U}; + static constexpr bool force_legacy_encryption{true}; + static constexpr std::string encryption_token{"encryption_token"}; }; struct local_sia final { static constexpr provider_type type{provider_type::sia}; static constexpr provider_type type2{provider_type::sia}; static constexpr std::uint16_t remote_port{41001U}; -}; - -struct remote_s3 final { - static constexpr provider_type type{provider_type::remote}; - static constexpr provider_type type2{provider_type::s3}; - static constexpr std::uint16_t remote_port{41000U}; + static constexpr bool force_legacy_encryption{false}; + static constexpr std::string encryption_token{""}; }; struct remote_sia final { static constexpr provider_type type{provider_type::remote}; static constexpr provider_type type2{provider_type::sia}; static constexpr std::uint16_t remote_port{41001U}; + static constexpr bool force_legacy_encryption{false}; + static constexpr std::string encryption_token{""}; }; struct remote_winfsp_to_linux final { static constexpr provider_type type{provider_type::remote}; static constexpr provider_type type2{provider_type::unknown}; static constexpr std::uint16_t remote_port{41002U}; + static constexpr bool force_legacy_encryption{false}; + static constexpr std::string encryption_token{""}; }; template class winfsp_test : public ::testing::Test { @@ -108,9 +150,13 @@ protected: provider_type::s3, utils::path::combine(test::get_test_config_dir(), {"s3"}), }; + + auto cfg = src_cfg.get_s3_config(); + cfg.force_legacy_encryption = provider_t::force_legacy_encryption; + cfg.encryption_token = provider_t::encryption_token; config->set_enable_drive_events(true); config->set_event_level(event_level::trace); - config->set_s3_config(src_cfg.get_s3_config()); + config->set_s3_config(); auto r_cfg = config->get_remote_mount(); r_cfg.enable = true; @@ -305,8 +351,10 @@ template std::string winfsp_test::mount_location2; using winfsp_provider_types = - ::testing::Types; + ::testing::Types; } // namespace repertory #endif // defined(_WIN32)