add c10s gating tests and tmt configs

This commit is contained in:
Scott Poore 2024-08-15 14:50:47 -05:00
parent 04ac3a23d0
commit 143d49997e
7 changed files with 92 additions and 0 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

8
plans/all.fmf Normal file
View File

@ -0,0 +1,8 @@
summary: Run gating tests
discover:
how: fmf
dist-git-source: true
dist-git-type: centos
execute:
how: tmt

6
tests/main.fmf Normal file
View File

@ -0,0 +1,6 @@
summary: Run python-oauthlib upstream tests
require:
- httpd
- python-requests-oauthlib
test: ./oauthtests.sh
duration: 30m

48
tests/oauthtests.sh Executable file
View File

@ -0,0 +1,48 @@
#!/bin/bash -x
PKG="python-requests-oauthlib"
die () {
echo "$1" >&2
exit 1
}
#
# install dependencies (pytest & blinker)
#
rm -rf venv
python3 -m venv --system-site-packages --symlinks venv
. venv/bin/activate
pip install -r requirements-tests.txt
PKG="python-requests-oauthlib"
# If source not found, download it with dnf
if [ ! -d ./source ]; then
# Extract source from srpm
echo "## source directory not found. attempting to download via rpm"
dnf download --source ${PKG} && \
rpm2cpio ${PKG}*.rpm|cpio -id && \
mkdir source && \
TARBALL="v$(rpm -q --qf="%{version}" -p ${PKG}*.rpm).tar.gz"
tar -zxf ${TARBALL} -C source --strip-components=1
if [ $? != 0 ]; then
echo "Failed to download upstream tests"
exit 1
fi
fi
# rename source code directory to be sure that we are
# testing files from our rpm
cd source || die "Missing source directory!"
#
# run upstream tests, skip jwt tests
#
pytest -p no:warnings -k "not testCanPostBinaryData and not test_content_type_override and not test_url_is_native_str"| tee oauthlib.log
RESULT=${PIPESTATUS[0]}
#
# cleanup
#
exit $RESULT

View File

@ -0,0 +1,6 @@
pytest==7.2
requests==2.26.0
oauthlib[signedtoken]==3.1.1
coveralls==3.2.0
mock==4.0.3
requests-mock==1.9.3

17
tests/tests.yml Normal file
View File

@ -0,0 +1,17 @@
---
- hosts: localhost
roles:
- role: standard-test-source
tags:
- always
- role: standard-test-basic
tags:
- classic
required_packages:
- python3-requests-oauthlib
tests:
- requests-oauthlib:
dir: .
run: ./oauthtests.sh
save-files: ["source/*.log"]