Add tmt gating plan

Cherry-picked from python3.11-PyMySQL db207444c9844fcb22b827c887faee56fcb01bc7
db207444c9
This commit is contained in:
Lukas Zachar 2024-01-11 13:12:42 +01:00 committed by Miro Hrončok
parent abb5f302ea
commit be493ddc2e
5 changed files with 36 additions and 0 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

7
gating.yaml Normal file
View File

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

8
plan.fmf Normal file
View File

@ -0,0 +1,8 @@
execute:
how: tmt
discover:
- how: shell
tests:
- name: simple import
test: python3.12 -c 'import pymysql'
- how: fmf

8
tests/smoke_test.fmf Normal file
View File

@ -0,0 +1,8 @@
require:
- mariadb-server
- python3.12-PyMySQL
test: |
systemctl start mariadb &&
python3.12 smoke_test.py &&
systemctl stop mariadb

12
tests/smoke_test.py Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/python3
# Modified from
# https://github.com/PyMySQL/PyMySQL/blob/v1.0.2/example.py
import pymysql
connection = pymysql.connect(unix_socket="/var/lib/mysql/mysql.sock", db="mysql")
cursor = connection.cursor()
cursor.execute("SELECT Host,User FROM user")
print(cursor.description)
cursor.close()
connection.close()