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

ffi: qm-oom-score-adj/test.sh improvement #497

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions tests/ffi/qm-oom-score-adj/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,28 @@ QM_OOM_SCORE_ADJ=$(cat "/proc/$QM_PID/oom_score_adj")
QM_FFI_OOM_SCORE_ADJ=$(podman exec -it qm /bin/bash -c "cat /proc/$QM_FFI_PID/oom_score_adj" | tr -d '\r')


# Define a constant for the oom_score_adj value
# "500" is the oom_score_adj defined for the qm/qm.container.
if [ "$QM_OOM_SCORE_ADJ" -eq "500" ]; then
info_message "PASS: qm.container oom_score_adj value == 500"
OOM_SCORE_ADJ_EXPECTED=500

if [ "$QM_OOM_SCORE_ADJ" -eq "$OOM_SCORE_ADJ_EXPECTED" ]; then
info_message "PASS: qm.container oom_score_adj value == $OOM_SCORE_ADJ_EXPECTED"
else
info_message "FAIL: qm.container oom_score_adj value != 500"
info_message "FAIL: qm.container oom_score_adj value != $OOM_SCORE_ADJ_EXPECTED. Current value is ${QM_OOM_SCORE_ADJ}"
exit 1
fi


# "750" is the oom_score_adj defined in the qm/containers.conf as default value
# for the containers that would run inside of the qm container.
if [ "$QM_FFI_OOM_SCORE_ADJ" -eq "750" ]; then
info_message "PASS: qm containers oom_score_adj == 750"
# Check the oom_score_adj value for QM FFI
FFI_OOM_SCORE_ADJ_EXPECTED=750

if [ "$QM_FFI_OOM_SCORE_ADJ" -eq "$FFI_OOM_SCORE_ADJ_EXPECTED" ]; then
info_message "PASS: qm containers oom_score_adj == $FFI_OOM_SCORE_ADJ_EXPECTED"
else
info_message "FAIL: qm containers oom_score_adj != 750"
info_message "FAIL: qm containers oom_score_adj != $FFI_OOM_SCORE_ADJ_EXPECTED. Current value is ${QM_FFI_OOM_SCORE_ADJ}"
exit 1
fi


podman exec -it qm /bin/bash -c "podman stop ffi-qm > /dev/null"