Skip to content

Commit

Permalink
Add sysctl case for FFI
Browse files Browse the repository at this point in the history
Test case will execute sysctl inside nested container running on top of QM

Jira-URL: https://issues.redhat.com/browse/VROOM-19309
Signed-off-by: weiwang <[email protected]>
  • Loading branch information
weiwang-linda committed May 29, 2024
1 parent d5a4668 commit 2c85b31
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/ffi/sysctl/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
summary: Executing sysctl inside nested container running on top of QM
test: /bin/bash ./test.sh
duration: 20m
tag: ffi
framework: shell
id: f615d356-9bf9-4de2-a007-7a99eca2bc48
29 changes: 29 additions & 0 deletions tests/ffi/sysctl/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash -euvx

# shellcheck disable=SC1091

. ../common/prepare.sh

export QM_HOST_REGISTRY_DIR="/var/qm/lib/containers/registry"
export QM_REGISTRY_DIR="/var/lib/containers/registry"

disk_cleanup
prepare_test
reload_config

exec_cmd "podman run -d --rm --replace -d --name ffi-asil \
quay.io/centos-sig-automotive/ffi-tools:latest > /dev/null"

image_id=$(podman images | grep quay.io/centos-sig-automotive/ffi-tools | awk -F " " '{print $3}')
if [ ! -d "${QM_HOST_REGISTRY_DIR}" ]; then
exec_cmd "mkdir -p ${QM_HOST_REGISTRY_DIR}"
exec_cmd "podman push ${image_id} dir:${QM_HOST_REGISTRY_DIR}/ffi-tools:latest"
fi

podman exec -it qm /bin/bash -c \
"podman run --replace --name ffi-qm dir:${QM_REGISTRY_DIR}/ffi-tools:latest \
./setsysctl > /dev/null"

if [ $? -eq 137 ]; then
echo ffi-qm was killed by SIGKILL
fi

0 comments on commit 2c85b31

Please sign in to comment.