-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Card ID: CCT-741 * Added basic configuration for tmt - subscription-manager is installed from COPR build - Python virtual environment is created - Install testing framework - Some simple smoke test is run (busctl calls RHSM D-Bus method)
- Loading branch information
1 parent
71c526e
commit 5365981
Showing
9 changed files
with
109 additions
and
0 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
Empty file.
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,3 @@ | ||
git+https://github.com/ptoscano/pytest-client-tools@main | ||
pyyaml | ||
sh |
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,24 @@ | ||
""" | ||
This Python module contains integration tests for rhc. | ||
It uses pytest-client-tools Python module.More information about this | ||
module could be found: https://github.com/ptoscano/pytest-client-tools/ | ||
""" | ||
|
||
import contextlib | ||
import sh | ||
|
||
|
||
def test_busctl_get_consumer_uuid(): | ||
""" | ||
Simple smoke test using busctl CLI tool. It tries to call simple D-Bus method. | ||
""" | ||
with contextlib.suppress(Exception): | ||
sh.busctl( | ||
"call", | ||
"com.redhat.RHSM1", | ||
"/com/redhat/RHSM1/Consumer", | ||
"com.redhat.RHSM1.Consumer", | ||
"GetUuid", | ||
"s", | ||
'""', | ||
) |
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 @@ | ||
1 |
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,16 @@ | ||
#!/usr/bin/bash -eux | ||
dnf install -y dnf-plugins-core | ||
|
||
# Determine the repo needed from copr | ||
source /etc/os-release | ||
|
||
if [ "$ID" == "centos" ]; then | ||
ID='centos-stream' | ||
fi | ||
VERSION_MAJOR=$(echo "${VERSION_ID}" | cut -d '.' -f 1) | ||
COPR_REPO="${ID}-${VERSION_MAJOR}-$(uname -m)" | ||
|
||
# Install subscription-manager from COPR repository | ||
dnf remove -y --noautoremove subscription-manager | ||
dnf copr -y enable packit/candlepin-subscription-manager-"${ghprbPullId}" "${COPR_REPO}" | ||
dnf install -y subscription-manager --disablerepo=* --enablerepo=*subscription-manager* |
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,5 @@ | ||
summary: rhsm test suite | ||
discover: | ||
how: fmf | ||
execute: | ||
how: tmt |
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,3 @@ | ||
summary: Runs tmt tests | ||
test: ./test.sh | ||
duration: 1h |
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,31 @@ | ||
#!/bin/bash | ||
set -ux | ||
|
||
# get to project root | ||
cd ../../../ | ||
|
||
# Check for GitHub pull request ID and install build if needed. | ||
# This is for the downstream PR jobs. | ||
[ -z "${ghprbPullId+x}" ] || ./systemtest/copr-setup.sh | ||
|
||
dnf --setopt install_weak_deps=False install -y \ | ||
podman git-core python3-pip python3-pytest logrotate | ||
|
||
python3 -m venv venv | ||
# shellcheck disable=SC1091 | ||
. venv/bin/activate | ||
|
||
# Install requirements for integration tests | ||
pip install -r integration-tests/requirements.txt | ||
|
||
# Run all integration tests | ||
pytest --junit-xml=./junit.xml -v integration-tests | ||
retval=$? | ||
|
||
# Copy artifacts of integration tests | ||
if [ -d "$TMT_PLAN_DATA" ]; then | ||
cp ./junit.xml "$TMT_PLAN_DATA/junit.xml" | ||
fi | ||
|
||
# Return exit code of integration tests | ||
exit $retval |