Compare commits

..

No commits in common. "dcafb104eaefa0d78916b86357a76698c8874520" and "eec2d2e9a9bbdc768b51e569a89d9e156e4ae1b1" have entirely different histories.

2 changed files with 7 additions and 44 deletions

View File

@ -54,31 +54,21 @@ namespace repertory {
struct local_s3 final {
static constexpr const provider_type type{provider_type::s3};
static constexpr const provider_type type2{provider_type::s3};
static constexpr const std::uint16_t port{0U};
};
struct local_sia final {
static constexpr const provider_type type{provider_type::sia};
static constexpr const provider_type type2{provider_type::sia};
static constexpr const std::uint16_t port{0U};
};
struct remote_s3 final {
static constexpr const provider_type type{provider_type::remote};
static constexpr const provider_type type2{provider_type::s3};
static constexpr const std::uint16_t port{0U};
};
struct remote_sia final {
static constexpr const provider_type type{provider_type::remote};
static constexpr const provider_type type2{provider_type::sia};
static constexpr const std::uint16_t port{0U};
};
struct remote_linux_to_winfsp final {
static constexpr const provider_type type{provider_type::remote};
static constexpr const provider_type type2{provider_type::unknown};
static constexpr const std::uint16_t port{30001U};
};
template <typename provider_t> class fuse_test : public ::testing::Test {
@ -188,7 +178,7 @@ protected:
execute_mount(drive_args, mount_location);
};
const auto mount_remote = [&](std::uint16_t port = 30000U) {
const auto mount_remote = [&]() {
{
mount_location2 = mount_location;
@ -197,8 +187,7 @@ protected:
{
"fuse_test",
app_config::get_provider_name(provider_t::type) + '_' +
app_config::get_provider_name(provider_t::type2) + '_' +
std::to_string(port),
app_config::get_provider_name(provider_t::type2),
});
mount_location = utils::path::combine(test_directory, {"mount"});
@ -217,7 +206,7 @@ protected:
"-dd",
config2->get_data_directory(),
"-rm",
fmt::format("localhost:{}", port),
"localhost:30000",
mount_location,
});
}
@ -244,10 +233,6 @@ protected:
mount_sia();
} break;
case provider_type::unknown:
mount_remote(provider_t::port);
return;
default:
throw std::runtime_error("remote provider type is not implemented");
return;
@ -425,15 +410,9 @@ std::string fuse_test<provider_t>::mount_location;
template <typename provider_t>
std::string fuse_test<provider_t>::mount_location2;
#if defined(__linux__)
// using fuse_provider_types = ::testing::Types<local_s3, remote_s3>;
using fuse_provider_types =
::testing::Types<local_s3, remote_s3, local_sia, remote_sia>;
// using fuse_provider_types =
// ::testing::Types<local_s3, remote_s3, local_sia, remote_sia,
// remote_linux_to_winfsp>;
#else // !defined(__linux__)
build fails here
#endif // defined(_WIN32)
} // namespace repertory
#endif // !defined(_WIN32)

View File

@ -45,31 +45,21 @@ namespace repertory {
struct local_s3 final {
static constexpr const provider_type type{provider_type::s3};
static constexpr const provider_type type2{provider_type::s3};
static constexpr const std::uint16_t port{0U};
};
struct local_sia final {
static constexpr const provider_type type{provider_type::sia};
static constexpr const provider_type type2{provider_type::sia};
static constexpr const std::uint16_t port{0U};
};
struct remote_s3 final {
static constexpr const provider_type type{provider_type::remote};
static constexpr const provider_type type2{provider_type::s3};
static constexpr const std::uint16_t port{0U};
};
struct remote_sia final {
static constexpr const provider_type type{provider_type::remote};
static constexpr const provider_type type2{provider_type::sia};
static constexpr const std::uint16_t port{0U};
};
struct remote_winfsp_to_linux final {
static constexpr const provider_type type{provider_type::remote};
static constexpr const provider_type type2{provider_type::unknown};
static constexpr const std::uint16_t port{30001U};
};
template <typename provider_t> class winfsp_test : public ::testing::Test {
@ -170,15 +160,13 @@ protected:
execute_mount(drive_args, mount_location);
};
const auto mount_remote = [&](std::uint16_t port = 30000U) {
const auto mount_remote = [&]() {
{
auto test_directory = utils::path::combine(
test::get_test_output_dir(),
{
"winfsp_test",
app_config::get_provider_name(provider_t::type) + '_' +
app_config::get_provider_name(provider_t::type2) + '_' +
std::to_string(port),
app_config::get_provider_name(provider_type::remote),
});
mount_location2 = mount_location;
@ -196,7 +184,7 @@ protected:
"-dd",
config->get_data_directory(),
"-rm",
fmt::format("localhost:{}", port),
"localhost:30000",
mount_location,
});
}
@ -223,10 +211,6 @@ protected:
mount_sia();
} break;
case provider_type::unknown:
mount_remote(provider_t::port);
return;
default:
throw std::runtime_error("remote provider type is not implemented");
return;