From 12ab8f2f02e0384d0991ff5920cdc703172657b9 Mon Sep 17 00:00:00 2001 From: Viktor Ashirov Date: Wed, 4 Dec 2024 14:48:30 +0100 Subject: [PATCH] Migrate gating tests from STI to FMF --- .fmf/version | 1 + plans/gating.fmf | 21 ++++++ tests/smoke-test/Makefile | 85 ------------------------ tests/smoke-test/PURPOSE | 3 - tests/smoke-test/runtest.sh | 126 ------------------------------------ tests/tests.yml | 34 ---------- 6 files changed, 22 insertions(+), 248 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/gating.fmf delete mode 100644 tests/smoke-test/Makefile delete mode 100644 tests/smoke-test/PURPOSE delete mode 100755 tests/smoke-test/runtest.sh 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/plans/gating.fmf b/plans/gating.fmf new file mode 100644 index 0000000..aea6711 --- /dev/null +++ b/plans/gating.fmf @@ -0,0 +1,21 @@ +summary: Regression test plan for openldap + +discover: + - name: Internal openldap gating tests + how: fmf + url: https://pkgs.devel.redhat.com/git/tests/openldap + ref: master + filter: 'tag: Tier1 & tag: rhel9-buildroot' + +prepare: + - name: Enable beaker-tasks + how: shell + script: + - dnf config-manager --enable beaker-tasks + +execute: + how: tmt + +adjust: + enabled: false + when: distro == centos-stream or distro == fedora diff --git a/tests/smoke-test/Makefile b/tests/smoke-test/Makefile deleted file mode 100644 index 5a549be..0000000 --- a/tests/smoke-test/Makefile +++ /dev/null @@ -1,85 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /CoreOS/openldap/Sanity/smoke-test -# Description: Test calls upstream test suite. -# Author: Ondrej Moris -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# This program is distributed in the hope that it will be -# useful, but WITHOUT ANY WARRANTY; without even the implied -# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public -# License along with this program; if not, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/CoreOS/openldap/Sanity/smoke-test -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Ondrej Moris " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Test calls upstream test suite." >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 3h" >> $(METADATA) - @echo "RunFor: openldap" >> $(METADATA) - @echo "Requires: openldap" >> $(METADATA) - @echo "Requires: openldap-clients" >> $(METADATA) - @echo "Requires: openldap-servers" >> $(METADATA) - @echo "Requires: cyrus-sasl-devel" >> $(METADATA) - @echo "Requires: gdbm-devel" >> $(METADATA) - @echo "Requires: libtool" >> $(METADATA) - @echo "Requires: krb5-devel" >> $(METADATA) - @echo "Requires: openssl-devel" >> $(METADATA) - @echo "Requires: pam-devel" >> $(METADATA) - @echo "Requires: perl" >> $(METADATA) - @echo "Requires: pkgconfig" >> $(METADATA) - @echo "Requires: tcp_wrappers-devel" >> $(METADATA) - @echo "Requires: bind-libbind-devel" >> $(METADATA) - @echo "Requires: unixODBC-devel" >> $(METADATA) - @echo "Requires: libtool-ltdl-devel" >> $(METADATA) - @echo "Requires: nfs-utils" >> $(METADATA) - @echo "Requires: rpm-build" >> $(METADATA) - @echo "Requires: nss-devel" >> $(METADATA) - @echo "Requires: libdb-devel" >> $(METADATA) - @echo "Requires: groff" >> $(METADATA) - @echo "Requires: cracklib-devel" >> $(METADATA) - @echo "Requires: perl-ExtUtils-Embed" >> $(METADATA) - @echo "Requires: yum-utils" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/smoke-test/PURPOSE b/tests/smoke-test/PURPOSE deleted file mode 100644 index 1571314..0000000 --- a/tests/smoke-test/PURPOSE +++ /dev/null @@ -1,3 +0,0 @@ -PURPOSE of /CoreOS/openldap/Sanity/smoke-test -Description: Test calls upstream test suite. -Author: Ondrej Moris diff --git a/tests/smoke-test/runtest.sh b/tests/smoke-test/runtest.sh deleted file mode 100755 index 63c8ccc..0000000 --- a/tests/smoke-test/runtest.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /CoreOS/openldap/Sanity/smoke-test -# Description: Test calls upstream test suite. -# Author: Ondrej Moris -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# This program is distributed in the hope that it will be -# useful, but WITHOUT ANY WARRANTY; without even the implied -# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public -# License along with this program; if not, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# Include rhts environment -. /usr/bin/rhts-environment.sh -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -PACKAGE="openldap" - -PACKAGES=("openldap" \ - "openldap-clients" \ - "openldap-servers" \ - "cyrus-sasl-devel" \ - "gdbm-devel" \ - "libtool" \ - "krb5-devel" \ - "openssl-devel" \ - "pam-devel" \ - "perl" \ - "unixODBC-devel" \ - "libtool-ltdl-devel" \ - "nfs-utils" \ - "rpm-build" ) - -if rlIsRHEL 5; then - PACKAGES=( ${PACKAGES[@]} "bind-libbind-devel" ) -elif rlIsRHEL 6; then - PACKAGES=( ${PACKAGES[@]} "tcp_wrappers-devel" ) -else - PACKAGES=( ${PACKAGES[@]} "tcp_wrappers-devel" "nss-devel" "libdb-devel" "groff" "cracklib-devel" "perl-ExtUtils-Embed" ) -fi -if rlIsFedora; then - PACKAGES=( ${PACKAGES[@]} "pkgconf-pkg-config" ) -else - PACKAGES=( ${PACKAGES[@]} "pkgconfig" ) -fi - -if rlIsRHEL 5; then - LDAP_SERVICE='ldap' -else - LDAP_SERVICE='slapd' -fi - -rlJournalStart - - rlPhaseStartSetup "General Setup" - - rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" - rlRun "pushd $TmpDir" - - for P in "${PACKAGES[@]}"; do rlCheckRpm $P || rlDie; done - - rlFetchSrcForInstalled $PACKAGE - rlRun "yum-builddep -y openldap*src.rpm" 0 - rlRun "rpm -ihv *.rpm" 0 - - rlServiceStop $LDAP_SERVICE - - rlPhaseEnd - - rlPhaseStartTest - - TOPDIR=`rpm --eval %_topdir` - rlRun "pushd $TOPDIR" 0 - - rlRun "rpmbuild -vv -bc SPECS/openldap.spec >build.log 2>&1" 0 - [[ $? -ne 0 ]] && cat build.log - VERSION=`rpm -q --qf "%{VERSION}\n" openldap | tail -1` - rlRun "pushd BUILD/openldap-${VERSION}/openldap-${VERSION}" 0 - # workaround for failing test, it tests unsupported configuration - # see http://www.openldap.org/lists/openldap-technical/201204/msg00080.html for upstream reply - # change of check after test is not enough because run of all tests with hdb is skipped if test058 fails with bdb - rm -f tests/scripts/test058-syncrepl-asymmetric - rlIsRHEL 5 6 && rlRun "pushd build-servers" 0 - - rlRun "make check > make_check.out 2>&1" 0 - - grep ">>>>" make_check.out > make_check.results - cat make_check.out - echo -e "\n\nResults:\n\n" - cat make_check.results - - rlAssertNotGrep "failed" make_check.results - - rlIsRHEL 5 6 && rlRun "popd" 0 - rlRun "popd" 0 - rlRun "popd" 0 - rlPhaseEnd - - rlPhaseStartCleanup - - rlServiceRestore $LDAP_SERVICE - rlRun "rm -rf BUILD/opendap-`rpm -q --qf "%{VERSION}" openldap`" 0 - rlRun "popd" - rlRun "rm -r $TmpDir" 0 "Removing tmp directory" - - rlPhaseEnd - -rlJournalPrintText - -rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index b1b1905..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -# Tests that run in all contexts -- hosts: localhost - roles: - - role: standard-test-beakerlib - tags: - - classic - tests: - - smoke-test - required_packages: - - openldap # Required for smoke-test - - openldap-clients # Required for smoke-test - - openldap-servers # Required for smoke-test - - cyrus-sasl-devel # Required for smoke-test - - gdbm-devel # Required for smoke-test - - libtool # Required for smoke-test - - krb5-devel # Required for smoke-test - - openssl-devel # Required for smoke-test - - pam-devel # Required for smoke-test - - perl # Required for smoke-test - - pkgconfig # Required for smoke-test - - tcp_wrappers-devel # Required for smoke-test - - bind-libbind-devel # Required for smoke-test - - unixODBC-devel # Required for smoke-test - - nfs-utils # Required for smoke-test - - rpm-build # Required for smoke-test - - nss-devel # Required for smoke-test - - libdb-devel # Required for smoke-test - - groff # Required for smoke-test - - cracklib-devel # Required for smoke-test - - perl-ExtUtils-Embed # Required for smoke-test - - yum-utils # Required for smoke-test - - libtool-ltdl-devel # Required for smoke-test - - wget # Required for smoke-test