diff --git a/tests/.fmf/version b/.fmf/version similarity index 100% rename from tests/.fmf/version rename to .fmf/version diff --git a/gating.yaml b/gating.yaml index 4ca9235..ef3bddb 100644 --- a/gating.yaml +++ b/gating.yaml @@ -3,4 +3,4 @@ product_versions: - rhel-10 decision_context: osci_compose_gate rules: - - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tests.functional} diff --git a/plans/tests.fmf b/plans/tests.fmf new file mode 100644 index 0000000..0c5f7d3 --- /dev/null +++ b/plans/tests.fmf @@ -0,0 +1,37 @@ +summary: libblockdev gating tests + +prepare: + how: install + package: + - python3 + - python3-dbus + - libblockdev-plugins-all + - python3-yaml + - targetcli + - stratis-cli + - stratisd + +discover: + how: shell + url: https://gitlab.com/redhat/centos-stream/rpms/python-blivet.git + ref: c10s + dist-git-source: true + dist-git-install-builddeps: true + tests: + - name: upstream test suite + test: | + set -x + if [ -z "$PKG_VER" ]; then + PKG_VER=`rpmspec -q --srpm --qf "%{version}" python-blivet.spec` + fi + if [ -z "$PKG_VER" ]; then + echo "Error: Unable to extract package version" + exit 1 + fi + pushd $TMT_SOURCE_DIR/blivet-${PKG_VER} + + blivet_path=$(find /usr/ -path */site-packages | tr '\n' ':') + PYTHONPATH=$blivet_path python3 tests/run_tests.py + +execute: + - how: tmt diff --git a/tests/lvm_factory.py b/tests/lvm_factory.py deleted file mode 100644 index 6603af2..0000000 --- a/tests/lvm_factory.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/python3 - -import argparse -import sys - -import blivet - - -POOL_NAME = "blivet_test" - -parser = argparse.ArgumentParser() -parser.add_argument('-d', '--disks', default='') -args = parser.parse_args() - -b = blivet.Blivet() -b.reset() - -disks = list() -for disk_id in args.disks.split(','): - disk = b.devicetree.resolve_device(disk_id) - if not disk.is_disk: - sys.stderr.write("specified disk '%s' is not a disk\n" % disk_id) - sys.exit(1) - - disks.append(disk) - b.initialize_disk(disk) - -if len(disks) > 1: - container_raid_level = "raid1" - total_size = min(d.size for d in disks) -else: - container_raid_level = None - total_size = sum(d.size for d in disks) - -lv1 = b.factory_device(size=total_size*0.8, disks=disks, - name="lv1", container_name=POOL_NAME, - fstype='xfs', device_type=blivet.devicefactory.DEVICE_TYPE_LVM) -lv2 = b.factory_device(disks=disks, name="lv2", - container_name=POOL_NAME, container_raid_level='raid1', - fstype='ext4', device_type=blivet.devicefactory.DEVICE_TYPE_LVM) - -b.do_it() diff --git a/tests/provision.fmf b/tests/provision.fmf deleted file mode 100644 index be22d73..0000000 --- a/tests/provision.fmf +++ /dev/null @@ -1,8 +0,0 @@ ---- - -standard-inventory-qcow2: - qemu: - m: 1G - drive: - - size: 10737418240 - - size: 10737418240 diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 4ca1638..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -# - hosts: localhost -- hosts: all - roles: - - role: standard-test-source - tags: - - always - - - role: standard-test-basic - tags: - - atomic - - classic - required_packages: - - python3 - - python3-dbus - - libblockdev-plugins-all - - python3-yaml - - targetcli - - stratis-cli - - stratisd - tests: - - unit-tests: - dir: . - run: ./unit_testing.sh - diff --git a/tests/unit_testing.sh b/tests/unit_testing.sh deleted file mode 100644 index e028333..0000000 --- a/tests/unit_testing.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Bail out if anything goes wrong -set -e - -# Get path to blivet -blivet_path=$(find /usr/ -path */site-packages | tr '\n' ':') - -# Run upstream unit tests -cd ./source/ -PYTHONPATH=$blivet_path python3 tests/run_tests.py