-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #486 from pengshanyu/add-tier0-test
add tier-0 test case
- Loading branch information
Showing
23 changed files
with
310 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
summary: multiple bluechi-agents test - QM Interconnect through bluechi | ||
|
||
discover: | ||
how: fmf | ||
filter: tag:multi-bluechi-agents | ||
|
||
provision: | ||
how: local | ||
|
||
adjust: | ||
- when: distro == centos-stream-9 or distro == fedora | ||
prepare+: | ||
- name: Prepare Repos | ||
how: shell | ||
script: | | ||
dnf install -y dnf-plugin-config-manager epel-release | ||
dnf config-manager -y --set-enabled crb | ||
|
||
- name: install repos | ||
how: install | ||
package: | ||
- podman | ||
|
||
- name: Set QM env | ||
how: shell | ||
script: | | ||
cd tests/e2e | ||
./run-test-e2e --skip-tests=yes | ||
|
||
execute: | ||
how: tmt | ||
|
||
report: | ||
how: junit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,19 @@ | ||
summary: Tier 0 - QM Interconnect through bluechi | ||
summary: Tier 0 - QM sanity test | ||
|
||
discover: | ||
how: fmf | ||
filter: tier:0 | ||
|
||
provision: | ||
how: local | ||
|
||
adjust: | ||
- when: run == manual | ||
environment+: | ||
# Sample code to use manual packit repo | ||
PACKIT_COPR_PROJECT: packit/containers-qm-291 | ||
|
||
- when: distro == centos-stream-9 or distro == fedora | ||
prepare+: | ||
- name: Prepare Repos | ||
how: shell | ||
script: | | ||
dnf install -y dnf-plugin-config-manager epel-release | ||
dnf config-manager -y --set-enabled crb | ||
|
||
- name: install repos | ||
how: install | ||
package: | ||
- podman | ||
|
||
- name: Set QM env | ||
how: shell | ||
script: | | ||
cd tests/e2e | ||
./run-test-e2e --skip-tests=yes | ||
prepare+: | ||
- name: Set QM environment | ||
how: shell | ||
order: 50 | ||
script: | | ||
cd tests/e2e | ||
./set-ffi-env-e2e "${FFI_SETUP_OPTIONS}" | ||
|
||
execute: | ||
how: tmt | ||
|
||
report: | ||
how: junit | ||
how: junit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
summary: general data used by the test plans | ||
|
||
environment: | ||
FFI_SETUP_OPTIONS: none | ||
|
||
prepare: | ||
- name: Install podman | ||
how: install | ||
order: 20 | ||
package: | ||
- podman | ||
|
||
adjust: | ||
- when: run == manual | ||
environment+: | ||
# Sample code to use manual packit repo | ||
PACKIT_COPR_PROJECT: packit/containers-qm-291 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# QM sanity test | ||
|
||
This test suite do some basic sanity tests for qm to confirm that qm has been installed properly and the qm environment has been started successfully. | ||
|
||
## This Test Suite includes these tests | ||
|
||
1. Confirm that bluechi-controller is active and bluechi-agent is online. | ||
|
||
2. Confirm that host and QM bluechi-agent are connected to bluechi-controller. | ||
|
||
3. Confirm that qm is up and running. | ||
|
||
4. Confirm that podman in qm is ok. | ||
|
||
5. Confirm that podman run and exec container in qm with service file successfully. | ||
|
||
6. Confirm that /var partition exist. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
summary: Test bluechi-controller is active and bluechi-agent is online | ||
test: /bin/bash ./check_bluechi_controller_is_ok.sh | ||
duration: 10m | ||
tier: 0 | ||
framework: shell | ||
id: 44d1f92b-2885-49d3-900a-23cde296c9d8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash -euvx | ||
|
||
# shellcheck disable=SC1091 | ||
source ../e2e/lib/utils | ||
|
||
|
||
# Verify bluechi-controller is up and bluechictl is ok | ||
check_bluechi_controller_is_ok(){ | ||
if [ "$(systemctl is-active bluechi-controller)" == "active" ]; then | ||
info_message "check_bluechi_controller_is_ok(): bluechi-controller is active." | ||
info_message "PASS: check_bluechi_controller_is_ok()" | ||
else | ||
info_message "FAIL: check_bluechi_controller_is_ok(): bluechi-controller is not active." | ||
exit 1 | ||
fi | ||
|
||
regex_qm_localrootfs="qm.localrootfs * \| online" | ||
regex_ASIL_localrootfs="localrootfs * \| online" | ||
if [[ ! "$(bluechictl status)" =~ ${regex_qm_localrootfs} ]]; then | ||
info_message "FAIL: check_bluechi_controller_is_ok: Checking QM bluechi-agent online failed.\n $(bluechictl status)" | ||
exit 1 | ||
elif [[ ! "$(bluechictl status)" =~ ${regex_ASIL_localrootfs} ]]; then | ||
info_message "FAIL: check_bluechi_controller_is_ok: Checking host bluechi-agent online failed.\n $(bluechictl status)" | ||
exit 1 | ||
else | ||
info_message "check_bluechi_controller_is_ok: QM bluechi-agent is online." | ||
info_message "check_bluechi_controller_is_ok: host bluechi-agent is online." | ||
info_message "PASS: check_bluechi_controller_is_ok()" | ||
exit 0 | ||
fi | ||
} | ||
|
||
check_bluechi_controller_is_ok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
summary: Test host and QM bluechi-agent are connected to controller | ||
test: /bin/bash ./check_bluechi_is_ok.sh | ||
duration: 10m | ||
tier: 0 | ||
framework: shell | ||
id: 627318fa-b7bb-4d95-ab64-524911398a88 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash -euvx | ||
|
||
# shellcheck disable=SC1091 | ||
source ../e2e/lib/utils | ||
|
||
|
||
# Verify bluechi nodes are connected | ||
check_bluechi_is_ok(){ | ||
bluechi_controller_status=$(systemctl status bluechi-controller | tail -2) | ||
regex_ASIL_bluechi_agent="Registered managed node from fd [0-9]{1,2} as 'localrootfs'" | ||
regex_QM_bluechi_agent="Registered managed node from fd [0-9]{1,2} as 'qm.localrootfs'" | ||
|
||
if [[ ! "${bluechi_controller_status}" =~ ${regex_ASIL_bluechi_agent} ]]; then | ||
info_message "FAIL: check_bluechi_is_ok: host bluechi-agent is not connected to controller.\n ${bluechi_controller_status}" | ||
exit 1 | ||
elif [[ ! "${bluechi_controller_status}" =~ ${regex_QM_bluechi_agent} ]]; then | ||
info_message "FAIL: check_bluechi_is_ok: QM bluechi-agent is not connected to controller.\n ${bluechi_controller_status}" | ||
exit 1 | ||
else | ||
info_message "check_bluechi_is_ok: host bluechi-agent is connected to controller." | ||
info_message "check_bluechi_is_ok: QM bluechi-agent is connected to controller." | ||
info_message "PASS: check_bluechi_is_ok()" | ||
exit 0 | ||
fi | ||
} | ||
|
||
check_bluechi_is_ok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
summary: Test qm is up and running | ||
test: /bin/bash ./check_qm_is_up.sh | ||
duration: 10m | ||
tier: 0 | ||
framework: shell | ||
id: b82a5766-275b-4635-9c2a-7ab3d8c6dc05 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash -euvx | ||
|
||
# shellcheck disable=SC1091 | ||
source ../e2e/lib/utils | ||
|
||
# Verify qm is up and running | ||
check_qm_is_up(){ | ||
if [ "$(systemctl is-active qm)" == "active" ]; then | ||
info_message "check_qm_is_up(): qm is active" | ||
info_message "PASS: check_qm_is_up()" | ||
exit 0 | ||
else | ||
info_message "FAIL: check_qm_is_up(): qm is not active" | ||
exit 1 | ||
fi | ||
} | ||
|
||
check_qm_is_up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
summary: Test podman in qm is ok | ||
test: /bin/bash ./check_qm_podman_is_ok.sh | ||
duration: 10m | ||
tier: 0 | ||
framework: shell | ||
id: ac4aac07-094b-4d22-b5f6-b85bc39da119 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash -euvx | ||
|
||
# shellcheck disable=SC1091 | ||
source ../e2e/lib/utils | ||
|
||
# Verify podman in qm is ok | ||
check_qm_podman_is_ok(){ | ||
if podman exec qm bash -c "podman info" > /dev/null; then | ||
info_message "check_qm_podman_is_ok(): check 'podman info' in qm successfully." | ||
info_message "PASS: check_qm_podman_is_ok()" | ||
exit 0 | ||
else | ||
info_message "FAIL: check_qm_podman_is_ok(): check 'podman info' in qm failed.\n $(podman exec qm bash -c "podman info")" | ||
exit 1 | ||
fi | ||
} | ||
|
||
check_qm_podman_is_ok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
summary: Test podman run and exec container in qm with service file | ||
test: /bin/bash ./check_qm_podman_quadlet_is_ok.sh | ||
duration: 10m | ||
tier: 0 | ||
framework: shell | ||
id: b2071703-f9d4-4945-aa2d-0cf3abeaecb7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash -euvx | ||
|
||
# shellcheck disable=SC1091 | ||
source ../e2e/lib/utils | ||
|
||
# Verify podman run and exec container inside qm with service file | ||
check_qm_podman_quadlet_is_ok(){ | ||
info_message "check_qm_podman_quadlet_is_ok(): \ | ||
prepare quadlet files for qm-sanity-test.container" | ||
cat > "/etc/qm/containers/systemd/qm-sanity-test.container" <<EOF | ||
[Unit] | ||
Description=the qm-sanity-test sleep container | ||
After=local-fs.target | ||
[Container] | ||
Image=registry.access.redhat.com/ubi9-minimal:latest | ||
Exec=sleep 1000 | ||
[Install] | ||
# Start by default on boot | ||
WantedBy=multi-user.target default.target | ||
EOF | ||
|
||
info_message "check_qm_podman_quadlet_is_ok(): qm-sanity-test container reload & restart" | ||
exec_cmd_with_pass_info "podman exec qm systemctl daemon-reload" | ||
exec_cmd_with_pass_info "podman exec qm systemctl start qm-sanity-test" | ||
exec_cmd_with_pass_info "podman exec qm systemctl status qm-sanity-test | grep -i started" | ||
exec_cmd_with_pass_info "podman exec qm podman run alpine echo Hello QM" | ||
|
||
info_message "PASS: check_qm_podman_quadlet_is_ok()" | ||
exit 0 | ||
} | ||
|
||
exec_cmd_with_pass_info(){ | ||
local command="$1" | ||
exec_cmd "${command}" | ||
info_message "PASS: Command ${command} successful" | ||
} | ||
|
||
check_qm_podman_quadlet_is_ok |
Oops, something went wrong.