Skip to content

Commit

Permalink
5
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Sep 22, 2023
1 parent 83dacfa commit 13e3694
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
10 changes: 7 additions & 3 deletions src/block_service/test/block_service_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,17 @@ TEST_P(block_service_manager_test, local_file_exist)
{
int64_t size;
std::string md5;
} tests[]{{2333, "bad_md5"}, {2333, _file_meta.md5}, {_file_meta.size, "bad_md5"}};
} tests[]{
{2333, "bad_md5"}, // wrong size and md5
{2333, _file_meta.md5}, // wrong size
{_file_meta.size, "bad_md5"} // wrong md5
};
for (const auto &test : tests) {
// The remote file will be overwritten when repeatedly created.
create_remote_file(FILE_NAME, test.size, test.md5);
uint64_t download_size = 0;
ASSERT_EQ(test_download_file(download_size), ERR_PATH_ALREADY_EXIST);
ASSERT_EQ(download_size, 0);
ASSERT_EQ(ERR_PATH_ALREADY_EXIST, test_download_file(download_size));
ASSERT_EQ(0, download_size);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/replica/bulk_load/test/replica_bulk_loader_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ class replica_bulk_loader_test : public replica_test_base
/* should_sync */ true);
ASSERT_TRUE(s.ok()) << s.ToString();
_file_meta.name = whole_name;
utils::filesystem::md5sum(whole_name, _file_meta.md5);
utils::filesystem::file_size(
whole_name, dsn::utils::FileDataType::kSensitive, _file_meta.size);
ASSERT_EQ(ERR_OK, utils::filesystem::md5sum(whole_name, _file_meta.md5));
ASSERT_TRUE(utils::filesystem::file_size(
whole_name, dsn::utils::FileDataType::kSensitive, _file_meta.size));
}

error_code create_local_metadata_file()
Expand Down
8 changes: 0 additions & 8 deletions src/replica/duplication/test/load_from_private_log_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
#include "duplication_test_base.h"
#include "replica/duplication/load_from_private_log.h"
#include "replica/mutation_log_utils.h"
#include "test_util/test_util.h"

namespace dsn {
namespace replication {
Expand Down Expand Up @@ -311,13 +310,6 @@ TEST_F(load_from_private_log_test, handle_real_private_log)
std::vector<std::string> log_files({"log.1.0.handle_real_private_log",
"log.1.0.handle_real_private_log2",
"log.1.0.all_loaded_are_write_empties"});
if (FLAGS_encrypt_data_at_rest) {
for (int i = 0; i < log_files.size(); i++) {
auto s = dsn::utils::encrypt_file(log_files[i], log_files[i] + ".encrypted");
ASSERT_TRUE(s.ok()) << s.ToString();
log_files[i] += ".encrypted";
}
}

struct test_data
{
Expand Down

0 comments on commit 13e3694

Please sign in to comment.