From 86043638bcd8bbdbb05e9eb7fb525b364a7d154d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bra=C5=88o=20N=C3=A1ter?= Date: Tue, 10 Sep 2024 11:59:45 +0200 Subject: [PATCH] Add a smoke test Upstreamed from rhel's Sanity/smoke Commit hash: a3e2fcfaef1fe4ffa257bdc21d535c9cdc35cafd Only the test file was kept. --- tests/smoke/smoke.fmf | 5 +++++ tests/smoke/test.py | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/smoke/smoke.fmf create mode 100644 tests/smoke/test.py diff --git a/tests/smoke/smoke.fmf b/tests/smoke/smoke.fmf new file mode 100644 index 0000000..69c01da --- /dev/null +++ b/tests/smoke/smoke.fmf @@ -0,0 +1,5 @@ +test: python3 test.py +framework: shell +require: +- python3 +- python3-urllib3 diff --git a/tests/smoke/test.py b/tests/smoke/test.py new file mode 100644 index 0000000..d622ddd --- /dev/null +++ b/tests/smoke/test.py @@ -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)