Skip to content

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

Merged
BigVan merged 2 commits into
containerd:mainfrom
salvete:main
Nov 18, 2024
Merged

Add unit test for pax-header tar and clean up#353
BigVan merged 2 commits into
containerd:mainfrom
salvete:main

Conversation

@salvete

@salvete salvete commented Nov 13, 2024

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Test results using the old version of liberofs:
image

Test results using the latest version of liberofs:
image

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

Return an error code when encountering a bad map file.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Comment thread src/overlaybd/tar/erofs/test/test.cpp Outdated
protected:
photon::fs::IFileSystem *host_fs;
std::string workdir = "/tmp/pax_test";
std::string src_url = "https://github.com/salvete/erofs-imgs/raw/main/pax.tar";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will give it a try.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread src/overlaybd/tar/erofs/test/test.cpp Outdated
delete sha256_f, sha256file;
}


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reduntant blanks

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread src/overlaybd/tar/erofs/test/test.cpp Outdated

TEST_F(ErofsPax, pax_test) {

unsigned char tar_zipped[3149] = {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static const ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread src/overlaybd/tar/erofs/test/test.cpp Outdated
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);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop obsoleted comments.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@salvete
salvete force-pushed the main branch 2 times, most recently from 61be8f9 to b52ee4b Compare November 16, 2024 09:02
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
@BigVan

BigVan commented Nov 18, 2024

Copy link
Copy Markdown
Member

LGTM

@BigVan
BigVan merged commit 65f4fb2 into containerd:main Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants