[Unit Test] Complete WinFSP unit tests #21
initial support for winfsp to linux remote testing
This commit is contained in:
parent
eec2d2e9a9
commit
ab757dfd36
@ -54,21 +54,37 @@ namespace repertory {
|
|||||||
struct local_s3 final {
|
struct local_s3 final {
|
||||||
static constexpr const provider_type type{provider_type::s3};
|
static constexpr const provider_type type{provider_type::s3};
|
||||||
static constexpr const provider_type type2{provider_type::s3};
|
static constexpr const provider_type type2{provider_type::s3};
|
||||||
|
static constexpr const std::uint16_t port{0U};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct local_sia final {
|
struct local_sia final {
|
||||||
static constexpr const provider_type type{provider_type::sia};
|
static constexpr const provider_type type{provider_type::sia};
|
||||||
static constexpr const provider_type type2{provider_type::sia};
|
static constexpr const provider_type type2{provider_type::sia};
|
||||||
|
static constexpr const std::uint16_t port{0U};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct remote_s3 final {
|
struct remote_s3 final {
|
||||||
static constexpr const provider_type type{provider_type::remote};
|
static constexpr const provider_type type{provider_type::remote};
|
||||||
static constexpr const provider_type type2{provider_type::s3};
|
static constexpr const provider_type type2{provider_type::s3};
|
||||||
|
static constexpr const std::uint16_t port{0U};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct remote_sia final {
|
struct remote_sia final {
|
||||||
static constexpr const provider_type type{provider_type::remote};
|
static constexpr const provider_type type{provider_type::remote};
|
||||||
static constexpr const provider_type type2{provider_type::sia};
|
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};
|
||||||
|
};
|
||||||
|
|
||||||
|
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 {
|
template <typename provider_t> class fuse_test : public ::testing::Test {
|
||||||
@ -178,7 +194,7 @@ protected:
|
|||||||
execute_mount(drive_args, mount_location);
|
execute_mount(drive_args, mount_location);
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto mount_remote = [&]() {
|
const auto mount_remote = [&](std::uint16_t port = 30000U) {
|
||||||
{
|
{
|
||||||
mount_location2 = mount_location;
|
mount_location2 = mount_location;
|
||||||
|
|
||||||
@ -187,7 +203,8 @@ protected:
|
|||||||
{
|
{
|
||||||
"fuse_test",
|
"fuse_test",
|
||||||
app_config::get_provider_name(provider_t::type) + '_' +
|
app_config::get_provider_name(provider_t::type) + '_' +
|
||||||
app_config::get_provider_name(provider_t::type2),
|
app_config::get_provider_name(provider_t::type2) + '_' +
|
||||||
|
std::to_string(port),
|
||||||
});
|
});
|
||||||
|
|
||||||
mount_location = utils::path::combine(test_directory, {"mount"});
|
mount_location = utils::path::combine(test_directory, {"mount"});
|
||||||
@ -206,7 +223,7 @@ protected:
|
|||||||
"-dd",
|
"-dd",
|
||||||
config2->get_data_directory(),
|
config2->get_data_directory(),
|
||||||
"-rm",
|
"-rm",
|
||||||
"localhost:30000",
|
fmt::format("localhost:{}", port),
|
||||||
mount_location,
|
mount_location,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -233,6 +250,10 @@ protected:
|
|||||||
mount_sia();
|
mount_sia();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case provider_type::unknown:
|
||||||
|
mount_remote(provider_t::port);
|
||||||
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw std::runtime_error("remote provider type is not implemented");
|
throw std::runtime_error("remote provider type is not implemented");
|
||||||
return;
|
return;
|
||||||
@ -411,8 +432,19 @@ template <typename provider_t>
|
|||||||
std::string fuse_test<provider_t>::mount_location2;
|
std::string fuse_test<provider_t>::mount_location2;
|
||||||
|
|
||||||
// using fuse_provider_types = ::testing::Types<local_s3, remote_s3>;
|
// using fuse_provider_types = ::testing::Types<local_s3, remote_s3>;
|
||||||
|
#if defined(_WIN32)
|
||||||
|
using fuse_provider_types =
|
||||||
|
::testing::Types<local_s3, remote_s3, local_sia, remote_sia,
|
||||||
|
remote_winfsp_to_linux>;
|
||||||
|
#elif defined(__linux__)
|
||||||
using fuse_provider_types =
|
using fuse_provider_types =
|
||||||
::testing::Types<local_s3, remote_s3, local_sia, remote_sia>;
|
::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
|
} // namespace repertory
|
||||||
|
|
||||||
#endif // !defined(_WIN32)
|
#endif // !defined(_WIN32)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user