-
Notifications
You must be signed in to change notification settings - Fork 58
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
Conversation
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"; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reduntant blanks
There was a problem hiding this comment.
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] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static const ?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop obsoleted comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
61be8f9
to
b52ee4b
Compare
Signed-off-by: Hongzhen Luo <[email protected]>
LGTM |
What this PR does / why we need it:
Test results using the old version of liberofs:
Test results using the latest version of liberofs:
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: