From a3276f3863410ed4c21904b03d55ed07f0e3f370 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Fri, 13 Dec 2024 21:00:19 -0800 Subject: [PATCH] Update to 0.103 Fix CI tests Resolves: RHEL-70744 Signed-off-by: Chris Leech --- .gitignore | 1 + isns-utils.spec | 21 ++++++------- sources | 2 +- test_as_installed.patch | 70 +++++++++++++++++++++++------------------ 4 files changed, 52 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index 16afc65..05930b3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ open-isns-0.93.tar.bz2 /open-isns-0.97.tar.gz /open-isns-0.100.tar.gz /open-isns-0.101.tar.gz +/open-isns-0.103.tar.gz diff --git a/isns-utils.spec b/isns-utils.spec index 3d56fc1..d5f2b47 100644 --- a/isns-utils.spec +++ b/isns-utils.spec @@ -1,6 +1,6 @@ Name: isns-utils -Version: 0.101 -Release: 13%{?dist} +Version: 0.103 +Release: 1%{?dist} Summary: The iSNS daemon and utility programs License: LGPL-2.1-or-later @@ -10,8 +10,8 @@ Source1: isnsd.service Patch1: test_as_installed.patch BuildRequires: gcc -BuildRequires: openssl-devel automake pkgconfig systemd-devel systemd -BuildRequires: make +BuildRequires: pkgconfig systemd-devel systemd +BuildRequires: meson ninja-build Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units @@ -42,16 +42,14 @@ Development files for iSNS %build -%configure --enable-shared --disable-static -%make_build - +%meson -Dsecurity=disabled -Dslp=disabled +%meson_build %install -%make_install -make install_hdrs DESTDIR=%{buildroot} -make install_lib DESTDIR=%{buildroot} +%meson_install chmod 755 %{buildroot}%{_sbindir}/isns* chmod 755 %{buildroot}%{_libdir}/libisns.so.0 +chmod 700 %{buildroot}/var/lib/isns rm %{buildroot}%{_unitdir}/isnsd.service rm %{buildroot}%{_unitdir}/isnsd.socket install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/isnsd.service @@ -84,7 +82,7 @@ install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/isnsd.service %files -%doc COPYING README +%doc COPYING README.md %{_sbindir}/isnsd %{_sbindir}/isnsadm %{_sbindir}/isnsdd @@ -102,6 +100,7 @@ install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/isnsd.service %dir %{_includedir}/libisns %{_includedir}/libisns/*.h %{_libdir}/libisns.so +%{_libdir}/pkgconfig/libisns.pc %changelog diff --git a/sources b/sources index 76ec823..b419c02 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (open-isns-0.101.tar.gz) = e5a392127b0d85f36e9e4aa963c0c502af8c5aea0aba6d12abb4425649969dcc20ba6e87a99083626d981438439b17b71a86320f816042d82ed5dbe7e7a63e77 +SHA512 (open-isns-0.103.tar.gz) = 219dd4f7e0a8459f5acaf2036fc737b90604cdcfe78b5492d50e4826744923afe35c9c331b3e39aa7c9bb5ebb2c378c464dced204d51da46e2b7474c6ca94057 diff --git a/test_as_installed.patch b/test_as_installed.patch index 63993ef..372a4e2 100644 --- a/test_as_installed.patch +++ b/test_as_installed.patch @@ -1,47 +1,57 @@ -From 420ae1af11fad3151b5bfa676e7218168e4e6f3f Mon Sep 17 00:00:00 2001 +From f04f3c56ac1598a787cee58489e3de5589d7f879 Mon Sep 17 00:00:00 2001 From: Chris Leech -Date: Wed, 26 May 2021 10:00:17 -0700 -Subject: [PATCH 1/1] run tests with binaries from arbitrary paths +Date: Fri, 13 Dec 2024 20:48:21 -0800 +Subject: [PATCH 1/1] Test from installed for CI +Signed-off-by: Chris Leech --- - tests/Makefile | 4 ++++ - tests/harness.py | 4 ++++ - 2 files changed, 8 insertions(+) + tests/Makefile | 5 +++++ + tests/harness.py | 6 ++++++ + 2 files changed, 11 insertions(+) + create mode 100644 tests/Makefile diff --git a/tests/Makefile b/tests/Makefile -index 372572d..2c61183 100644 ---- a/tests/Makefile +new file mode 100644 +index 0000000..cd856c2 +--- /dev/null +++ b/tests/Makefile -@@ -48,3 +48,7 @@ quick: tests-no-security - tests-no-security: - @echo running tests without security -- takes about 2 minutes - ./test-isns.py -+ +@@ -0,0 +1,5 @@ ++# Run tests on installed executables for CI ++# Excludes tests that use external test binaries (8-11) +tests-as-installed: -+ @echo running tests from installed executables -- takes about 2 minutes -+ ./test-isns.py --path="/usr/sbin" ++ @echo running tests from installed executables ++ ./test-isns.py --bin-dir=/usr/sbin Test0{1..7} diff --git a/tests/harness.py b/tests/harness.py -index 39fc5e6..b710f5a 100644 +index f232132..d5a03b1 100644 --- a/tests/harness.py +++ b/tests/harness.py -@@ -137,6 +137,9 @@ def new_initArgParsers(self): - self._main_parser.add_argument('-d', '--debug', dest='debug', - action='store_true', - help='Enable developer debugging') -+ self._main_parser.add_argument('--path', dest='path', -+ action='store', default='..', -+ help='Set isns bin path, to run from installed executables') +@@ -60,6 +60,8 @@ def get_bindir(): + """ + return the directory where binaries live + """ ++ if os.path.isabs(Global.isns_bin_dir): ++ return Global.isns_bin_dir + return '%s/%s' % (Global.test_dir, Global.isns_bin_dir) + + def isns_stage(name, msg): +@@ -148,6 +150,9 @@ def new_initArgParsers(self): + self._main_parser.add_argument('-D', '--test-dir', dest='test_dir', + default='.', + help='Sets the test dir (default ".")') ++ self._main_parser.add_argument('--bin-dir', dest='bin_dir', ++ default='../builddir', ++ help='Sets the isns bin dir (default "../builddir")') def new_parseArgs(self, argv): """ -@@ -148,6 +151,7 @@ def new_parseArgs(self, argv): - Global.verbosity = self.verbosity +@@ -160,6 +165,7 @@ def new_parseArgs(self, argv): Global.security = self.security Global.debug = self.debug -+ Global._isns_bin_dir = self.path - dprint("found: verbosity=%d, security=%s" % \ - (Global.verbosity, Global.security)) - + Global.test_dir = self.test_dir ++ Global.isns_bin_dir = self.bin_dir + dprint("found: debug=%s, verbosity=%d, security=%s, list=%s, test_dir='%s'" % \ + (Global.debug, Global.verbosity, + Global.security, self.list, self.test_dir)) -- -2.31.1 +2.47.0