Skip to content

Commit

Permalink
Adding FFI memeory test
Browse files Browse the repository at this point in the history
Adding tmt FFI plan running ffi tests
Prepare script per images,
c9s, fedora, autosd (vm)
followed by test running cotainer and verify systemd activated oom killer

Adding supoport in OS based prepares
Tmt tests requires, to use tmt --context with scenario=ffi, distro=<os type> run ..

ffi-tools container image is downloaded from sig container-images

Signed-off-by: Yariv Rachmani <[email protected]>
  • Loading branch information
Yarboa committed Oct 22, 2023
1 parent e5698e3 commit 80270f1
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plans/e2e/ffi.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ adjust:
script: |
cd tests/e2e
./set-ffi-env-e2e --qm-setup-from-gh-url=https://raw.githubusercontent.com/containers
when: scenario == ffi
when: scenario == ffi and distro == centos-stream-9, fedora

execute:
how: tmt
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ tmt run plans -n /plans/e2e/tier-0

or connecting to VM:

tmt run -c distro=centos-stream-9 -a \
tmt -c distro=centos-stream-9 run -a \
provision --how connect -u root -p ${PASSWORD} -P ${PORT} -g localhost \
plans -n /plans/e2e/tier-0
```
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/tools/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
The `remove-containers` script will remove all containers (and images) which name start with node* or control from the output of podman ps. Useful to cleanup environment before executing tests and measures.

### Freedom From Interference

Under FFI c binaries build in different [automotive-repo](https://gitlab.com/CentOS/automotive/container-images/-/tree/main/images/ffi-tools)
8 changes: 8 additions & 0 deletions tests/ffi/memory/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
summary: Test is calling systemd as stand alone test
test:
/bin/bash ./test.sh

tag: ffi

framework:
shell
22 changes: 22 additions & 0 deletions tests/ffi/memory/prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# shellcheck disable=SC1091


prepare_test() {

qm_service_file=$(systemctl show -P SourcePath qm)

#create backup file for qm unit file
qm_service_backup=$(mktemp -d -p /tmp)/qm.service
cp "${qm_service_file}" "${qm_service_backup}"

# Keep definition for the test not to survive reboot
#systemctl set-property --runtime qm ManagedOOMMemoryPressure=kill
}

reload_config() {

systemctl daemon-reload
systemctl restart qm

}
18 changes: 18 additions & 0 deletions tests/ffi/memory/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash -eux

# shellcheck disable=SC1091

. ../memory/prepare.sh

prepare_test
reload_config

podman run --replace -d --name ffi-asil \
https://quay.io/repository/centos-sig-automotive/ffi-tools:latest \
./ASIL/20_percent_memory_eat > /dev/null

podman exec -it qm /bin/bash -c \
"podman run --rm -it https://quay.io/repository/centos-sig-automotive/ffi-tools \
./QM/90_percent_memory_eat > /dev/null"

systemctl status qm --no-pager | grep "qm.service: A process of this unit has been killed"

0 comments on commit 80270f1

Please sign in to comment.