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