From bccc3717ed5ac5e31a390e16244b21922556af02 Mon Sep 17 00:00:00 2001 From: Martin Hoyer Date: Mon, 12 Jun 2023 16:17:20 +0200 Subject: [PATCH] Move to tmt test framework --- .fmf/version | 1 + iscsi-initiator-utils.spec | 5 ++- plans/sanity.fmf | 5 +++ plans/sts.fmf | 21 +++++++++++ .../iscsi-target-initiator-restraint/main.fmf | 13 +++++++ .../runtest.sh | 1 - tests/tests.yml | 37 ------------------- 7 files changed, 44 insertions(+), 39 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/sanity.fmf create mode 100644 plans/sts.fmf create mode 100644 tests/iscsi-target-initiator-restraint/main.fmf delete mode 100644 tests/tests.yml 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/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index 5308cb9..f63667b 100644 --- a/iscsi-initiator-utils.spec +++ b/iscsi-initiator-utils.spec @@ -13,7 +13,7 @@ Summary: iSCSI daemon and utility programs Name: iscsi-initiator-utils Version: 6.%{open_iscsi_version}.%{open_iscsi_build} -Release: 6.git%{shortcommit0}%{?dist} +Release: 7.git%{shortcommit0}%{?dist} Group: System Environment/Daemons License: GPLv2+ URL: http://www.open-iscsi.org @@ -364,6 +364,9 @@ fi %{python3_sitearch}/* %changelog +* Thu Jun 15 2023 Chris Leech - 6.2.1.4-7.git095f59c +- move tests to tmt framework + * Tue Jun 13 2023 Chris Leech - 6.2.1.4-6.git095f59c - restore missing gating tests diff --git a/plans/sanity.fmf b/plans/sanity.fmf new file mode 100644 index 0000000..3c6a820 --- /dev/null +++ b/plans/sanity.fmf @@ -0,0 +1,5 @@ +summary: Run relevant tests from the tests directory +discover: + how: fmf +execute: + how: tmt diff --git a/plans/sts.fmf b/plans/sts.fmf new file mode 100644 index 0000000..685ef9b --- /dev/null +++ b/plans/sts.fmf @@ -0,0 +1,21 @@ +summary: Tier 0 iSCSI initiator tests +discover: + how: fmf + url: https://gitlab.com/rh-kernel-stqe/sts + ref: fedora + filter: + - tier:0 + - tag:iscsi + - tag:local +context: + component: iscsi-initiator-utils +execute: + how: tmt +environment: + STS_VENV_PATH: /opt/sts-venv +prepare: + - name: install-sts-libs + how: shell + script: > + curl --retry 3 --retry-delay 5 --connect-timeout 10 --max-time 30 -s + https://gitlab.com/rh-kernel-stqe/sts/-/raw/fedora/scripts/install-sts-libs.sh | bash diff --git a/tests/iscsi-target-initiator-restraint/main.fmf b/tests/iscsi-target-initiator-restraint/main.fmf new file mode 100644 index 0000000..aefdac9 --- /dev/null +++ b/tests/iscsi-target-initiator-restraint/main.fmf @@ -0,0 +1,13 @@ +summary: Creates iSCSI target/initiator, and logs it in locally +description: '' +contact: Andy Walsh +component: + - iscsi-initiator-utils +test: ./runtest.sh +framework: beakerlib +recommend: + - test_beakertask +duration: 5m +extra-summary: /beaker_nvr_test +extra-task: /beaker_nvr_test +tier: 0 diff --git a/tests/iscsi-target-initiator-restraint/runtest.sh b/tests/iscsi-target-initiator-restraint/runtest.sh index 0a366be..91efc91 100755 --- a/tests/iscsi-target-initiator-restraint/runtest.sh +++ b/tests/iscsi-target-initiator-restraint/runtest.sh @@ -26,7 +26,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include Beaker environment -. /usr/bin/rhts-environment.sh || exit 1 . /usr/share/beakerlib/beakerlib.sh || exit 1 # Set up a target IQN to use through the test. diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 9c6bdce..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -# Tests suitable to run in classic environment -- hosts: localhost - roles: - - role: standard-test-beakerlib - tags: - - classic - tests: - - iscsi-target-initiator-restraint - required_packages: - - targetcli - -- hosts: localhost - roles: - - role: standard-test-basic - # python-stqe cannot be installed on 'atomic', no need to run on 'container' - tags: - - classic - repositories: - - repo: "https://gitlab.com/rh-kernel-stqe/python-stqe.git" - dest: "python-stqe" - version: 535ecebf5611e158079d806b6232e3d2c68f0d93 - tests: - # Install python-stqe first - # make sure we use same version of libsan - - install_stqe: - dir: python-stqe - run: pip3 install libsan==0.3.0 && python3 setup.py install --prefix= - - iscsi-initiator-utils: - dir: ./ - run: stqe-test run -t iscsi/iscsi_params.py - required_packages: - # required for python-stqe - - python3-pyyaml - - python3-netifaces - - python3-augeas - - python3-pip