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

Conversation

salvete
Copy link
Contributor

@salvete salvete commented Nov 13, 2024

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 <[email protected]>
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
Contributor

Choose a reason for hiding this comment

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

Can we just keep gzipped data in the testcase itself so that it won't rely on the network?
see https://github.com/containerd/overlaybd/pull/353/files#diff-eb6cf39198971c1db93f32d0f8bcb91f32e5cc73dd97fb29585bfe40ea90a2c8L198

Copy link
Contributor 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
Contributor Author

Choose a reason for hiding this comment

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

Done.

delete sha256_f, sha256file;
}


Copy link
Contributor

Choose a reason for hiding this comment

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

reduntant blanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


TEST_F(ErofsPax, pax_test) {

unsigned char tar_zipped[3149] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

static const ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

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
Contributor

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
Contributor Author

Choose a reason for hiding this comment

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

Done.

@BigVan
Copy link
Member

BigVan commented Nov 18, 2024

LGTM

@BigVan BigVan merged commit 65f4fb2 into containerd:main Nov 18, 2024
2 checks passed
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