-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/ffi: add test checking /sys is read-only
Test to ensure that /sys is read-only inside the QM container. Signed-off-by: Albert Esteve <[email protected]>
- Loading branch information
1 parent
e5bc702
commit 029685c
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Title: | ||
Verifies that /sys is read-only in QM partition. | ||
|
||
Description: | ||
This test executes `test -r /sys && test ! -w /sys` in QM partition, no other input. | ||
podman exec qm "test -r /sys && test ! -w /sys" | ||
|
||
Expected result: | ||
out: [ INFO ] PASS: check_sys_read_only: As expected, /sys is read-only in QM partition. | ||
|
||
Jira: | ||
VROOM-24445 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# FFI - sys_read_only | ||
|
||
This test is intended to confirm that /sys is read-only in QM partition. | ||
|
||
## This Test Set includes these tests | ||
|
||
1. Confirm that /sys is read-only in QM partition. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
summary: Test that /sys is read-only in QM partition. | ||
description: | | ||
This tests confirms that /sys folder is present and read-only in the QM | ||
partition. The test executes `test -r /sys && test ! -w /sys` in QM | ||
partition, no other input. | ||
|
||
Test inputs: | ||
None | ||
|
||
Expected results: | ||
out: [ INFO ] PASS: check_sys_read_only: As expected, /sys is read-only in QM partition. | ||
|
||
Results location: | ||
output.txt | ||
contact: Albert Esteve <[email protected]> | ||
test: /bin/bash ./test.sh | ||
duration: 10m | ||
tag: ffi | ||
framework: shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash -euvx | ||
|
||
# shellcheck disable=SC1091 | ||
. ../../e2e/lib/utils | ||
|
||
check_sys_read_only(){ | ||
# Check /sys is read-only in QM partition | ||
if podman exec qm /bin/sh -c 'test -r /sys && test ! -w /sys'; then | ||
info_message "PASS: check_sys_read_only: As expected, /sys is read-only in QM partition." | ||
exit 0 | ||
else | ||
info_message "Found a non-read-only /sys folder in QM partition: $(podman exec -t qm ls -ld /sys)" | ||
info_message "FAIL: check_sys_read_only: Check for /sys in QM partition failed, it should be read-only." | ||
exit 1 | ||
fi | ||
} | ||
|
||
check_sys_read_only |