From a7b762063216e49c0741bced8d74ecd5f60e600d Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Tue, 10 Sep 2024 13:29:43 +0200 Subject: [PATCH] Add a smoke test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstreamed from rhel's Sanity/smoke Commit hash: a3e2fcfaef1fe4ffa257bdc21d535c9cdc35cafd Only the test file was kept. Co-Authored-By: Braňo Náter --- .fmf/version | 1 + plans.fmf | 4 ++++ tests/smoke/smoke.fmf | 5 +++++ tests/smoke/test.py | 9 +++++++++ 4 files changed, 19 insertions(+) create mode 100644 .fmf/version create mode 100644 plans.fmf create mode 100644 tests/smoke/smoke.fmf create mode 100644 tests/smoke/test.py diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans.fmf b/plans.fmf new file mode 100644 index 0000000..2bb6f53 --- /dev/null +++ b/plans.fmf @@ -0,0 +1,4 @@ +discover: + how: fmf +execute: + how: tmt \ No newline at end of file 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)