Blame SOURCES/test_as_installed.patch

dfb166
From 420ae1af11fad3151b5bfa676e7218168e4e6f3f Mon Sep 17 00:00:00 2001
dfb166
From: Chris Leech <cleech@redhat.com>
dfb166
Date: Wed, 26 May 2021 10:00:17 -0700
dfb166
Subject: [PATCH 1/1] run tests with binaries from arbitrary paths
dfb166
dfb166
---
dfb166
 tests/Makefile   | 4 ++++
dfb166
 tests/harness.py | 4 ++++
dfb166
 2 files changed, 8 insertions(+)
dfb166
dfb166
diff --git a/tests/Makefile b/tests/Makefile
dfb166
index 372572d..2c61183 100644
dfb166
--- a/tests/Makefile
dfb166
+++ b/tests/Makefile
dfb166
@@ -48,3 +48,7 @@ quick: tests-no-security
dfb166
 tests-no-security:
dfb166
 	@echo running tests without security -- takes about 2 minutes
dfb166
 	./test-isns.py
dfb166
+
dfb166
+tests-as-installed:
dfb166
+	@echo running tests from installed executables -- takes about 2 minutes
dfb166
+	./test-isns.py -s --path="/usr/sbin"
dfb166
diff --git a/tests/harness.py b/tests/harness.py
dfb166
index 39fc5e6..b710f5a 100644
dfb166
--- a/tests/harness.py
dfb166
+++ b/tests/harness.py
dfb166
@@ -137,6 +137,9 @@ def new_initArgParsers(self):
dfb166
     self._main_parser.add_argument('-d', '--debug', dest='debug',
dfb166
             action='store_true',
dfb166
             help='Enable developer debugging')
dfb166
+    self._main_parser.add_argument('--path', dest='path',
dfb166
+            action='store', default='..',
dfb166
+            help='Set isns bin path, to run from installed executables')
dfb166
 
dfb166
 def new_parseArgs(self, argv):
dfb166
     """
dfb166
@@ -148,6 +151,7 @@ def new_parseArgs(self, argv):
dfb166
     Global.verbosity = self.verbosity
dfb166
     Global.security = self.security
dfb166
     Global.debug = self.debug
dfb166
+    Global._isns_bin_dir = self.path
dfb166
     dprint("found: verbosity=%d, security=%s" % \
dfb166
            (Global.verbosity, Global.security))
dfb166
 
dfb166
-- 
dfb166
2.31.1
dfb166