Skip to content

Commit

Permalink
improve oom.conf;improve variable names
Browse files Browse the repository at this point in the history
Signed-off-by: pengshanyu <[email protected]>
  • Loading branch information
pengshanyu committed Mar 5, 2025
1 parent 8b558be commit 40d21e5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/ffi/disk/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@
. ../common/prepare.sh

check_var_partition(){
var_partition_name="part /var/qm"
name_of_qm_var_partition="part /var/qm"
seccomp_file_name="/usr/share/qm/seccomp.json"

# In the ostree image
if stat /run/ostree-booted > /dev/null 2>&1; then
var_partition_name="part /var"
name_of_qm_var_partition="part /var"
else
# In the centos cloud image
local release_id
release_id=$(grep -oP '(?<=^ID=)\w+' <<< "$(tr -d '"' < /etc/os-release)")
if [[ "$release_id" == "centos" ]]; then
var_partition_name="part /usr/lib/qm/rootfs/var"
name_of_qm_var_partition="part /usr/lib/qm/rootfs/var"
seccomp_file_name="/usr/share/qm/seccomp-no-rt.json"
fi
fi
# Prints all available block devices to make it easier to debug
lsblk
df -kh
exec_cmd "lsblk"
exec_cmd "df -kh"
# If there is no separate /var partition this test will terminate early
if [[ "$(lsblk -o 'MAJ:MIN,TYPE,MOUNTPOINTS')" =~ ${var_partition_name} ]]; then
if [[ "$(lsblk -o 'MAJ:MIN,TYPE,MOUNTPOINTS')" =~ ${name_of_qm_var_partition} ]]; then
info_message "A separate /var partition was detected on the image."
else
info_message "FAIL: No separate /var partition was detected on the image."
Expand All @@ -41,18 +45,14 @@ OOMScoreAdjust=1000
[Container]
PodmanArgs=
PodmanArgs=--pids-limit=-1 --security-opt seccomp=/usr/share/qm/seccomp-no-rt.json --security-opt label=nested --security-opt unmask=all --memory 5G
PodmanArgs=--pids-limit=-1 --security-opt seccomp=${seccomp_file_name} --security-opt label=nested --security-opt unmask=all --memory 5G
EOF
reload_config
prepare_images
exec_cmd "podman exec -it qm /bin/bash -c \
'podman run -d --replace --name ffi-qm \
quay.io/centos-sig-automotive/ffi-tools:latest \
tail -f /dev/null'"
run_container_in_qm "ffi-qm"
exec_cmd "podman exec -it qm /bin/bash -c \
'podman exec -it ffi-qm ./QM/file-allocate'"
Expand Down

0 comments on commit 40d21e5

Please sign in to comment.