-
Notifications
You must be signed in to change notification settings - Fork 160
validation: add more test cases for read-only paths tests #644
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
validation: add more test cases for read-only paths tests #644
Conversation
784e7bc to
3e4cae6
Compare
validation/linux_readonly_paths.go
Outdated
| } | ||
|
|
||
| // Deliberately set a relative path to be read-only, and expect an error | ||
| readonlyRelPath := "/etc/../readonly-relpath" |
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.
Is it a relative path? I think it equal to /readonly-relpath. It's a absolute path.
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.
@q384566678 Fixed the relative path.
Also fixed the same one in #643.
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.
Why not use readonlyRelPath := "readonly-relpath" ?
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.
@q384566678 Done. Also done in #643.
Split out the test function into `checkReadonlyPaths()`, and add more cases for readonly paths like subdirectory, file under subdirectory, and directory under subdirectory. Signed-off-by: Dongsu Park <dongsu@kinvolk.io>
3e4cae6 to
fc6aec7
Compare
Test inside container should return error if a relative path is given for read-only paths. Signed-off-by: Dongsu Park <dongsu@kinvolk.io>
Deliberately create an invalid read-only symlink that points out of the container, to see if the test fails inside the container. Signed-off-by: Dongsu Park <dongsu@kinvolk.io>
Create read-only block device, char device, and fifo, to check if they are read-only as expected. Signed-off-by: Dongsu Park <dongsu@kinvolk.io>
fc6aec7 to
303ae30
Compare
Split out the test function into
checkReadonlyPaths(), and add more cases for read-only paths like subdirectory, file under subdirectory, and directory under subdirectory.Test inside container should return error if a relative path is given for read-only paths.
Deliberately create an invalid read-only symlink that points out of the container, to see if the test fails inside the container.
Create read-only block device, char device, and fifo, to check if they are read-only as expected.