From c018b90a90bb61a89536a29d453391595173fa31 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Wed, 15 Nov 2023 16:46:00 -0800 Subject: [PATCH] update tests to tmt framework --- .fmf/version | 1 + .iscsi-initiator-utils.metadata | 1 + plans/sanity.fmf | 5 +++ plans/sts.fmf | 21 +++++++++++ .../iscsi-target-initiator-restraint/main.fmf | 13 +++++++ .../runtest.sh | 3 +- tests/tests.yml | 37 ------------------- 7 files changed, 42 insertions(+), 39 deletions(-) create mode 100644 .fmf/version create mode 100644 .iscsi-initiator-utils.metadata 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.metadata b/.iscsi-initiator-utils.metadata new file mode 100644 index 0000000..8531839 --- /dev/null +++ b/.iscsi-initiator-utils.metadata @@ -0,0 +1 @@ +eef1ee9663a36e32b87b1858b5da883b38f4d223 open-iscsi-a65a472.tar.gz 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 6087421..8847033 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. @@ -68,7 +67,7 @@ rlPhaseStartSetup if [ -f /etc/iscsi/initiatorname.iscsi ]; then . /etc/iscsi/initiatorname.iscsi else - echo "InitiatorName=`/usr/sbin/iscsi-iname`" > /etc/iscsi/initiatorname.iscsi + echo InitiatorName=`iscsi-iname` > /etc/iscsi/initiatorname.iscsi . /etc/iscsi/initiatorname.iscsi fi 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