refactor s3 provider

This commit is contained in:
2023-11-11 11:32:14 -06:00
parent f2c1f64f02
commit 68476cbc00
55 changed files with 1504 additions and 5050 deletions

View File

@@ -22,7 +22,6 @@
#include "test_common.hpp"
#include "comm/curl/curl_comm.hpp"
#include "comm/s3/s3_comm.hpp"
#include "events/event_system.hpp"
#include "file_manager/file_manager.hpp"
#include "platform/platform.hpp"
@@ -57,8 +56,8 @@ const auto create_directory = [](repertory::i_provider &provider,
const std::string &api_path) {
auto date = repertory::utils::get_file_time_now();
auto meta = repertory::create_meta_attributes(
date, 0U, date + 1U, date + 2U, true, "", getgid(), "", 0700, date + 3U,
1U, 2U, 0U, api_path + "_src", getuid(), date + 4U);
date, 0U, date + 1U, date + 2U, true, getgid(), "", 0700, date + 3U, 1U,
2U, 0U, api_path + "_src", getuid(), date + 4U);
EXPECT_EQ(repertory::api_error::success,
provider.create_directory(api_path, meta));
@@ -74,8 +73,8 @@ const auto create_file = [](repertory::i_provider &provider,
auto date = repertory::utils::get_file_time_now();
auto meta = repertory::create_meta_attributes(
date, 0U, date + 1U, date + 2U, false, "", getgid(), "", 0700, date + 3U,
1U, 2U, 0U, source_path, getuid(), date + 4U);
date, 0U, date + 1U, date + 2U, false, getgid(), "", 0700, date + 3U, 1U,
2U, 0U, source_path, getuid(), date + 4U);
EXPECT_EQ(repertory::api_error::success,
provider.create_file(api_path, meta));
@@ -438,7 +437,6 @@ static void get_file(const app_config &cfg, i_provider &provider) {
#else
EXPECT_EQ(std::size_t(46U), file.file_size);
#endif
EXPECT_TRUE(file.encryption_token.empty());
EXPECT_STREQ(source_path.c_str(), file.source_path.c_str());
}
}
@@ -585,7 +583,7 @@ TEST(providers, s3_provider) {
cfg.set_s3_config(src_cfg.get_s3_config());
}
s3_comm comm{cfg};
curl_comm comm{cfg.get_s3_config()};
s3_provider provider{cfg, comm};
file_manager fm(cfg, provider);
fm.start();