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 stress test for erofs #358

Merged
merged 17 commits into from
Dec 25, 2024
Merged

Add stress test for erofs #358

merged 17 commits into from
Dec 25, 2024

Conversation

salvete
Copy link
Contributor

@salvete salvete commented Dec 18, 2024

What this PR does / why we need it:

Add stress testing for EROFS, including:

  • file contents
  • xattrs
  • mode
  • uid/gid
  • others

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?

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
This adds test case 002. The previous stress test was only
for empty files; this patch generates small files with random
content.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
To prepare for:

1. ontrol the overlap between the upper layer and lower layer
2. generate .wh.*

Relevant tests will be added later.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Add tests for cases where file and directory have the same name.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Add tests for deleting directories and files.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
This test case is used to test the deletion of a directory/file first,
followed by the creation of a directory/file with the same name.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
items.emplace_back(cur + "/" + std::string(dent->d_name));
} while (dir->next());
}
dir->closedir();
Copy link
Contributor

Choose a reason for hiding this comment

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

lack of stat judgement.

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.

node = new StressNode(cur, NODE_REGULAR);
if (!file || ! node)
LOG_ERROR_RETURN(0, false, "fail to open file or node `", cur);
ret = verify_gen_mod(node, file) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

it should check if the whole stat() equals.

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.

Copy link
Contributor

@hsiangkao hsiangkao left a comment

Choose a reason for hiding this comment

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

The change itself looks good to me, but it might be better to improve as I mentioned above.

@@ -117,4 +117,4 @@ jobs:
- name: Unit Test
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -j8 --output-on-failure -C $BUILD_TYPE
run: sudo ctest -j8 --output-on-failure -C $BUILD_TYPE
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a bit concern of sudo permission to run this test.

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. sudo has been removed, and the way for creating tars has been slightly adjusted.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
The previous creation of tar files for each layer requires
root privileges, and this patch changes that. This patch
creates each layer's tar file in a "append" way.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
@BigVan BigVan merged commit be5e0a4 into containerd:main Dec 25, 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