[ui] Implement provider test button #49
This commit is contained in:
parent
3502bf2189
commit
539abc1d5b
@ -796,14 +796,10 @@ auto s3_provider::is_online() const -> bool {
|
|||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
bool is_encrypted{};
|
std::string token;
|
||||||
std::string object_name;
|
std::string response_data;
|
||||||
head_object_result result{};
|
long response_code{};
|
||||||
auto res{
|
return get_object_list(response_data, response_code, "/", "/", token);
|
||||||
get_object_info(true, "/", is_encrypted, object_name, result),
|
|
||||||
};
|
|
||||||
|
|
||||||
return res == api_error::success;
|
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
utils::error::raise_error(function_name, e, "exception occurred");
|
utils::error::raise_error(function_name, e, "exception occurred");
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#define REPERTORY_INCLUDE_CLI_TEST_HPP_
|
#define REPERTORY_INCLUDE_CLI_TEST_HPP_
|
||||||
|
|
||||||
#include "cli/common.hpp"
|
#include "cli/common.hpp"
|
||||||
|
#include "events/consumers/console_consumer.hpp"
|
||||||
|
|
||||||
namespace repertory::cli::actions {
|
namespace repertory::cli::actions {
|
||||||
[[nodiscard]] inline auto
|
[[nodiscard]] inline auto
|
||||||
@ -34,8 +35,12 @@ test(std::vector<const char *> /* args */, const std::string &data_directory,
|
|||||||
return exit_code::exception;
|
return exit_code::exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console_consumer consumer{};
|
||||||
|
event_system::instance().start();
|
||||||
auto provider{create_provider(prov, config)};
|
auto provider{create_provider(prov, config)};
|
||||||
auto is_online{provider->is_online()};
|
auto is_online{provider->is_online()};
|
||||||
|
event_system::instance().stop();
|
||||||
|
|
||||||
fmt::println("{}\nProvider is {}!", utils::string::from_bool(is_online),
|
fmt::println("{}\nProvider is {}!", utils::string::from_bool(is_online),
|
||||||
is_online ? "online" : "offline");
|
is_online ? "online" : "offline");
|
||||||
return is_online ? exit_code::success : exit_code::exception;
|
return is_online ? exit_code::success : exit_code::exception;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user