public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Hangbin Liu <haliu@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/dropwatch] epel10: Convert test to tmt
Date: Tue, 29 Sep 2026 00:43:50 GMT [thread overview]
Message-ID: <179064263052.1.10831736382695970657.rpms-dropwatch-14117825e6d6@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/dropwatch
Branch : epel10
Commit : 14117825e6d6be7bd19829ba5cb42f42bb83be7c
Author : Hangbin Liu <haliu@redhat.com>
Date : 2025-07-29T17:00:36+08:00
Stats : +27/-168 in 10 file(s)
URL : https://src.fedoraproject.org/rpms/dropwatch/c/14117825e6d6be7bd19829ba5cb42f42bb83be7c?branch=epel10
Log:
Convert test to tmt
Resolves: rhbz#2382892
Signed-off-by: Hangbin Liu <haliu@redhat.com>
---
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..20f21fd
--- /dev/null
+++ b/plans.fmf
@@ -0,0 +1,9 @@
+summary: Run dropwatch selftest
+discover:
+ how: fmf
+prepare:
+ how: install
+ # install psmisc for killall
+ package: [dropwatch, psmisc]
+execute:
+ how: tmt
diff --git a/tests/README b/tests/README
deleted file mode 100644
index 44fb438..0000000
--- a/tests/README
+++ /dev/null
@@ -1,2 +0,0 @@
-initial tests:
-run make check, which runs any selftests in the upstream source tarball
diff --git a/tests/inventory b/tests/inventory
deleted file mode 100755
index 6238138..0000000
--- a/tests/inventory
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-export TEST_DOCKER_EXTRA_ARGS="--security-opt seccomp:unconfined"
-exec merge-standard-inventory "$@"
diff --git a/tests/main.fmf b/tests/main.fmf
new file mode 100644
index 0000000..6189cf3
--- /dev/null
+++ b/tests/main.fmf
@@ -0,0 +1,2 @@
+summary: Smoke test
+test: ./run_tests.sh
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
new file mode 100755
index 0000000..6777d3c
--- /dev/null
+++ b/tests/run_tests.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+abort_dropwatch() {
+ sleep 5
+ killall -SIGINT dropwatch
+}
+
+abort_dropwatch &
+echo -e "set alertlimit 1\nstart\nstop\nexit" | dropwatch -l kas &> "$TMT_TEST_DATA"/dropwatch.log
+
+# shellcheck disable=SC2181
+[ $? -eq 0 ] && exit 0
+# If the platform doesn't support NET_DM, skip this test
+# Usually we got this issue in container as no privilege permission
+grep -q NET_DM "$TMT_TEST_DATA"/dropwatch.log && exit 0 || exit 1
diff --git a/tests/selftest/Makefile b/tests/selftest/Makefile
deleted file mode 100644
index 7b452de..0000000
--- a/tests/selftest/Makefile
+++ /dev/null
@@ -1,64 +0,0 @@
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# Makefile of /CoreOS/patch/Sanity/selftest
-# Description: Executes upstream test suite
-# Author: Miroslav Vadkerti <mvadkert@redhat.com>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# 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/rng-tools/Sanity/selftest
-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: Miroslav Vadkerti <mvadkert@redhat.com>" > $(METADATA)
- @echo "Name: $(TEST)" >> $(METADATA)
- @echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
- @echo "Path: $(TEST_DIR)" >> $(METADATA)
- @echo "Description: Executes upstream test suite" >> $(METADATA)
- @echo "Type: Sanity" >> $(METADATA)
- @echo "TestTime: 30m" >> $(METADATA)
- @echo "RunFor: patch" >> $(METADATA)
- @echo "Requires: patch gcc rpm-build automake libselinux-devel ed libattr-devel" >> $(METADATA)
- @echo "Priority: Normal" >> $(METADATA)
- @echo "License: GPLv2" >> $(METADATA)
- @echo "Confidential: no" >> $(METADATA)
- @echo "Destructive: no" >> $(METADATA)
- @echo "Releases: -RHEL3 -RHEL4 -RHELServer5 -RHELClient5" >> $(METADATA)
-
- rhts-lint $(METADATA)
diff --git a/tests/selftest/PURPOSE b/tests/selftest/PURPOSE
deleted file mode 100644
index 971cc3f..0000000
--- a/tests/selftest/PURPOSE
+++ /dev/null
@@ -1,4 +0,0 @@
-PURPOSE of /CoreOS/dropwatch/Sanity/selftest
-Description: Executes rngtest to validate integrity of dropwatch
-Author: Neil Horman <nhorman@redhat.com>
-
diff --git a/tests/selftest/runtest.sh b/tests/selftest/runtest.sh
deleted file mode 100755
index a9f6055..0000000
--- a/tests/selftest/runtest.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/bash
-# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# runtest.sh of /CoreOS/rng-tools/Sanity/selftest
-# Description: Executes the upstream test suite comming with the package
-# Author: Miroslav Vadkerti <mvadkert@redhat.com>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# 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 || exit 1
-. /usr/share/beakerlib/beakerlib.sh || exit 1
-
-PACKAGE="dropwatch"
-PACKAGES="dropwatch automake autoconf libtool kernel-headers readline-devel binutils-devel libnl3-devel pkgconf-pkg-config"
-UPSTREAMPKG="dropwatch-*"
-BUILDLOG=`mktemp`
-TESTLOG=`mktemp`
-TARGET=$(echo `uname -m` | egrep ppc)
-if [[ $TARGET != "" ]]; then TARGET="--target `uname -m`"; fi
-TOPDIR=`mktemp -d`
-SPEC="$TOPDIR/SPECS/$PACKAGE*.spec"
-TESTDIR="$TOPDIR/BUILD/$UPSTREAMPKG/"
-
-rlJournalStart
- rlPhaseStartSetup
- for PKG in $PACKAGES; do
- rlAssertRpm $PKG
- done
- rlPhaseEnd
- rlPhaseStartTest
- rlFetchSrcForInstalled $PACKAGE
- rlRun "rpm -ivh --define '_topdir $TOPDIR' $PACKAGE*.src.rpm" 0 "Installing $PACKAGE src rpm"
- echo "+ Building $PACKAGE (Log: $BUILDLOG)"
- echo "+ Build command: rpmbuild -bc $SPEC $TARGET"
- rlRun "rpmbuild --define '_topdir $TOPDIR' -bc $SPEC $TARGET &> $BUILDLOG"
- echo "+ Buildlog:"
- tail -n 100 $BUILDLOG
- rlRun "pushd ."
- rlRun "cd $TESTDIR"
- rlRun "make check &> $TESTLOG"
- if [ $? -eq 0 ]
- then
- rlPass "Selftest Passed"
- else
- rlFail "Selftest Failed"
- fi
- rlPhaseEnd
-
- rlPhaseStartCleanup
- rlRun "popd"
- rlRun "rm -rf $PACKAGE*.src.rpm" 0 "Removing source rpm"
- rlPhaseEnd
-rlJournalPrintText
-rlJournalEnd
diff --git a/tests/tests.yml b/tests/tests.yml
deleted file mode 100644
index a4aef7b..0000000
--- a/tests/tests.yml
+++ /dev/null
@@ -1,21 +0,0 @@
----
-# This first play always runs on the local staging system
-- hosts: localhost
- roles:
- - role: standard-test-beakerlib
- tags:
- - classic
- tests:
- - selftest
- required_packages:
- - autoconf
- - automake
- - libtool
- - kernel-headers
- - readline-devel
- - binutils-devel
- - libnl3-devel
- - pkgconf-pkg-config
- - libnl3-devel
- - wget
- - rpm-build
reply other threads:[~2026-09-29 0:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179064263052.1.10831736382695970657.rpms-dropwatch-14117825e6d6@fedoraproject.org \
--to=haliu@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox