Add a smoke test

Upstreamed from rhel's Sanity/smoke

Commit hash: a3e2fcfaef1fe4ffa257bdc21d535c9cdc35cafd
Only the test file was kept.
This commit is contained in:
Braňo Náter 2024-09-10 11:59:45 +02:00 committed by Karolina Surma
parent 3d04712705
commit 86043638bc
2 changed files with 14 additions and 0 deletions

5
tests/smoke/smoke.fmf Normal file
View File

@ -0,0 +1,5 @@
test: python3 test.py
framework: shell
require:
- python3
- python3-urllib3

9
tests/smoke/test.py Normal file
View File

@ -0,0 +1,9 @@
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'http://example.com/')
print('status = {0}'.format(r.status))
print("headers['server'] = {0}".format(r.headers['server']))
print(r.data)
if r.status != 200 or not r.data:
raise SystemExit(1)