Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test for pax-header tar and clean up #353

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/overlaybd/tar/erofs/liberofs.cpp
Original file line number Diff line number Diff line change
@@ -583,7 +583,7 @@ static int erofs_write_map_file(photon::fs::IFile *fout, uint64_t blksz, FILE *f
uint32_t nblocks, zeroedlen;
char *line = NULL;
size_t len = 0;
int cnt;
int cnt, err = 0;

if (fp == NULL) {
LOG_ERROR("unable to get upper.map, ignored");
@@ -597,6 +597,7 @@ static int erofs_write_map_file(photon::fs::IFile *fout, uint64_t blksz, FILE *f
cnt = sscanf(line, "%" PRIx64" %x%" PRIx64 "%u", &blkaddr, &nblocks, &toff, &zeroedlen);
if (cnt < 3) {
LOG_ERROR("Bad formatted map file.");
err = -EINVAL;
break;
}

@@ -608,12 +609,15 @@ static int erofs_write_map_file(photon::fs::IFile *fout, uint64_t blksz, FILE *f

int nwrite = fout->ioctl(LSMT::IFileRW::RemoteData, lba);
if ((unsigned) nwrite != lba.count) {
LOG_ERRNO_RETURN(0, -1, "failed to write lba");
LOG_ERROR("failed to write lba");
err = -EINVAL;
break;
}
}
free(line);
if (line)
free(line);

return 0;
return err;
}

static int erofs_close_sbi(struct erofs_sb_info *sbi, ErofsCache *cache)
7 changes: 6 additions & 1 deletion src/overlaybd/tar/erofs/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -7,7 +7,12 @@ link_directories($ENV{GTEST}/lib)
add_executable(erofs_test test.cpp)
target_include_directories(erofs_test PUBLIC ${PHOTON_INCLUDE_DIR})
target_link_libraries(erofs_test gtest gtest_main pthread photon_static
tar_lib lsmt_lib gzip_lib gzindex_lib checksum_lib)
tar_lib lsmt_lib gzip_lib gzindex_lib checksum_lib overlaybd_image_lib)

target_include_directories(erofs_test PUBLIC
${PHOTON_INCLUDE_DIR}
${rapidjson_SOURCE_DIR}/include
)

add_test(
NAME erofs_test
377 changes: 339 additions & 38 deletions src/overlaybd/tar/erofs/test/test.cpp
Original file line number Diff line number Diff line change
@@ -24,17 +24,58 @@
#include <photon/common/alog.h>
#include <photon/common/alog-stdstring.h>
#include <vector>
#include <dirent.h>
#include "../../../gzindex/gzfile.h"
#include "../../../lsmt/file.h"
#include "../liberofs.h"
#include "../../tar_file.cpp"
#include "../../../gzip/gz.h"
#include "../../../../tools/sha256file.h"
#include "../../../../tools/comm_func.h"


#define FILE_SIZE (2 * 1024 * 1024)
#define IMAGE_SIZE 512UL<<20
class ErofsTest : public ::testing::Test {
public:
static int inflate(std::string output_file, unsigned char *data, unsigned int size) {
unsigned char out[65536];
z_stream strm;
int ret;
/* allocate inflate state */
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
strm.avail_in = 0;
strm.next_in = Z_NULL;
ret = inflateInit2(&strm, 31);
if (ret != Z_OK)
return ret;
DEFER((void)inflateEnd(&strm));
strm.avail_in = size;
strm.next_in = data;
int fd = open(output_file.c_str(), O_WRONLY | O_TRUNC | O_CREAT, 0644);
if (fd < 0)
return fd;
DEFER(close(fd));
do {
strm.avail_out = sizeof(out);
strm.next_out = out;
ret = ::inflate(&strm, Z_NO_FLUSH);
switch (ret) {
case Z_NEED_DICT:
case Z_DATA_ERROR:
case Z_MEM_ERROR:
return -1;
}
int have = sizeof(out) - strm.avail_out;
if (write(fd, out, have) != have) {
return -1;
}
} while (strm.avail_out == 0);
return 0;
}

protected:
virtual void SetUp() override{
fs = photon::fs::new_localfs_adaptor();
@@ -84,43 +125,6 @@ class ErofsTest : public ::testing::Test {
return 0;
}

int inflate(unsigned char *data, unsigned int size) {
unsigned char out[65536];
z_stream strm;
int ret;
/* allocate inflate state */
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
strm.avail_in = 0;
strm.next_in = Z_NULL;
ret = inflateInit2(&strm, 31);
if (ret != Z_OK)
return ret;
DEFER((void)inflateEnd(&strm));
strm.avail_in = size;
strm.next_in = data;
int fd = open(std::string(workdir + "/test.tar").c_str(), O_WRONLY | O_TRUNC | O_CREAT, 0644);
if (fd < 0)
return fd;
DEFER(close(fd));
do {
strm.avail_out = sizeof(out);
strm.next_out = out;
ret = ::inflate(&strm, Z_NO_FLUSH);
switch (ret) {
case Z_NEED_DICT:
case Z_DATA_ERROR:
case Z_MEM_ERROR:
return -1;
}
int have = sizeof(out) - strm.avail_out;
if (write(fd, out, have) != have) {
return -1;
}
} while (strm.avail_out == 0);
return 0;
}
int write_file(photon::fs::IFile *file) {
std::string bb = "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz01";
ssize_t size = 0;
@@ -221,7 +225,7 @@ TEST_F(ErofsTest, tar_meta) {
0x49, 0x1c, 0x0f, 0x00, 0x28, 0x00, 0x00
};
// set_log_output_level(0);
ASSERT_EQ(0, inflate(tar_zipped, sizeof(tar_zipped)));
ASSERT_EQ(0, ErofsTest::inflate(workdir + "/test.tar", tar_zipped, sizeof(tar_zipped)));

auto src_file = fs->open("test.tar", O_RDONLY, 0666);
ASSERT_NE(nullptr, src_file);
@@ -250,6 +254,303 @@ TEST_F(ErofsTest, tar_meta) {
delete tar_idx;
}

class ErofsPax : public ::testing::Test {
protected:
photon::fs::IFileSystem *host_fs;
std::string workdir = "/tmp/pax_test";
std::string src_path = workdir + "/pax.tar";
std::string fn_idx = workdir + "/index.idx";
std::string fn_meta = workdir + "/erofs.fs.meta";
std::string sha256_path = workdir + "/sha256";

virtual void SetUp() override{
ASSERT_EQ(0, prepare_host_fs());
}

virtual void TearDown() override{
ASSERT_NE(nullptr, host_fs);
if (host_fs->access(src_path.c_str(), 0) == 0)
ASSERT_EQ(0, host_fs->unlink(src_path.c_str()));
if (host_fs->access(fn_idx.c_str(), 0) == 0)
ASSERT_EQ(0, host_fs->unlink(fn_idx.c_str()));
if (host_fs->access(fn_meta.c_str(), 0) == 0)
ASSERT_EQ(0, host_fs->unlink(fn_meta.c_str()));
if (host_fs->access(sha256_path.c_str(), 0) == 0)
ASSERT_EQ(0, host_fs->unlink(sha256_path.c_str()));
delete host_fs;
}

int prepare_host_fs() {
host_fs = photon::fs::new_localfs_adaptor();
if (!host_fs)
return -1;
if (host_fs->access(workdir.c_str(), 0) != 0) {
if (host_fs->mkdir(workdir.c_str(), 0755))
return -1;
}
return 0;
}
};

TEST_F(ErofsPax, pax_test) {

static const unsigned char tar_zipped[3149] = {
0x1f, 0x8b, 0x08, 0x08, 0x97, 0x59, 0x35, 0x67, 0x00, 0x03, 0x70, 0x61, 0x78, 0x2e, 0x74, 0x61,
0x72, 0x00, 0xed, 0x9d, 0xdb, 0x72, 0xdb, 0x46, 0x12, 0x86, 0x7d, 0x9d, 0xa7, 0xf0, 0x0b, 0x88,
0x9a, 0xf3, 0x00, 0x17, 0xbe, 0xd8, 0x8a, 0x53, 0xb1, 0xab, 0xe2, 0xda, 0xad, 0x24, 0x37, 0xb9,
0x72, 0x0d, 0x0e, 0x94, 0x18, 0x8b, 0x87, 0x22, 0x21, 0xaf, 0x95, 0xa7, 0xdf, 0x01, 0x28, 0x99,
0xc4, 0x90, 0xc4, 0x60, 0xc0, 0x41, 0x0b, 0xeb, 0xea, 0xef, 0x22, 0xb6, 0x25, 0x39, 0x6d, 0xe9,
0x6f, 0xfc, 0xdd, 0x33, 0x98, 0xc3, 0xec, 0xf6, 0x3f, 0xe6, 0xdb, 0x87, 0xd2, 0x14, 0xe5, 0x76,
0x37, 0xe3, 0x52, 0x72, 0x96, 0xb2, 0xdb, 0xf2, 0x9b, 0x59, 0x6e, 0x1e, 0xca, 0xcf, 0x85, 0xa9,
0xcc, 0x9b, 0xeb, 0x21, 0x16, 0x25, 0x44, 0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, 0xba, 0xf3, 0xbf, 0x54, 0x73, 0x5c, 0xff, 0x0f, 0x83, 0xbb, 0xde, 0x6b,
0xb5, 0x98, 0x97, 0xbb, 0x6a, 0xf6, 0xf7, 0xee, 0xf2, 0x77, 0x1a, 0x8c, 0xd7, 0xff, 0xa5, 0x3b,
0xfe, 0x63, 0x5a, 0xe3, 0xfa, 0x5f, 0x10, 0x02, 0xf6, 0x7f, 0x85, 0xfa, 0x7f, 0x2b, 0x99, 0xd0,
0xf5, 0xa7, 0xc9, 0x48, 0x8f, 0x7c, 0x8b, 0x4e, 0xff, 0x57, 0x5c, 0xda, 0x3f, 0x1e, 0xc6, 0x7f,
0x6a, 0x7f, 0xff, 0x23, 0xc3, 0xf5, 0x5f, 0x08, 0x82, 0x20, 0x08, 0x82, 0x20, 0x08, 0x82, 0x20,
0x08, 0x12, 0x8d, 0xff, 0x01, 0xe8, 0xf1, 0xe2, 0x42, 0x00, 0x40, 0x01, 0x00
};

// prepare pax-header tar
ASSERT_EQ(0, ErofsTest::inflate(src_path, const_cast<unsigned char*>(tar_zipped), sizeof(tar_zipped)));

// create device
auto src_file = host_fs->open(src_path.c_str(), O_RDONLY, 0666);
ASSERT_NE(nullptr, src_file);
DEFER(delete src_file);
auto fmeta = host_fs->open(fn_idx.c_str(), O_RDWR | O_CREAT | O_TRUNC, S_IRWXU);
auto findex = host_fs->open(fn_meta.c_str(), O_RDWR | O_CREAT | O_TRUNC, S_IRWXU);
LSMT::WarpFileArgs args(findex, fmeta, src_file);
args.virtual_size = IMAGE_SIZE;
auto wrap_file = create_warpfile(args, false);
ASSERT_NE(wrap_file, nullptr);

// create erofs image
auto tar = new LibErofs(wrap_file, 4096, true);
ASSERT_EQ(0, tar->extract_tar(src_file, true, true));
delete tar;

// setup erofs fs
auto erofs_fs = create_erofs_fs(wrap_file, 4096);
ASSERT_NE(erofs_fs, nullptr);
DEFER(delete erofs_fs);

// traverse the fs tree
std::string res;
std::string std_res = "sha256:4d7ad1fb36abd862a7caa9da01233aed7c762bbb8d900dc5baf60c5b1ddd8496";
std::vector<string> items;
items.emplace_back("/");
while (!items.empty()) {
std::string tmp = items.front();
struct stat st;

items.erase(items.begin());
res += tmp;
ASSERT_EQ(0, erofs_fs->stat(tmp.c_str(), &st));
if (S_ISDIR(st.st_mode)) {
auto dir = erofs_fs->opendir(tmp.c_str());
while (dir->next()) {
dirent *dent = dir->get();
items.emplace_back(tmp + "/" + dent->d_name);
}
dir->closedir();
delete dir;
}
}

auto sha256_f = host_fs->open(sha256_path.c_str(), O_RDWR | O_CREAT | O_TRUNC);
ASSERT_NE(sha256_f, nullptr);
sha256_f->pwrite(res.c_str(), res.size(), 0);
sha256_f->lseek(0, SEEK_SET);
auto sha256file = new_sha256_file(sha256_f, false);
ASSERT_STREQ(std_res.c_str(), sha256file->sha256_checksum().c_str());
delete sha256_f;
delete sha256file;
}

int main(int argc, char **argv) {

::testing::InitGoogleTest(&argc, argv);