Skip to content

Commit

Permalink
Fixing tier-1 tests
Browse files Browse the repository at this point in the history
Tmt connectivity test fo AutoSD container was broken

Signed-off-by: Yariv Rachmani <[email protected]>
  • Loading branch information
Yarboa committed Nov 8, 2023
1 parent df39515 commit 17c1873
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 24 deletions.
5 changes: 3 additions & 2 deletions plans/e2e/tier-1.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ adjust:
- name: Install rpms
how: install
package: podman
- name: Setp AutoSD env

- name: Setup AutoSD env
how: shell
script: |
# Currently option passing c9s
podman run --replace -d --name autosd \
--privileged -it \
--privileged \
quay.io/centos-sig-automotive/autosd:latest
when: distro == centos-stream-9 or distro == fedora

Expand Down
22 changes: 11 additions & 11 deletions tests/e2e/lib/tests
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ readarray -d ' ' -t NODES_FOR_TESTING <<< "$NODES_FOR_TESTING_ARR"
CONTROL_CONTAINER_NAME="${CONTROL_CONTAINER_NAME:-control}"

test_bluechi_list_all_units() {

local bluechictl_cmd

for node_name in "${NODES_FOR_TESTING[@]}"
do
echo
info_message "Connected to \033[92m${CONTROL_CONTAINER_NAME}\033[0m, listing few systemd units from \033[92m${node_name}\033[0m"
if [ "${CONTROL_CONTAINER_NAME}" = "host" ]; then
bluechictl_cmd=$(eval "bluechictl \
list-units \
${node_name}"
)
if [ "${CONTROL_CONTAINER_NAME}" == "host" ]; then
bluechictl_cmd="bluechictl list-units ${node_name}"
else
bluechictl_cmd=$(eval "podman exec \
${CONTROL_CONTAINER_NAME} \
bluechictl \
list-units \
${node_name}"
)
bluechictl_cmd="podman exec"
bluechictl_cmd+=" ${CONTROL_CONTAINER_NAME}"
bluechictl_cmd+=" bluechictl list-units ${node_name}"
sleep 1
fi
eval "${bluechictl_cmd}"

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

if [ "${CONTROL_CONTAINER_NAME}" = "host" -o "${CONTROL_CONTAINER_NAME}" = "autosd" ]; then
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/lib/utils
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ info_message() {
exec_cmd() {
local cmd="$1"
eval "$cmd"
if_error_exit "Error: Command "$cmd" failed"
if_error_exit "Error: Command $cmd failed"
}

cleanup() {
Expand Down
12 changes: 4 additions & 8 deletions tests/qm-connectivity/main.fmf
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
test:
./test.sh

/tier0:
summary: Test is calling e2e/lib/tests as stand alone test
test:
Expand All @@ -9,12 +6,11 @@ test:

/tier1:
summary: Test is calling e2e/lib/tests AutoSD container
test:
./test.sh
tier: 1
tag: ffi
environment:
CONTROL_CONTAINER_NAME: "autosd"
NODES_FOR_TESTING_ARR: "localrootfs qm.localrootfs"
NODES_FOR_TESTING_ARR: "qm.localrootfs localrootfs"
test:
bash -x ./test.sh
tier: 1
framework:
shell
4 changes: 2 additions & 2 deletions tests/qm-connectivity/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

# shellcheck disable=SC1094
# shellcheck source=tests/e2e/lib/utils
. ../e2e/lib/utils
source ../e2e/lib/utils

# shellcheck disable=SC1094
# shellcheck source=tests/e2e/lib/utils
. ../e2e/lib/tests
source ../e2e/lib/tests

test_bluechi_list_all_units

0 comments on commit 17c1873

Please sign in to comment.