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 test root readonly #2976

Merged
merged 31 commits into from
Nov 26, 2024
Merged

Add test root readonly #2976

merged 31 commits into from
Nov 26, 2024

Conversation

sat0ken
Copy link
Contributor

@sat0ken sat0ken commented Nov 4, 2024

This implements the root_readonly_true validation in #361

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Copy link
Collaborator

@YJDoc2 YJDoc2 left a comment

Choose a reason for hiding this comment

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

Hey, I think we need to break this in two tests - one with readonly true and other with false. We will have a corresponding test in the runtime test, which will check that read operation is successful (maybe create a file and validate the contents) and the the write access will be tested according to config's value.

This is small deviation from the go test, but I think this would be a better test.

tests/contest/runtimetest/src/tests.rs Outdated Show resolved Hide resolved
tests/contest/runtimetest/src/main.rs Outdated Show resolved Hide resolved
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
@sat0ken
Copy link
Contributor Author

sat0ken commented Nov 10, 2024

@YJDoc2 HI, I've fixed the code according to the comments. Could you please check the code?

Copy link
Collaborator

@YJDoc2 YJDoc2 left a comment

Choose a reason for hiding this comment

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

Hey, overall ok, but some changes needed.

tests/contest/runtimetest/src/main.rs Outdated Show resolved Hide resolved
tests/contest/runtimetest/src/tests.rs Outdated Show resolved Hide resolved
tests/contest/runtimetest/src/tests.rs Outdated Show resolved Hide resolved
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
@sat0ken
Copy link
Contributor Author

sat0ken commented Nov 13, 2024

@YJDoc2 I fixed code, Could you please check the code?

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
@sat0ken
Copy link
Contributor Author

sat0ken commented Nov 14, 2024

@YJDoc2 Ping!

Copy link
Collaborator

@YJDoc2 YJDoc2 left a comment

Choose a reason for hiding this comment

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

some minor changes needed.

tests/contest/runtimetest/src/tests.rs Outdated Show resolved Hide resolved
tests/contest/runtimetest/src/tests.rs Outdated Show resolved Hide resolved
@YJDoc2 YJDoc2 mentioned this pull request Nov 23, 2024
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
@sat0ken
Copy link
Contributor Author

sat0ken commented Nov 24, 2024

@YJDoc2 Thank you for review and comments. I've fixed the code. Could you please check the code?

Copy link
Collaborator

@YJDoc2 YJDoc2 left a comment

Choose a reason for hiding this comment

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

One final change.

tests/contest/runtimetest/src/tests.rs Outdated Show resolved Hide resolved
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
@YJDoc2
Copy link
Collaborator

YJDoc2 commented Nov 25, 2024

@sat0ken , can you merge/rebase the latest main? the test_inside_container function has changed, so this will error if merged in current state. Apart from that this is good to go, so once that is done I'll merge.

Thanks for all the efforts, and apologies for so many back-and-forths :)

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
@sat0ken
Copy link
Contributor Author

sat0ken commented Nov 25, 2024

@YJDoc2

can you merge/rebase the latest main?

Sure ! I worked it. Is this ok?

397a8c5

Copy link
Collaborator

@YJDoc2 YJDoc2 left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks for your efforts, and apologies for so many back-and-forth :)

@YJDoc2 YJDoc2 merged commit 62e0eee into youki-dev:main Nov 26, 2024
27 checks passed
@github-actions github-actions bot mentioned this pull request Nov 25, 2024
github-actions bot pushed a commit to moz-sec/youki that referenced this pull request Dec 6, 2024
* add test root readonly true

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix test group name

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove blank line

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove unused import

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove unnecessary return

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* separate test root readonly true and false

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* change test_dir_write_access to pub fn to use test

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* check root readonly to use test_dir_write_access

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove blank line

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* separate two tests to root_readonly_true and root_readonly_false

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* change test_dir_read_access to pub fn to use test

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix debug message and add check read access

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* add root_readonly test to main

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* add read access test when root readonly is false

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fox type err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove code err to raw os err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* add CreateOptions

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

---------

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
github-actions bot pushed a commit to moz-sec/youki that referenced this pull request Dec 6, 2024
* add test root readonly true

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix test group name

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove blank line

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove unused import

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove unnecessary return

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* separate test root readonly true and false

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* change test_dir_write_access to pub fn to use test

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* check root readonly to use test_dir_write_access

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove blank line

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* separate two tests to root_readonly_true and root_readonly_false

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* change test_dir_read_access to pub fn to use test

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix debug message and add check read access

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* add root_readonly test to main

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* add read access test when root readonly is false

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fox type err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove code err to raw os err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* add CreateOptions

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

---------

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
YamasouA pushed a commit to YamasouA/youki that referenced this pull request Dec 7, 2024
* add test root readonly true

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix test group name

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove blank line

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove unused import

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove unnecessary return

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* separate test root readonly true and false

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* change test_dir_write_access to pub fn to use test

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* check root readonly to use test_dir_write_access

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove blank line

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* separate two tests to root_readonly_true and root_readonly_false

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* change test_dir_read_access to pub fn to use test

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix debug message and add check read access

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fix format err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* add root_readonly test to main

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* add read access test when root readonly is false

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* fox type err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* remove code err to raw os err

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

* add CreateOptions

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>

---------

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: Akiyama <akiakiskyhand@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants