fix
This commit is contained in:
@@ -157,7 +157,10 @@ public:
|
|||||||
|
|
||||||
auto Init(PVOID host) -> NTSTATUS override;
|
auto Init(PVOID host) -> NTSTATUS override;
|
||||||
|
|
||||||
[[nodiscard]] auto mount(const std::vector<std::string> &drive_args) -> int;
|
[[nodiscard]] auto mount(std::vector<std::string> orig_args,
|
||||||
|
std::vector<std::string> drive_args,
|
||||||
|
provider_type prov, std::string_view unique_id)
|
||||||
|
-> int;
|
||||||
|
|
||||||
auto Mounted(PVOID host) -> NTSTATUS override;
|
auto Mounted(PVOID host) -> NTSTATUS override;
|
||||||
|
|
||||||
|
@@ -590,7 +590,10 @@ auto winfsp_drive::Init(PVOID host) -> NTSTATUS {
|
|||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto winfsp_drive::mount(const std::vector<std::string> &drive_args) -> int {
|
auto winfsp_drive::mount(std::vector<std::string> /* orig_args */,
|
||||||
|
std::vector<std::string> drive_args,
|
||||||
|
provider_type /* prov */,
|
||||||
|
std::string_view /* unique_id */) -> int {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
std::vector<std::string> parsed_drive_args;
|
std::vector<std::string> parsed_drive_args;
|
||||||
|
@@ -54,31 +54,31 @@ namespace repertory {
|
|||||||
struct local_s3 final {
|
struct local_s3 final {
|
||||||
static constexpr provider_type type{provider_type::s3};
|
static constexpr provider_type type{provider_type::s3};
|
||||||
static constexpr provider_type type2{provider_type::s3};
|
static constexpr provider_type type2{provider_type::s3};
|
||||||
static constexpr std::uint16_t port{0U};
|
static constexpr std::uint16_t remote_port{40000U};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct local_sia final {
|
struct local_sia final {
|
||||||
static constexpr provider_type type{provider_type::sia};
|
static constexpr provider_type type{provider_type::sia};
|
||||||
static constexpr provider_type type2{provider_type::sia};
|
static constexpr provider_type type2{provider_type::sia};
|
||||||
static constexpr std::uint16_t port{0U};
|
static constexpr std::uint16_t remote_port{40001U};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct remote_s3 final {
|
struct remote_s3 final {
|
||||||
static constexpr provider_type type{provider_type::remote};
|
static constexpr provider_type type{provider_type::remote};
|
||||||
static constexpr provider_type type2{provider_type::s3};
|
static constexpr provider_type type2{provider_type::s3};
|
||||||
static constexpr std::uint16_t port{0U};
|
static constexpr std::uint16_t remote_port{40000U};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct remote_sia final {
|
struct remote_sia final {
|
||||||
static constexpr provider_type type{provider_type::remote};
|
static constexpr provider_type type{provider_type::remote};
|
||||||
static constexpr provider_type type2{provider_type::sia};
|
static constexpr provider_type type2{provider_type::sia};
|
||||||
static constexpr std::uint16_t port{0U};
|
static constexpr std::uint16_t remote_port{40001U};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct remote_linux_to_winfsp final {
|
struct remote_linux_to_winfsp final {
|
||||||
static constexpr provider_type type{provider_type::remote};
|
static constexpr provider_type type{provider_type::remote};
|
||||||
static constexpr provider_type type2{provider_type::unknown};
|
static constexpr provider_type type2{provider_type::unknown};
|
||||||
static constexpr std::uint16_t port{40001U};
|
static constexpr std::uint16_t remote_port{40002U};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename provider_t> class fuse_test : public ::testing::Test {
|
template <typename provider_t> class fuse_test : public ::testing::Test {
|
||||||
@@ -123,7 +123,7 @@ protected:
|
|||||||
|
|
||||||
auto r_cfg = config->get_remote_mount();
|
auto r_cfg = config->get_remote_mount();
|
||||||
r_cfg.enable = true;
|
r_cfg.enable = true;
|
||||||
r_cfg.api_port = 40000U;
|
r_cfg.api_port = provider_t::remote_port;
|
||||||
config->set_remote_mount(r_cfg);
|
config->set_remote_mount(r_cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ protected:
|
|||||||
|
|
||||||
auto r_cfg = config->get_remote_mount();
|
auto r_cfg = config->get_remote_mount();
|
||||||
r_cfg.enable = true;
|
r_cfg.enable = true;
|
||||||
r_cfg.api_port = 40000U;
|
r_cfg.api_port = provider_t::remote_port;
|
||||||
config->set_remote_mount(r_cfg);
|
config->set_remote_mount(r_cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ protected:
|
|||||||
execute_mount(drive_args, mount_location);
|
execute_mount(drive_args, mount_location);
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto mount_remote = [&](std::uint16_t port = 40000U) {
|
const auto mount_remote = [&](std::uint16_t remote_port) {
|
||||||
{
|
{
|
||||||
mount_location2 = mount_location;
|
mount_location2 = mount_location;
|
||||||
auto test_directory = utils::path::combine(
|
auto test_directory = utils::path::combine(
|
||||||
@@ -195,7 +195,7 @@ 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),
|
std::to_string(remote_port),
|
||||||
});
|
});
|
||||||
|
|
||||||
mount_location = utils::path::combine(test_directory, {"mount"});
|
mount_location = utils::path::combine(test_directory, {"mount"});
|
||||||
@@ -214,7 +214,7 @@ protected:
|
|||||||
"-dd",
|
"-dd",
|
||||||
config2->get_data_directory(),
|
config2->get_data_directory(),
|
||||||
"-rm",
|
"-rm",
|
||||||
fmt::format("localhost:{}", port),
|
fmt::format("localhost:{}", remote_port),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ protected:
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
case provider_type::unknown:
|
case provider_type::unknown:
|
||||||
mount_remote(provider_t::port);
|
mount_remote(provider_t::remote_port);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -249,7 +249,7 @@ protected:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mount_remote();
|
mount_remote(provider_t::remote_port);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user