Skip to content

Commit

Permalink
ffi test fmf location has changed
Browse files Browse the repository at this point in the history
Moving test ffi fmf -> /tests/ffi/qm-unit-files
fmf.
Once test discover it calls
/tests/qm-unit-files/test.bash with the relevent env_vars

Signed-off-by: Yariv Rachmani <[email protected]>
  • Loading branch information
Yarboa authored and dougsland committed Nov 28, 2023
1 parent ec07409 commit 0b03bda
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion plans/e2e/ffi.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ adjust:
# qm-setup-from-gh-url, branch-qm option
script: |
cd tests/e2e
./set-ffi-env-e2e --branch-qm=main --qm-setup-from-gh-url=https://raw.githubusercontent.com/containers --set-qm-disk-part=Y
./set-ffi-env-e2e --branch-qm=main --qm-setup-from-gh-url=https://raw.githubusercontent.com/containers --set-qm-disk-part=yes
when: scenario == ffi and distro == centos-stream-9, fedora

execute:
Expand Down
11 changes: 11 additions & 0 deletions tests/ffi/qm-unit-files/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
summary: Test is testing FFI setup
environment:
CONTROL_CONTAINER_NAME: "host"
test:
./test.sh
path:
/tests/qm-unit-files/
tag: ffi

framework:
shell
10 changes: 2 additions & 8 deletions tests/qm-unit-files/main.fmf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/tier0:
environment:
CONTROL_CONTAINER_NAME: "node1"
summary: Test is calling e2e/lib/tests as stand alone test
test:
./test.sh
Expand All @@ -12,13 +14,5 @@
./test.sh
tier: 1

/ffi:
summary: Test is testing FFI setup
environment:
CONTROL_CONTAINER_NAME: "host"
test:
./test.sh

tag: ffi
framework:
shell
12 changes: 7 additions & 5 deletions tests/qm-unit-files/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -ux

# shellcheck disable=SC1094
# shellcheck source=tests/e2e/lib/utils
source ../e2e/lib/utils
Expand All @@ -13,15 +15,15 @@ test_qm_readonly_unit_file() {
echo
info_message "Connected to \033[92m${CONTROL_CONTAINER_NAME}\033[0m, trying to update unit file"
if [ "${CONTROL_CONTAINER_NAME}" != "host" ]; then
qm_cmd="podman exec -c "
qm_cmd="podman exec "
qm_cmd+="${CONTROL_CONTAINER_NAME} "
fi
qm_cmd+="'podman exec qm bash -c "echo true >> /usr/lib/systemd/system/bluechi-agent.service"' 2>&1"
qm_cmd+="podman exec qm bash -c 'echo true >> /usr/lib/systemd/system/bluechi-agent.service' 2>&1"
sleep 1
cmd_result=$(eval "${qm_cmd}")

if_error_exit "unable to execute qm command on ${CONTROL_CONTAINER_NAME}"

grep -E "Read-only file system" <<< "${cmd_result}"

if_error_exit "Expecting Read-only file system"
}

test_qm_readonly_unit_file

0 comments on commit 0b03bda

Please sign in to comment.