run all upstream tests, update metadata to tmt/fmf

Recompile during for testing to build test binaries.

Patch the test harness to find the test specific binaries in the build
dir, even when changing the default bin path to test an installed build.

Related: RHEL-219459
This commit is contained in:
Chris Leech 2026-08-01 17:22:19 -07:00
parent a3276f3863
commit c4a8eccb60
6 changed files with 46 additions and 36 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -1,6 +0,0 @@
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

6
plans/smoke.fmf Normal file
View File

@ -0,0 +1,6 @@
discover:
how: fmf
dist-git-source: true
dist-git-install-builddeps: true
execute:
how: tmt

View File

@ -1,4 +1,4 @@
From f04f3c56ac1598a787cee58489e3de5589d7f879 Mon Sep 17 00:00:00 2001
From 041cf864d4c776b13fb04be5b7fa4958123d496e Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Fri, 13 Dec 2024 20:48:21 -0800
Subject: [PATCH 1/1] Test from installed for CI
@ -6,13 +6,13 @@ Subject: [PATCH 1/1] Test from installed for CI
Signed-off-by: Chris Leech <cleech@redhat.com>
---
tests/Makefile | 5 +++++
tests/harness.py | 6 ++++++
2 files changed, 11 insertions(+)
tests/harness.py | 9 ++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
create mode 100644 tests/Makefile
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 0000000..cd856c2
index 0000000..fdd79ac
--- /dev/null
+++ b/tests/Makefile
@@ -0,0 +1,5 @@
@ -20,12 +20,20 @@ index 0000000..cd856c2
+# Excludes tests that use external test binaries (8-11)
+tests-as-installed:
+ @echo running tests from installed executables
+ ./test-isns.py --bin-dir=/usr/sbin Test0{1..7}
+ ./test-isns.py --bin-dir=/usr/sbin
diff --git a/tests/harness.py b/tests/harness.py
index f232132..d5a03b1 100644
index f232132..6f3759a 100644
--- a/tests/harness.py
+++ b/tests/harness.py
@@ -60,6 +60,8 @@ def get_bindir():
@@ -8,6 +8,7 @@ import sys
import unittest
import re
import time
+from pathlib import Path
#
# globals
@@ -60,6 +61,8 @@ def get_bindir():
"""
return the directory where binaries live
"""
@ -34,7 +42,7 @@ index f232132..d5a03b1 100644
return '%s/%s' % (Global.test_dir, Global.isns_bin_dir)
def isns_stage(name, msg):
@@ -148,6 +150,9 @@ def new_initArgParsers(self):
@@ -148,6 +151,9 @@ def new_initArgParsers(self):
self._main_parser.add_argument('-D', '--test-dir', dest='test_dir',
default='.',
help='Sets the test dir (default ".")')
@ -44,7 +52,7 @@ index f232132..d5a03b1 100644
def new_parseArgs(self, argv):
"""
@@ -160,6 +165,7 @@ def new_parseArgs(self, argv):
@@ -160,6 +166,7 @@ def new_parseArgs(self, argv):
Global.security = self.security
Global.debug = self.debug
Global.test_dir = self.test_dir
@ -52,6 +60,15 @@ index f232132..d5a03b1 100644
dprint("found: debug=%s, verbosity=%d, security=%s, list=%s, test_dir='%s'" % \
(Global.debug, Global.verbosity,
Global.security, self.list, self.test_dir))
@@ -432,7 +439,7 @@ def isns_external_test(client_config, args):
"""
logfile = get_logfile_from_config(client_config.path)
- cmd = ['%s/%s' % (get_bindir(), args[0]),
+ cmd = ['%s/%s/%s' % (Path(__file__).resolve().parent.parent, "builddir", args[0]),
'-c', client_config.path] + args[1:]
exit_val = run_cmd(cmd, logfile)
return (logfile, exit_val)
--
2.47.0
2.55.0

12
tests/smoke.fmf Normal file
View File

@ -0,0 +1,12 @@
summary: Run upstream tests
component: [isns-utils]
require: [make, python3]
test: >
rpmbuild -bc
--define "_sourcedir $TMT_SOURCE_DIR"
--define "_builddir $TMT_SOURCE_DIR/BUILD"
--define "_vpath_builddir builddir"
$TMT_SOURCE_DIR/*.spec &&
cd $TMT_SOURCE_DIR/BUILD/open-isns-*/tests &&
make tests-as-installed

View File

@ -1,20 +0,0 @@
---
- hosts: localhost
roles:
- role: standard-test-source
tags:
- always
- role: standard-test-basic
tags:
- classic
required_packages:
- make
- python3
- isns-utils
- openssl
tests:
- smoke:
dir: ./source/tests/
run: make tests-as-installed