Skip to content

Commit

Permalink
check /dev/mem is not present in QM partition
Browse files Browse the repository at this point in the history
Signed-off-by: pengshanyu <[email protected]>

add a single newline

Signed-off-by: pengshanyu <[email protected]>

remove -i and -a option

Signed-off-by: pengshanyu <[email protected]>

change test name

Signed-off-by: pengshanyu <[email protected]>

use test -e to check if file exists

Signed-off-by: pengshanyu <[email protected]>

remove output redirection

Signed-off-by: pengshanyu <[email protected]>

replace hyphen with low-line

Signed-off-by: pengshanyu <[email protected]>
  • Loading branch information
pengshanyu committed Aug 8, 2024
1 parent 7d08fe4 commit 7f40a32
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/ffi/dev_mem_not_present/PURPOSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Verifies that /dev/mem is not present in QM partition.

This test execute `test -e /dev/mem` in QM partition, no other input.
podman exec qm test -e /dev/mem

Expected result:
out: [ INFO ] PASS: check_dev_mem_not_present: As expected, /dev/mem is not present in QM partition.

Results location:
/plans/e2e/ffi/report/default-0/junit.xml
7 changes: 7 additions & 0 deletions tests/ffi/dev_mem_not_present/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# FFI - dev_mem_not_present

This test is intended to confirm that /dev/mem is not present in QM partition.

## This Test Set includes these tests

1. Confirm that /dev/mem is not present in QM partition.
5 changes: 5 additions & 0 deletions tests/ffi/dev_mem_not_present/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
summary: Test /dev/mem is not present in QM partition.
test: /bin/bash ./test.sh
duration: 10m
tag: ffi
framework: shell
18 changes: 18 additions & 0 deletions tests/ffi/dev_mem_not_present/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash -euvx

# shellcheck disable=SC1091
. ../../e2e/lib/utils

check_dev_mem_not_present(){
# Check /dev/mem is not present in QM partition
if podman exec qm test -e /dev/mem; then
info_message "Found /dev/mem in QM partition: $(podman exec -t qm ls -l /dev/mem)"
info_message "FAIL: check_dev_mem_not_present: Check for /dev/mem in QM partition failed, it should not be present."
exit 1
else
info_message "PASS: check_dev_mem_not_present: As expected, /dev/mem is not present in QM partition."
exit 0
fi
}

check_dev_mem_not_present

0 comments on commit 7f40a32

Please sign in to comment.