From 6ddb7810da245002f96fdd6040062b3548a95947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Thu, 28 Jun 2018 10:10:26 +0200 Subject: [PATCH 01/40] spec modernization --- openhpi.spec | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/openhpi.spec b/openhpi.spec index d08ebb2..23440d8 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -12,6 +12,7 @@ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar. Patch0: %{name}-3.4.0-systemd.patch Patch1: %{name}-3.6.1-ssl.patch Patch2: %{name}-3.7.0-multilib.patch +BuildRequires: gcc-c++ BuildRequires: libsysfs-devel BuildRequires: net-snmp-devel BuildRequires: OpenIPMI-devel @@ -121,11 +122,6 @@ make check %systemd_postun_with_restart openhpid.service -%post libs -p /sbin/ldconfig - -%postun libs -p /sbin/ldconfig - - %files %license %{_docdir}/%{name}/COPYING %doc ChangeLog README README.daemon openhpi.conf.example plugins/*/*.pdf From a4381fbaad44ea1ff04cc8fe8103b777898ce4ce Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Mon, 9 Jul 2018 14:32:32 +0200 Subject: [PATCH 02/40] fix file list in docdir --- openhpi.spec | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/openhpi.spec b/openhpi.spec index 23440d8..c7c72d9 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -3,7 +3,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Group: System Environment/Base URL: http://www.openhpi.org @@ -90,7 +90,7 @@ fi %build export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" -%configure --disable-static --with-systemdsystemunitdir=%{_unitdir} +%configure --disable-static --with-systemdsystemunitdir=%{_unitdir} --docdir=%{_docdir}/%{name}-%{version} # Don't use rpath! sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool @@ -123,8 +123,10 @@ make check %files -%license %{_docdir}/%{name}/COPYING -%doc ChangeLog README README.daemon openhpi.conf.example plugins/*/*.pdf +%license %{_docdir}/%{name}-%{version}/COPYING +%doc %{_docdir}/%{name}-%{version}/ChangeLog +%doc %{_docdir}/%{name}-%{version}/README* +%doc openhpi.conf.example plugins/*/*.pdf %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf %config(noreplace) %{_sysconfdir}/%{name}/%{name}client.conf @@ -148,6 +150,9 @@ make check %changelog +* Mon Jul 09 2018 Than Ngo - 3.8.0-2 +- fix file list in docdir + * Tue Mar 13 2018 Dan Horák - 3.8.0-1 - updated to 3.8.0 From 2ff8128df00b5b319974ba023ff1b216403cc071 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 13 Jul 2018 15:06:20 +0000 Subject: [PATCH 03/40] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index c7c72d9..61e6b25 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -3,7 +3,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 2%{?dist} +Release: 3%{?dist} License: BSD Group: System Environment/Base URL: http://www.openhpi.org @@ -150,6 +150,9 @@ make check %changelog +* Fri Jul 13 2018 Fedora Release Engineering - 3.8.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Mon Jul 09 2018 Than Ngo - 3.8.0-2 - fix file list in docdir From ee50a56024433b41910917a822f3cd82154aeae3 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 24 Jul 2018 15:04:36 -0700 Subject: [PATCH 04/40] Rebuild for new net-snmp --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 61e6b25..72aabb5 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -3,7 +3,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 3%{?dist} +Release: 4%{?dist} License: BSD Group: System Environment/Base URL: http://www.openhpi.org @@ -150,6 +150,9 @@ make check %changelog +* Tue Jul 24 2018 Adam Williamson - 3.8.0-4 +- Rebuild for new net-snmp + * Fri Jul 13 2018 Fedora Release Engineering - 3.8.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From dde12a0a9ee99bfe5d372efb93fe5861b2058ad0 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Tue, 7 Aug 2018 16:22:08 +0200 Subject: [PATCH 05/40] fixed bz#1612210, manpage scan issues --- openhpi-3.8.0-manpage-scan.patch | 54 ++++++++++++++++++++++++++++++++ openhpi.spec | 6 +++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 openhpi-3.8.0-manpage-scan.patch diff --git a/openhpi-3.8.0-manpage-scan.patch b/openhpi-3.8.0-manpage-scan.patch new file mode 100644 index 0000000..bc74a13 --- /dev/null +++ b/openhpi-3.8.0-manpage-scan.patch @@ -0,0 +1,54 @@ +diff -up openhpi-3.8.0/docs/man/hpicrypt.1.pod.me openhpi-3.8.0/docs/man/hpicrypt.1.pod +--- openhpi-3.8.0/docs/man/hpicrypt.1.pod.me 2018-08-07 15:49:10.034455449 +0200 ++++ openhpi-3.8.0/docs/man/hpicrypt.1.pod 2018-08-07 15:50:10.702706004 +0200 +@@ -23,6 +23,9 @@ Please have a backup copy of the file be + + Decrypt the config_file and output the text to screen with helpful message + ++=item B<-c> ++Config file to encrypt or decrypt ++ + =back + + =head1 SEE ALSO +diff -up openhpi-3.8.0/docs/man/hpitop.1.pod.me openhpi-3.8.0/docs/man/hpitop.1.pod +--- openhpi-3.8.0/docs/man/hpitop.1.pod.me 2018-08-07 15:23:49.398174972 +0200 ++++ openhpi-3.8.0/docs/man/hpitop.1.pod 2018-08-07 15:25:16.451534556 +0200 +@@ -5,7 +5,7 @@ hpitop - A openhpi sample application th + + =head1 SYNOPSIS + +- hpitop [-D nn] [-N host[:port]] [-C ] [-rscwiafd] [-n nn] [-X] [-h] ++ hpitop [-D nn] [-N host[:port]] [-C ] [-r] [-s] [-c] [-w] [-i] [-a] [-f] [-d] [-n nn] [-X] [-h] + hpitop [--domain=nn] [--host=host[:port]] [--cfgfile=file] [--rpts] [--sensors] + [--controls] [--watchdogs] [--inventories] [--annunciators] [--fumis] [--dimis] + [--resource=nn] [--debug] [--help] +diff -up openhpi-3.8.0/docs/man/hpitree.1.pod.me openhpi-3.8.0/docs/man/hpitree.1.pod +--- openhpi-3.8.0/docs/man/hpitree.1.pod.me 2018-08-07 16:01:44.231568709 +0200 ++++ openhpi-3.8.0/docs/man/hpitree.1.pod 2018-08-07 16:02:31.364763240 +0200 +@@ -5,7 +5,7 @@ and resources' manamegement instruments + + =head1 SYNOPSIS + +- hpitree [-D nn] [-N host[:port]] [-C ] [-acdiorsw ] [-n nn] [-X] [-h] ++ hpitree [-D nn] [-N host[:port]] [-C ] [-a] [-c] [-d] [-i] [-o] [-r] [-s] [-w] [-n nn] [-X] [-h] + hpitree [--domain=nn] [--host=host[:port]] [--cfgfile=file] [--all] [--controls] [--rdrs] [--inventories] [--rpts] + [--sensors] [--watchdogs] [--overview] [--resource=nn] [--debug] [--help] + +diff -up openhpi-3.8.0/docs/man/openhpid.8.pod.me openhpi-3.8.0/docs/man/openhpid.8.pod +--- openhpi-3.8.0/docs/man/openhpid.8.pod.me 2018-08-07 16:10:04.766634543 +0200 ++++ openhpi-3.8.0/docs/man/openhpid.8.pod 2018-08-07 16:15:01.409858847 +0200 +@@ -38,6 +38,12 @@ The client and daemon currently cannot r + + =over 4 + ++=item B<-d>, B<--decrypt> ++Config file encrypted with hpicrypt. Decrypt and read ++ ++=item B<-h>, B<--help> ++Show help options ++ + =item B<-c>, B<--cfg>=I + + Sets path/name of the configuration file. +diff -up openhpi-3.8.0/openhpid/threaded.c.me openhpi-3.8.0/openhpid/threaded.c diff --git a/openhpi.spec b/openhpi.spec index 72aabb5..f36fe84 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -3,7 +3,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 4%{?dist} +Release: 5%{?dist} License: BSD Group: System Environment/Base URL: http://www.openhpi.org @@ -12,6 +12,7 @@ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar. Patch0: %{name}-3.4.0-systemd.patch Patch1: %{name}-3.6.1-ssl.patch Patch2: %{name}-3.7.0-multilib.patch +Patch3: %{name}-3.8.0-manpage-scan.patch BuildRequires: gcc-c++ BuildRequires: libsysfs-devel BuildRequires: net-snmp-devel @@ -150,6 +151,9 @@ make check %changelog +* Tue Aug 07 2018 Than Ngo - 3.8.0-5 +- fixed bz#1612210, manpage scan issues + * Tue Jul 24 2018 Adam Williamson - 3.8.0-4 - Rebuild for new net-snmp From 02f255342130aaac2bf73cc74e1250a875f7e2fd Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Thu, 16 Aug 2018 14:42:18 +0200 Subject: [PATCH 06/40] install README-dynamic_simulator --- openhpi.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index f36fe84..51a8a2a 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -3,7 +3,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 5%{?dist} +Release: 6%{?dist} License: BSD Group: System Environment/Base URL: http://www.openhpi.org @@ -108,6 +108,7 @@ make install DESTDIR=$RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la rm -rf $RPM_BUILD_ROOT/%{_libdir}/%{name}/*.la +cp plugins/dynamic_simulator/README $RPM_BUILD_ROOT/%{_docdir}/%{name}-%{version}/README-dynamic_simulator %check make check @@ -151,6 +152,9 @@ make check %changelog +* Tue Aug 07 2018 Than Ngo - 3.8.0-6 +- install README-dynamic_simulator + * Tue Aug 07 2018 Than Ngo - 3.8.0-5 - fixed bz#1612210, manpage scan issues From d20fcaeab13838af6ebce9bfad905bcdff8ab47a Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Thu, 29 Nov 2018 10:37:40 +0100 Subject: [PATCH 07/40] add ipv6 support for ipmidirect --- openhpi-3.8.0-ipv6-ipmidirect.patch | 48 +++++++++++++++++++++++++++++ openhpi.spec | 6 +++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 openhpi-3.8.0-ipv6-ipmidirect.patch diff --git a/openhpi-3.8.0-ipv6-ipmidirect.patch b/openhpi-3.8.0-ipv6-ipmidirect.patch new file mode 100644 index 0000000..dd17bf8 --- /dev/null +++ b/openhpi-3.8.0-ipv6-ipmidirect.patch @@ -0,0 +1,48 @@ +diff --git a/plugins/ipmidirect/ipmi.cpp b/plugins/ipmidirect/ipmi.cpp +index f6745cf6..3b4918de 100644 +--- a/plugins/ipmidirect/ipmi.cpp ++++ b/plugins/ipmidirect/ipmi.cpp +@@ -1929,7 +1929,12 @@ cIpmi::AllocConnection( GHashTable *handler_config ) + char user[32] = ""; + char passwd[32] = ""; + char *value; +- struct hostent *ent; ++ struct addrinfo hints, *servinfo = NULL; ++ char portnumber_string[4]; ++ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_family = AF_UNSPEC; ++ hints.ai_socktype = SOCK_STREAM; + + // Address + addr = (const char *)g_hash_table_lookup(handler_config, "addr"); +@@ -1941,16 +1946,16 @@ cIpmi::AllocConnection( GHashTable *handler_config ) + } + + stdlog << "AllocConnection: addr = '" << addr << "'.\n"; +- ent = gethostbyname( addr ); ++ (void)sprintf(portnumber_string, "%d", lan_port); + +- if ( !ent ) ++ if (getaddrinfo(addr, portnumber_string, &hints, &servinfo) != 0) + { + stdlog << "Unable to resolve IPMI LAN address: " << addr << " !\n"; + return 0; + } + +- memcpy( &lan_addr, ent->h_addr_list[0], ent->h_length ); +- unsigned int a = *(unsigned int *)(void *)ent->h_addr_list[0]; ++ memcpy(&lan_addr, servinfo->ai_addr, servinfo->ai_addrlen); ++ unsigned int a = *(unsigned int *)(void *)servinfo->ai_addr; + + stdlog << "Using host at " + << (int)(a & 0xff) << "." +@@ -1958,6 +1963,8 @@ cIpmi::AllocConnection( GHashTable *handler_config ) + << (int)((a >> 16) & 0xff) << "." + << (int)((a >> 24) & 0xff) << ".\n"; + ++ freeaddrinfo(servinfo); ++ + // Port + lan_port = GetIntNotNull( handler_config, "port", 623 ); + diff --git a/openhpi.spec b/openhpi.spec index 51a8a2a..42d8118 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -3,7 +3,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 6%{?dist} +Release: 7%{?dist} License: BSD Group: System Environment/Base URL: http://www.openhpi.org @@ -13,6 +13,7 @@ Patch0: %{name}-3.4.0-systemd.patch Patch1: %{name}-3.6.1-ssl.patch Patch2: %{name}-3.7.0-multilib.patch Patch3: %{name}-3.8.0-manpage-scan.patch +Patch4: %{name}-3.8.0-ipv6-ipmidirect.patch BuildRequires: gcc-c++ BuildRequires: libsysfs-devel BuildRequires: net-snmp-devel @@ -152,6 +153,9 @@ make check %changelog +* Thu Nov 29 2018 Than Ngo - 3.8.0-7 +- add ipv6 support for ipmidirect + * Tue Aug 07 2018 Than Ngo - 3.8.0-6 - install README-dynamic_simulator From 0340c669633b6692b8c2a038e20bb6fdb69f1a56 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Wed, 5 Dec 2018 17:11:00 +0100 Subject: [PATCH 08/40] fix #1654725, testcases failed due to undefined symbol: saHpiSessionOpen --- openhpi-3.8.0-link-libopenhpi.patch | 12 ++++++++++++ openhpi.spec | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 openhpi-3.8.0-link-libopenhpi.patch diff --git a/openhpi-3.8.0-link-libopenhpi.patch b/openhpi-3.8.0-link-libopenhpi.patch new file mode 100644 index 0000000..17e075d --- /dev/null +++ b/openhpi-3.8.0-link-libopenhpi.patch @@ -0,0 +1,12 @@ +diff -up openhpi-3.8.0/plugins/snmp_bc/t/Makefile.am.me openhpi-3.8.0/plugins/snmp_bc/t/Makefile.am +--- openhpi-3.8.0/plugins/snmp_bc/t/Makefile.am.me 2018-12-05 16:27:33.041510692 +0100 ++++ openhpi-3.8.0/plugins/snmp_bc/t/Makefile.am 2018-12-05 16:33:28.956486798 +0100 +@@ -74,7 +74,7 @@ nodist_libsnmp_bc_la_SOURCES = $(GENERAT + # libopenhpi_la_LIBADD = $(top_builddir)/utils/libopenhpiutils.la + # libopenhpi_la_LDFLAGS = -L$(top_builddir)/utils -version-info @HPI_LIB_VERSION@ -export-symbols $(top_srcdir)/src/hpi.sym + +-libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la ++libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la $(top_builddir)/baselib/libopenhpi.la + libsnmp_bc_la_LDFLAGS = -L$(top_builddir)/utils -module -version-info @HPI_LIB_VERSION@ + # libsnmp_bc_la_LDFLAGS = -version 0:0:0 + diff --git a/openhpi.spec b/openhpi.spec index 42d8118..35d4bd0 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,5 +1,3 @@ -%global _hardened_build 1 - Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 @@ -14,6 +12,7 @@ Patch1: %{name}-3.6.1-ssl.patch Patch2: %{name}-3.7.0-multilib.patch Patch3: %{name}-3.8.0-manpage-scan.patch Patch4: %{name}-3.8.0-ipv6-ipmidirect.patch +Patch5: %{name}-3.8.0-link-libopenhpi.patch BuildRequires: gcc-c++ BuildRequires: libsysfs-devel BuildRequires: net-snmp-devel @@ -153,8 +152,9 @@ make check %changelog -* Thu Nov 29 2018 Than Ngo - 3.8.0-7 +* Wed Dec 05 2018 Than Ngo - 3.8.0-7 - add ipv6 support for ipmidirect +- fix #1654725, testcases failed due to undefined symbol: saHpiSessionOpen * Tue Aug 07 2018 Than Ngo - 3.8.0-6 - install README-dynamic_simulator From 20fa818834eedf634d97dce08daec9b848ed6349 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Thu, 6 Dec 2018 10:37:24 +0100 Subject: [PATCH 09/40] fixed test enviroment --- openhpi-3.8.0-link-libopenhpi.patch | 13 +++++++++++-- openhpi.spec | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/openhpi-3.8.0-link-libopenhpi.patch b/openhpi-3.8.0-link-libopenhpi.patch index 17e075d..3298511 100644 --- a/openhpi-3.8.0-link-libopenhpi.patch +++ b/openhpi-3.8.0-link-libopenhpi.patch @@ -1,6 +1,6 @@ diff -up openhpi-3.8.0/plugins/snmp_bc/t/Makefile.am.me openhpi-3.8.0/plugins/snmp_bc/t/Makefile.am ---- openhpi-3.8.0/plugins/snmp_bc/t/Makefile.am.me 2018-12-05 16:27:33.041510692 +0100 -+++ openhpi-3.8.0/plugins/snmp_bc/t/Makefile.am 2018-12-05 16:33:28.956486798 +0100 +--- openhpi-3.8.0/plugins/snmp_bc/t/Makefile.am.me 2018-12-06 10:33:50.698431653 +0100 ++++ openhpi-3.8.0/plugins/snmp_bc/t/Makefile.am 2018-12-06 10:36:09.478204907 +0100 @@ -74,7 +74,7 @@ nodist_libsnmp_bc_la_SOURCES = $(GENERAT # libopenhpi_la_LIBADD = $(top_builddir)/utils/libopenhpiutils.la # libopenhpi_la_LDFLAGS = -L$(top_builddir)/utils -version-info @HPI_LIB_VERSION@ -export-symbols $(top_srcdir)/src/hpi.sym @@ -10,3 +10,12 @@ diff -up openhpi-3.8.0/plugins/snmp_bc/t/Makefile.am.me openhpi-3.8.0/plugins/sn libsnmp_bc_la_LDFLAGS = -L$(top_builddir)/utils -module -version-info @HPI_LIB_VERSION@ # libsnmp_bc_la_LDFLAGS = -version 0:0:0 +@@ -97,7 +97,7 @@ TESTS_ENVIRONMENT = OPENHPI_CONF=$(srcd + TESTS_ENVIRONMENT += OPENHPI_SIMTEST_FILE=$(srcdir)/sim_test_file + #TESTS_ENVIRONMENT += OPENHPI_ERROR=YES + #TESTS_ENVIRONMENT += OPENHPI_DEBUG=YES +-TESTS_ENVIRONMENT += LD_LIBRARY_PATH=$(top_srcdir)/openhpid/.libs:$(top_srcdir)/ssl/.libs:$(top_srcdir)/utils/.libs:$(top_srcdir)/plugins/snmp/.libs:$(top_srcdir)/plugins/snmp_bc/t/.libs ++TESTS_ENVIRONMENT += LD_LIBRARY_PATH=$(top_srcdir)/openhpid/.libs:$(top_srcdir)/ssl/.libs:$(top_srcdir)/utils/.libs:$(top_srcdir)/plugins/snmp/.libs:$(top_srcdir)/plugins/snmp_bc/t/.libs:$(top_srcdir)/baselib/.libs:$(top_srcdir)/transport/.libs:$(top_srcdir)/marshal/.libs + TESTS_ENVIRONMENT += OPENHPI_UID_MAP=$(shell pwd)/uid_map + TESTS_ENVIRONMENT += OPENHPI_PATH=$(shell pwd) + diff --git a/openhpi.spec b/openhpi.spec index 35d4bd0..d29ef72 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -12,7 +12,7 @@ Patch1: %{name}-3.6.1-ssl.patch Patch2: %{name}-3.7.0-multilib.patch Patch3: %{name}-3.8.0-manpage-scan.patch Patch4: %{name}-3.8.0-ipv6-ipmidirect.patch -Patch5: %{name}-3.8.0-link-libopenhpi.patch +#Patch5: %{name}-3.8.0-link-libopenhpi.patch BuildRequires: gcc-c++ BuildRequires: libsysfs-devel BuildRequires: net-snmp-devel From 84464e2446067ef7b57a380a164d499c42ab6662 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Thu, 6 Dec 2018 10:53:38 +0100 Subject: [PATCH 10/40] fix typo --- openhpi.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index d29ef72..35d4bd0 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -12,7 +12,7 @@ Patch1: %{name}-3.6.1-ssl.patch Patch2: %{name}-3.7.0-multilib.patch Patch3: %{name}-3.8.0-manpage-scan.patch Patch4: %{name}-3.8.0-ipv6-ipmidirect.patch -#Patch5: %{name}-3.8.0-link-libopenhpi.patch +Patch5: %{name}-3.8.0-link-libopenhpi.patch BuildRequires: gcc-c++ BuildRequires: libsysfs-devel BuildRequires: net-snmp-devel From 825ab0f5cb18ed0af6619b9ba744a2b4ac670740 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:17:59 +0100 Subject: [PATCH 11/40] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- openhpi.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/openhpi.spec b/openhpi.spec index 35d4bd0..a0a8451 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -3,7 +3,6 @@ Name: openhpi Version: 3.8.0 Release: 7%{?dist} License: BSD -Group: System Environment/Base URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz # convert from initscript to systemd unit @@ -53,7 +52,6 @@ servers, Blade Center, and machines which export data via sysfs. %package libs -Group: System Environment/Libraries Summary: The system libraries for the OpenHPI project %description libs @@ -61,7 +59,6 @@ The system libraries for the OpenHPI project. %package devel -Group: Development/Libraries Summary: The development environment for the OpenHPI project Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: glib2-devel From 09af7dc467b4354f7cb0648259c3c860f39aa237 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 1 Feb 2019 17:24:05 +0000 Subject: [PATCH 12/40] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index a0a8451..c5a11ad 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,7 +1,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 7%{?dist} +Release: 8%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -149,6 +149,9 @@ make check %changelog +* Fri Feb 01 2019 Fedora Release Engineering - 3.8.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Wed Dec 05 2018 Than Ngo - 3.8.0-7 - add ipv6 support for ipmidirect - fix #1654725, testcases failed due to undefined symbol: saHpiSessionOpen From 2f986044a800320152cf9df742000f140aaf6436 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jul 2019 23:27:37 +0000 Subject: [PATCH 13/40] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index c5a11ad..8e4e260 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,7 +1,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 8%{?dist} +Release: 9%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -149,6 +149,9 @@ make check %changelog +* Thu Jul 25 2019 Fedora Release Engineering - 3.8.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Fri Feb 01 2019 Fedora Release Engineering - 3.8.0-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From 83651023c384e3e478fffa2e7a3afc1f9ad9ea65 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 24 Jan 2020 17:14:16 +0100 Subject: [PATCH 14/40] added gating tests --- .../Makefile | 65 ++++++++++ .../PURPOSE | 5 + .../runtest.sh | 65 ++++++++++ .../Makefile | 64 ++++++++++ .../PURPOSE | 5 + .../runtest.sh | 60 +++++++++ .../Makefile | 64 ++++++++++ .../PURPOSE | 5 + .../runtest.sh | 66 ++++++++++ .../Makefile | 64 ++++++++++ .../PURPOSE | 5 + .../runtest.sh | 83 +++++++++++++ .../Makefile | 64 ++++++++++ .../PURPOSE | 5 + .../runtest.sh | 64 ++++++++++ .../Makefile | 64 ++++++++++ .../PURPOSE | 5 + .../runtest.sh | 114 ++++++++++++++++++ .../Makefile | 65 ++++++++++ .../PURPOSE | 5 + .../runtest.sh | 45 +++++++ tests/Sanity/initscript/Makefile | 63 ++++++++++ tests/Sanity/initscript/PURPOSE | 3 + tests/Sanity/initscript/runtest.sh | 99 +++++++++++++++ .../Makefile | 64 ++++++++++ .../PURPOSE | 3 + .../runtest.sh | 110 +++++++++++++++++ tests/Sanity/testsuite/Makefile | 64 ++++++++++ tests/Sanity/testsuite/PURPOSE | 3 + tests/Sanity/testsuite/runtest.sh | 65 ++++++++++ tests/hpipower-segfault/Makefile | 67 ++++++++++ tests/hpipower-segfault/PURPOSE | 5 + tests/hpipower-segfault/runtest.sh | 54 +++++++++ tests/tests.yml | 14 +++ 34 files changed, 1596 insertions(+) create mode 100644 tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/Makefile create mode 100644 tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/PURPOSE create mode 100755 tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/runtest.sh create mode 100644 tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/Makefile create mode 100644 tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/PURPOSE create mode 100755 tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/runtest.sh create mode 100644 tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/Makefile create mode 100644 tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/PURPOSE create mode 100755 tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/runtest.sh create mode 100644 tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/Makefile create mode 100644 tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/PURPOSE create mode 100755 tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/runtest.sh create mode 100644 tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/Makefile create mode 100644 tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/PURPOSE create mode 100755 tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/runtest.sh create mode 100644 tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/Makefile create mode 100644 tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/PURPOSE create mode 100755 tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/runtest.sh create mode 100644 tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/Makefile create mode 100644 tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/PURPOSE create mode 100755 tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/runtest.sh create mode 100644 tests/Sanity/initscript/Makefile create mode 100644 tests/Sanity/initscript/PURPOSE create mode 100755 tests/Sanity/initscript/runtest.sh create mode 100644 tests/Sanity/sanity-test-simulator-and-dynsimulator/Makefile create mode 100644 tests/Sanity/sanity-test-simulator-and-dynsimulator/PURPOSE create mode 100755 tests/Sanity/sanity-test-simulator-and-dynsimulator/runtest.sh create mode 100644 tests/Sanity/testsuite/Makefile create mode 100644 tests/Sanity/testsuite/PURPOSE create mode 100755 tests/Sanity/testsuite/runtest.sh create mode 100644 tests/hpipower-segfault/Makefile create mode 100644 tests/hpipower-segfault/PURPOSE create mode 100755 tests/hpipower-segfault/runtest.sh create mode 100644 tests/tests.yml diff --git a/tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/Makefile b/tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/Makefile new file mode 100644 index 0000000..30eae89 --- /dev/null +++ b/tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/openhpi/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1 +# Description: Test for BZ#1201827 (hpisettime exits prematurely with return code 1) +# Author: Jan Scotka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# 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/openhpi/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1 +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) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Jan Scotka " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1201827 (hpisettime exits prematurely with return code 1)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: openhpi" >> $(METADATA) + @echo "Requires: openhpi" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1201827" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/PURPOSE b/tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/PURPOSE new file mode 100644 index 0000000..5419610 --- /dev/null +++ b/tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/openhpi/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1 +Description: Test for BZ#1201827 (hpisettime exits prematurely with return code 1) +Author: Jan Scotka +Bug summary: hpisettime exits prematurely with return code 1 (openhpi) +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1201827 diff --git a/tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/runtest.sh b/tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/runtest.sh new file mode 100755 index 0000000..87ce981 --- /dev/null +++ b/tests/Regression/bz1201827-hpisettime-exits-prematurely-with-return-code-1/runtest.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Author: Jan Scotka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# 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 Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="openhpi" +CONFIG=""" +handler libsimulator { + entity_root = \"{SYSTEM_CHASSIS,3}\" + name = \"simulator\" +} + +handler libsimulator { + entity_root = \"{SYSTEM_CHASSIS,4}\" + name = \"simulator2\" +} + +""" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlFileBackup /etc/openhpi/openhpi.conf + rlRun "echo '$CONFIG' > /etc/openhpi/openhpi.conf" + rlServiceStart openhpid + rlRun "systemctl status -l openhpid" + sleep 5 + rlPhaseEnd + + rlPhaseStartTest + export G_MESSAGES_DEBUG=all + rlRun "hpisettime -t 12:00:00 -d 03/12/2015 -X" + + rlPhaseEnd + + rlPhaseStartCleanup + rlFileRestore + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/Makefile b/tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/Makefile new file mode 100644 index 0000000..49da2b4 --- /dev/null +++ b/tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/openhpi/Regression/bz1255041-openhpid-g-mutex-clear-called-on +# Description: Test for BZ#1255041 (openhpid[...] g_mutex_clear() called on) +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/openhpi/Regression/bz1255041-openhpid-g-mutex-clear-called-on +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) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Radka Skvarilova " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1255041 (openhpid[...] g_mutex_clear() called on)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: openhpi" >> $(METADATA) + @echo "Requires: openhpi" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1255041" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/PURPOSE b/tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/PURPOSE new file mode 100644 index 0000000..7a34ee8 --- /dev/null +++ b/tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/openhpi/Regression/bz1255041-openhpid-g-mutex-clear-called-on +Description: Test for BZ#1255041 (openhpid[...] g_mutex_clear() called on) +Author: Radka Skvarilova +Bug summary: openhpid[...]: g_mutex_clear() called on uninitialised or locked mutex +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1255041 diff --git a/tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/runtest.sh b/tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/runtest.sh new file mode 100755 index 0000000..165e6be --- /dev/null +++ b/tests/Regression/bz1255041-openhpid-g-mutex-clear-called-on/runtest.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/openhpi/Regression/bz1255041-openhpid-g-mutex-clear-called-on +# Description: Test for BZ#1255041 (openhpid[...] g_mutex_clear() called on) +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="openhpi" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlFileBackup "/etc/openhpi/openhpi.conf" + rlFileBackup --clean "/var/lib/openhpi/uid_map" + rlRun "sed -i 's/OPENHPI_UNCONFIGURED = \"YES\"/OPENHPI_UNCONFIGURED = \"NO\" /' /etc/openhpi/openhpi.conf" + rlPhaseEnd + + rlPhaseStartTest + rlServiceStart openhpid + sleep 3 + rlServiceRestart openhpid + sleep 3 + rlServiceStop openhpid + + rlRun "journalctl |grep openhpi| grep 'g_mutex_clear() called on uninitialised or locked mutex' " 1 "Check the error in logs" + rlPhaseEnd + + rlPhaseStartCleanup + rlFileRestore + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/Makefile b/tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/Makefile new file mode 100644 index 0000000..10cf8de --- /dev/null +++ b/tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/openhpi/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed +# Description: Test for BZ#1259719 (hpithres, segmentation fault in case input closed) +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/openhpi/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed +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) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Radka Skvarilova " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1259719 (hpithres, segmentation fault in case input closed)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: openhpi" >> $(METADATA) + @echo "Requires: openhpi" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1259719" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/PURPOSE b/tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/PURPOSE new file mode 100644 index 0000000..48eab8c --- /dev/null +++ b/tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/openhpi/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed +Description: Test for BZ#1259719 (hpithres, segmentation fault in case input closed) +Author: Radka Skvarilova +Bug summary: hpithres, segmentation fault in case input closed +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1259719 diff --git a/tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/runtest.sh b/tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/runtest.sh new file mode 100755 index 0000000..59e5bb1 --- /dev/null +++ b/tests/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed/runtest.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/openhpi/Regression/bz1259719-hpithres-segmentation-fault-in-case-input-closed +# Description: Test for BZ#1259719 (hpithres, segmentation fault in case input closed) +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="openhpi" +CONFIG=""" +handler libsimulator { + entity_root = \"{SYSTEM_CHASSIS,3}\" + name = \"simulator\" +} + +handler libsimulator { + entity_root = \"{SYSTEM_CHASSIS,4}\" + name = \"simulator2\" +} + +""" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlFileBackup /etc/openhpi/openhpi.conf + rlFileBackup --clean /var/lib/openhpi/uid_map + rlRun "echo '$CONFIG' > /etc/openhpi/openhpi.conf" + rlServiceStart openhpid + rlRun "systemctl status -l openhpid" + sleep 5 + rlPhaseEnd + + rlPhaseStartTest + rlRun ' echo "rpt" | hpithres ' 0 "Test if there is no segmentation fault" + rlPhaseEnd + + rlPhaseStartCleanup + rlServiceRestore openhpid + rlFileRestore + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/Makefile b/tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/Makefile new file mode 100644 index 0000000..abc4c70 --- /dev/null +++ b/tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/openhpi/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not +# Description: Test for BZ#1259729 (hpi_shell - Attempt to unlock mutex that was not) +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/openhpi/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not +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) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Radka Skvarilova " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1259729 (hpi_shell - Attempt to unlock mutex that was not)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: openhpi" >> $(METADATA) + @echo "Requires: openhpi" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1259729" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/PURPOSE b/tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/PURPOSE new file mode 100644 index 0000000..c98d93b --- /dev/null +++ b/tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/openhpi/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not +Description: Test for BZ#1259729 (hpi_shell - Attempt to unlock mutex that was not) +Author: Radka Skvarilova +Bug summary: hpi_shell - Attempt to unlock mutex that was not locked +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1259729 diff --git a/tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/runtest.sh b/tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/runtest.sh new file mode 100755 index 0000000..30e33d5 --- /dev/null +++ b/tests/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not/runtest.sh @@ -0,0 +1,83 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/openhpi/Regression/bz1259729-hpi-shell-Attempt-to-unlock-mutex-that-was-not +# Description: Test for BZ#1259729 (hpi_shell - Attempt to unlock mutex that was not) +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="openhpi" +CONFIG=""" +handler libsimulator { + entity_root = \"{SYSTEM_CHASSIS,3}\" + name = \"simulator\" +} + +handler libsimulator { + entity_root = \"{SYSTEM_CHASSIS,4}\" + name = \"simulator2\" +} + +""" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlFileBackup /etc/openhpi/openhpi.conf + rlFileBackup --clean /var/lib/openhpi/uid_map + rlRun "echo '$CONFIG' > /etc/openhpi/openhpi.conf" + rlServiceStart openhpid + rlRun "systemctl status -l openhpid" + sleep 5 + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + # try some random hpi commands + export G_MESSAGES_DEBUG=all + rlRun "hpisettime -t 12:00:00 -d 03/12/2015 -X" 0 "Just run few hpi commands" + rlRun "hpidomain" 0 "Just run few hpi commands" + rlRun "hpialarms" 0 "Just run few hpi commands" + rlRun "hpiel" 0 "Just run few hpi commands" + + # test for bug 1259729 + rlRun "echo q |hpi_shell " 0,1 "Test if there is not problem with mutex lock (134 return code)" + rlServiceStop openhpid + sleep 5 + rlServiceStart openhpid + sleep 5 + rlRun "echo q |hpi_shell " 0,1 "Test if there is not problem with mutex lock (134 return code)" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlFileRestore + rlServiceRestore openhpid + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/Makefile b/tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/Makefile new file mode 100644 index 0000000..6125890 --- /dev/null +++ b/tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/openhpi/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or +# Description: Test for BZ#1262220 (Error in `/usr/sbin/openhpid' double free or) +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/openhpi/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or +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) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Radka Skvarilova " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1262220 (Error in \`/usr/sbin/openhpid' double free or)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: openhpi" >> $(METADATA) + @echo "Requires: openhpi" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1262220" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/PURPOSE b/tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/PURPOSE new file mode 100644 index 0000000..b6c717c --- /dev/null +++ b/tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/openhpi/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or +Description: Test for BZ#1262220 (Error in `/usr/sbin/openhpid' double free or) +Author: Radka Skvarilova +Bug summary: Error in `/usr/sbin/openhpid': double free or corruption (!prev) +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1262220 diff --git a/tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/runtest.sh b/tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/runtest.sh new file mode 100755 index 0000000..2f14a91 --- /dev/null +++ b/tests/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or/runtest.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/openhpi/Regression/bz1262220-Error-in-usr-sbin-openhpid-double-free-or +# Description: Test for BZ#1262220 (Error in `/usr/sbin/openhpid' double free or) +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="openhpi" + + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlFileBackup "/etc/openhpi/openhpi.conf" + rlFileBackup --clean "/var/lib/openhpi/uid_map" + rlRun "sed -i 's/OPENHPI_UNCONFIGURED = \"YES\"/OPENHPI_UNCONFIGURED = \"NO\" /' /etc/openhpi/openhpi.conf" + rlRun "sed -i -e '/#handler libsysfs2hpi/,+3 s/^#//' /etc/openhpi/openhpi.conf" + + rlPhaseEnd + + rlPhaseStartTest + rlServiceStart openhpid + sleep 5 + rlServiceStop openhpid + rlRun "journalctl |grep 'double free or corruption' " 1 "Check the error in logs" + + + + rlPhaseEnd + + rlPhaseStartCleanup + rlFileRestore + rlServiceRestore openhpid + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/Makefile b/tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/Makefile new file mode 100644 index 0000000..0a09642 --- /dev/null +++ b/tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/openhpi/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions +# Description: Test for BZ#1382339 ([Nokia] openhpi creates logs with 666 permissions) +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/openhpi/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions +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) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Radka Skvarilova " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1382339 ([Nokia] openhpi creates logs with 666 permissions)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: openhpi" >> $(METADATA) + @echo "Requires: openhpi" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1382339" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/PURPOSE b/tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/PURPOSE new file mode 100644 index 0000000..4f977a1 --- /dev/null +++ b/tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/openhpi/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions +Description: Test for BZ#1382339 ([Nokia] openhpi creates logs with 666 permissions) +Author: Radka Skvarilova +Bug summary: [Nokia] openhpi creates logs with 666 permissions +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1382339 diff --git a/tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/runtest.sh b/tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/runtest.sh new file mode 100755 index 0000000..78f3765 --- /dev/null +++ b/tests/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions/runtest.sh @@ -0,0 +1,114 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/openhpi/Regression/bz1382339-Nokia-openhpi-creates-logs-with-666-permissions +# Description: Test for BZ#1382339 ([Nokia] openhpi creates logs with 666 permissions) +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="openhpi" +CONFIG=""" +handler libdyn_simulator { + entity_root = \"{SYSTEM_CHASSIS,9}\" + logflags = \"file stdout\" + logfile = \"/var/log/dynsim\" + logfile_max = \"5\" +} + +""" +SEL=$(getenforce) + +rlJournalStart + rlPhaseStartSetup + rlRun "setenforce 0" + rlAssertRpm $PACKAGE + rlFileBackup "/usr/lib/systemd/system/openhpid.service" + rlFileBackup "/etc/openhpi/openhpi.conf" + rlFileBackup --clean "/var/lib/openhpi/uid_map" + rlRun "echo '$CONFIG' > /etc/openhpi/openhpi.conf" + rlServiceStart openhpid + cat /etc/openhpi/openhpi.conf + rlRun "systemctl status -l openhpid" #check the setting output + rlServiceStop openhpid + sleep 5 + rlPhaseEnd + + + rlPhaseStartTest "Default" + UMASK=$((10#$(umask))) #umask in decimal number + UMASK="${UMASK/7/6/}" + PERM=$((666-$UMASK)) #count permissions for log file + rlRun "rm -rf /var/log/dyn* " 0 "Removed old logs" + rlRun "systemctl start openhpid" #start service + sleep 5 + stat -c '%a %n' /var/log/dyn* | while read -r line ; do + FILE=$(echo $line| cut -f 2 -d " ") + NUMBER=$(echo $line| cut -f 1 -d " ") + rlAssertEquals "Check the permissons for $FILE" "$NUMBER" "$PERM" + done + rlRun "systemctl stop openhpid" + rlPhaseEnd + + rlPhaseStartTest "Changed 0027" + sed -i '/\[Service\]/a UMask=027' /usr/lib/systemd/system/openhpid.service + rlRun "systemctl daemon-reload" + UMASK=26 #umask in decimal number -7 write as 6 accoring to counting + PERM=$((666-$UMASK)) #count permissions for log file + rlRun "rm -rf /var/log/dyn* " 0 "Removed old logs" + rlRun "systemctl start openhpid" #start service + sleep 5 + stat -c '%a %n' /var/log/dyn* | while read -r line ; do #read permissons and file names + FILE=$(echo $line| cut -f 2 -d " ") #file name + NUMBER=$(echo $line| cut -f 1 -d " ") #permission number + rlAssertEquals "Check the permissons for $FILE" "$NUMBER" "$PERM" + done + rlRun "systemctl stop openhpid" + rlPhaseEnd + + rlPhaseStartTest "Changed 0002" + sed -i 's/UMask=027/UMask=002/' /usr/lib/systemd/system/openhpid.service + rlRun "systemctl daemon-reload" + UMASK=2 #umask in decimal number -7 write as 6 accoring to counting + PERM=$((666-$UMASK)) #count permissions for log file + rlRun "rm -rf /var/log/dyn* " 0 "Removed old logs" + rlRun "systemctl start openhpid" #start service + sleep 5 + stat -c '%a %n' /var/log/dyn* | while read -r line ; do #read permissons and file names + FILE=$(echo $line| cut -f 2 -d " ") #file name + NUMBER=$(echo $line| cut -f 1 -d " ") #permission number + rlAssertEquals "Check the permissons for $FILE" "$NUMBER" "$PERM" + done + rlRun "systemctl stop openhpid" + rlPhaseEnd + + rlPhaseStartCleanup + rlServiceRestore openhpid + rlFileRestore + rlRun "setenforce $SEL" + rlRun "systemctl daemon-reload" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/Makefile b/tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/Makefile new file mode 100644 index 0000000..e3fa725 --- /dev/null +++ b/tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/openhpi/Sanity/bz1063367-openhpi-creates-world-writeable-directory +# Description: Test for BZ#1063367 (openhpi creates world writeable directory) +# Author: Jan Scotka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# 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/openhpi/Sanity/bz1063367-openhpi-creates-world-writeable-directory +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) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Jan Scotka " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1063367 (openhpi creates world writeable directory)" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: openhpi" >> $(METADATA) + @echo "Requires: openhpi" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1063367" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/PURPOSE b/tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/PURPOSE new file mode 100644 index 0000000..abd3a7a --- /dev/null +++ b/tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/openhpi/Sanity/bz1063367-openhpi-creates-world-writeable-directory +Description: Test for BZ#1063367 (openhpi creates world writeable directory) +Author: Jan Scotka +Bug summary: openhpi creates world writeable directory +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1063367 diff --git a/tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/runtest.sh b/tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/runtest.sh new file mode 100755 index 0000000..dcdf3e4 --- /dev/null +++ b/tests/Sanity/bz1063367-openhpi-creates-world-writeable-directory/runtest.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/openhpi/Sanity/bz1063367-openhpi-creates-world-writeable-directory +# Description: Test for BZ#1063367 (openhpi creates world writeable directory) +# Author: Jan Scotka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# 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 Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="openhpi" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest + rlRun "ls /var/lib/openhpi -alhd | egrep '^drwxr-xr-t\.'" + rlPhaseEnd + +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/initscript/Makefile b/tests/Sanity/initscript/Makefile new file mode 100644 index 0000000..396689c --- /dev/null +++ b/tests/Sanity/initscript/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/openhpi/Sanity/initscript +# Description: Init script should meet LSB specifications +# Author: Yulia Kopkova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2009 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/openhpi/Sanity/initscript +export TESTVERSION=1.1 + +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: Petr Sklenar " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Init script should meet LSB specifications" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: openhpi" >> $(METADATA) + @echo "Requires: openhpi" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: RHEL6" >> $(METADATA) + rhts-lint $(METADATA) diff --git a/tests/Sanity/initscript/PURPOSE b/tests/Sanity/initscript/PURPOSE new file mode 100644 index 0000000..b3d2062 --- /dev/null +++ b/tests/Sanity/initscript/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/openhpi/Sanity/initscript +Description: Init script should meet LSB specifications +Author: Yulia Kopkova diff --git a/tests/Sanity/initscript/runtest.sh b/tests/Sanity/initscript/runtest.sh new file mode 100755 index 0000000..479e156 --- /dev/null +++ b/tests/Sanity/initscript/runtest.sh @@ -0,0 +1,99 @@ +#!/bin/bash +# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/openhpi/Sanity/initscript +# Description: Init script should meet LSB specifications +# Author: Jan Scotka , Yulia Kopkova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2009 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/rhts-library/rhtslib.sh + +PACKAGE="openhpi" + +SERVICE="openhpid" + +rlJournalStart + + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "useradd testuserqa" 0 "Add test user" + rlServiceStop $SERVICE + rlPhaseEnd + + rlPhaseStartTest + + rlLog ">>>>>>>>> service start" + rlRun "service $SERVICE start" 0 " Service must start without problem" + rlRun "service $SERVICE status" 0 " Then Status command " + rlRun "service $SERVICE start" 0 " Already started service " + rlRun "service $SERVICE status" 0 " Again status command " + + rlLog ">>>>>>>>> service restart" + rlRun "service $SERVICE restart" 0 " Restarting of service" + rlRun "service $SERVICE status" 0 " Status command " + + rlLog ">>>>>>>>> service stop" + rlRun "service $SERVICE stop" 0 " Stopping service " + rlRun "service $SERVICE status" 3 " Status of stopped service " + rlRun "service $SERVICE stop" 0 " Stopping service again " + rlRun "service $SERVICE status" 3 " Status of stopped service " + + rlLog ">>>>>>>>> pid file" + rlServiceStart $SERVICE + rlAssertExists "/var/run/$SERVICE.pid" "Pid file /var/run/$SERVICE.pid must exist" + rlRun "kill -9 `pidof $SERVICE`" 0 "Kill $SERVICE" + rlRun "service $SERVICE status" 1 " Existing pid file, but service not started " + rlRun "rm -fv /var/run/$SERVICE.pid" 0 "Remove .pid file" + + rlLog ">>>>>>>>> lock file" + rlAssertExists "/var/lock/subsys/$SERVICE" "Lock file /var/lock/subsys/$SERVICE must exist" + rlRun "service $SERVICE status" 2 " Existing lock file, but service not started " + rlServiceStop $SERVICE + + rlLog ">>>>>>>>> insufficient rights" + rlRun "service $SERVICE start " 0 " Starting service for restarting under nonpriv user " + rlRun "su testuserqa -c 'service $SERVICE restart'" 4 "Insufficient rights, restarting service under nonprivileged user must fail" + + rlLog ">>>>>>>>> operations" + rlRun "service $SERVICE start" 0 " Service have to implement start function " + rlRun "service $SERVICE restart" 0 " Service have to implement restart function " + rlRun "service $SERVICE status" 0 " Service have to implement status function " + rlRun "service $SERVICE condrestart" 0 " Service have to implement condrestart function " + rlRun "service $SERVICE try-restart" 0 " Service have to implement try-restart function " + rlRun "service $SERVICE reload" 0 " Service have to implement reload function " + rlRun "service $SERVICE force-reload" 0 " Service have to implement force-reload function " + + rlLog ">>>>>>>>> nonexist operations" + rlRun "service $SERVICE noexistop" 2 " Testing proper return code when nonexisting function" + + rlPhaseEnd + + rlPhaseStartCleanup + rlServiceRestore $SERVICE + rlRun "userdel -fr testuserqa" 0 "Remove test user" + rlPhaseEnd + +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/sanity-test-simulator-and-dynsimulator/Makefile b/tests/Sanity/sanity-test-simulator-and-dynsimulator/Makefile new file mode 100644 index 0000000..ae68791 --- /dev/null +++ b/tests/Sanity/sanity-test-simulator-and-dynsimulator/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/openhpi/Sanity/sanity-test-simulator-and-dynsimulator +# Description: It use 2 simulators and one dyn simulator config +# Author: Jan Scotka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# 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/openhpi/Sanity/sanity-test-simulator-and-dynsimulator +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) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Jan Scotka " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: It use 2 simulators and one dyn simulator config" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: openhpi" >> $(METADATA) + @echo "Requires: openhpi openhpi-libs" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/sanity-test-simulator-and-dynsimulator/PURPOSE b/tests/Sanity/sanity-test-simulator-and-dynsimulator/PURPOSE new file mode 100644 index 0000000..bef72a4 --- /dev/null +++ b/tests/Sanity/sanity-test-simulator-and-dynsimulator/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/openhpi/Sanity/sanity-test-simulator-and-dynsimulator +Description: It use 2 simulators and one dyn simulator config +Author: Jan Scotka diff --git a/tests/Sanity/sanity-test-simulator-and-dynsimulator/runtest.sh b/tests/Sanity/sanity-test-simulator-and-dynsimulator/runtest.sh new file mode 100755 index 0000000..62fe561 --- /dev/null +++ b/tests/Sanity/sanity-test-simulator-and-dynsimulator/runtest.sh @@ -0,0 +1,110 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/openhpi/Sanity/sanity-test-simulator-and-dynsimulator +# Description: It use 2 simulators and one dyn simulator config +# Author: Jan Scotka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# 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 Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="openhpi" +CONFIG=""" +handler libsimulator { + entity_root = \"{SYSTEM_CHASSIS,3}\" + name = \"simulator\" +} + +handler libsimulator { + entity_root = \"{SYSTEM_CHASSIS,4}\" + name = \"simulator2\" +} +handler libdyn_simulator { + entity_root = \"{SYSTEM_CHASSIS,5}\" + file = \"/etc/openhpi/simulation.data\" + logflags = \"file stdout\" + logfile = \"/var/log/dynsim\" + logfile_max = \"5\" +} + +""" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlFileBackup /etc/openhpi/openhpi.conf + rlRun "echo '$CONFIG' > /etc/openhpi/openhpi.conf" + rlServiceStart openhpid +if rlIsRHEL 6; then + rlRun "service openhpid status" +else + rlRun "systemctl status -l openhpid" +fi + sleep 5 + rlPhaseEnd + + rlPhaseStartTest + + rlRun "hpialarms |grep Chassis" + rlRun "hpiel |egrep 'EventLogInfo for Chassis 3'" + rlRun "hpiel |egrep 'EventLogInfo for Chassis 4'" + rlRun "hpiinv |egrep -A 1 'SYSTEM_CHASSIS:4' |egrep 'Simulator HS DASD'" + rlRun "hpipower -d -b 3" + rlRun "hpitop | egrep -A 5 '{SYSTEM_CHASSIS,3}' |grep 'Planar CPU area temperature sensor'" + rlRun "hpiwdt | grep -A 3 'Chassis 3 has watchdog capability'" + rlRun "hpievents | egrep 'rptentry\[[0-9]+\] tag: Chassis 4'" + rlRun "hpionIBMblade |grep 'This program came with OpenHPI'" + hpisettime -d 02/02/2015 -t 24:15:50 +# it sometimes fail from some unknow reason + rlRun "timedatectl" #add according to failing ppc64 + rlRun "hpisettime -d 02/02/2015 -t 24:15:50 | egrep '.*2015-02-03 00:1'" + rlRun "echo -e 'rpt\n\nq' | hpithres |grep 'Chassis 4'" + +if rlIsRHEL ">6"; then + rlRun "hpidomain | grep 'Serving Daemon on Host:'" + rlRun "test `hpialarms |grep Chassis |wc -l` -eq 3" + rlRun "hpifan | egrep 'Entity Path.*5'" + rlRun "test `hpifan | egrep 'Entity Path.*[3-5]'|wc -l` -eq 3" + rlRun "hpipower -d -b 3 | grep 'Chassis 3 3 is already powered off'" + rlRun "hpipower -p -b 3 | grep 'Chassis 3 3 has been successfully powered on'" + rlRun "hpisensor | egrep -A 5 '{SYSTEM_CHASSIS,5}{FAN,1}' |grep 'Fan Analog Control'" + rlRun "hpigensimdata |egrep -A 4 'Chassis 4' |egrep 'SENSOR'" + rlRun "test 5000 -lt `hpigensimdata |wc -l`" + rlRun "hpireset -r -D 0 | egrep 'Chassis 4'" + rlRun "hpitree |egrep '{SYSTEM_CHASSIS,5}{FAN,1}' | grep 'Blower fan speed'" + rlRun "hpixml |egrep '{SYSTEM_CHASSIS,5}{FAN,1}' |egrep '.*'" + rlRun "timedatectl" #add according to failing ppc64 + rlRun "hpisettime -d 02/02/2015 -t 24:15:50 | egrep -A 2 'Current event' | egrep 'Read-Back-Check.*2015-02-03 00:15:50'" + +fi + + rlPhaseEnd + + rlPhaseStartCleanup + # rlFileRestore + rlServiceRestore openhpid + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/testsuite/Makefile b/tests/Sanity/testsuite/Makefile new file mode 100644 index 0000000..2894b2a --- /dev/null +++ b/tests/Sanity/testsuite/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/openhpi/Sanity/testsuite +# Description: Running openhpi testsuite +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/openhpi/Sanity/testsuite +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) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Radka Skvarilova " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Running openhpi testsuite" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 30m" >> $(METADATA) + @echo "RunFor: openhpi" >> $(METADATA) + @echo "Requires: openhpi audit-libs-devel autoconf automake coreutils gettext-devel libselinux-devel libutempter-devel ncurses-devel pam-devel popt-devel rpm-build systemd-devel texinfo util-linux zlib-devel yum-utils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1267928" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/testsuite/PURPOSE b/tests/Sanity/testsuite/PURPOSE new file mode 100644 index 0000000..af170e7 --- /dev/null +++ b/tests/Sanity/testsuite/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/openhpi/Sanity/testsuite +Description: Running openhpi testsuite +Author: Radka Skvarilova diff --git a/tests/Sanity/testsuite/runtest.sh b/tests/Sanity/testsuite/runtest.sh new file mode 100755 index 0000000..05ebbcc --- /dev/null +++ b/tests/Sanity/testsuite/runtest.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/openhpi/Sanity/testsuite +# Description: Running openhpi testsuite +# Author: Radka Skvarilova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="openhpi" +YUM=dnf +if rlIsRHEL '<8' ; then + YUM=yum +fi +if rlIsRHEL 8 ; then + RHEL8_OPTION="--enablerepo rhel-CRB-latest" +fi + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlFetchSrcForInstalled $PACKAGE + rlRun "$YUM -y groupinstall 'Development Tools'" + rlRun "yum-builddep $RHEL8_OPTION -y *src.rpm" + rlLogInfo "Sources fetched: `ls *src.rpm`" + rlRun "rpm -q `basename *src.rpm .src.rpm`" 0 "Querying whether the sources fetched match the installed package" + rlRun "rpmbuild --recompile *src.rpm" 0 "Recompiling the sources" + rlPhaseEnd + + rlPhaseStartTest + rlRun "pushd /root/rpmbuild/BUILD/openhpi-*/" + rlRun "make check" 0 "Compile and run the tests" + rlRun "popd" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/hpipower-segfault/Makefile b/tests/hpipower-segfault/Makefile new file mode 100644 index 0000000..b77cf0e --- /dev/null +++ b/tests/hpipower-segfault/Makefile @@ -0,0 +1,67 @@ +# Copyright (c) 2006 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 v.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. +# +# Author: Radek Biba + +# The toplevel namespace within which the test lives. +TOPLEVEL_NAMESPACE=/CoreOS + +# The name of the package under test: +PACKAGE_NAME=openhpi + +# The path of the test below the package: +RELATIVE_PATH=hpipower-segfault + +# Version of the Test. Used with make tag. +export TESTVERSION=1.0 + +# The compiled namespace of the test. +export TEST=$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH) + +.PHONY: all install download clean + +BUILT_FILES=# executables to be built should be added here, they will be generated on the system under test. + + +FILES=$(METADATA) runtest.sh Makefile + + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x ./runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + +# Include Common Makefile +include /usr/share/rhts/lib/rhts-make.include + +# Generate the testinfo.desc here: +$(METADATA): Makefile + @touch $(METADATA) + @echo "Owner: Radek Biba " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: Check if hpipower doesn't segfault">> $(METADATA) + @echo "Bug: 247643" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: $(PACKAGE_NAME) " >> $(METADATA) # add any other packages for which your test ought to run here + @echo "Requires: $(PACKAGE_NAME) " >> $(METADATA) # add any other requirements for the script to run here + @echo "Priority: Normal" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + rhts-lint $(METADATA) diff --git a/tests/hpipower-segfault/PURPOSE b/tests/hpipower-segfault/PURPOSE new file mode 100644 index 0000000..a79f747 --- /dev/null +++ b/tests/hpipower-segfault/PURPOSE @@ -0,0 +1,5 @@ +A regression test for bug 247643: + openhpi-2.8.1-2.el5.4: segfault in hpipower utility + +Previously, hpipower would segfault if a user specified an invalid +blade index. diff --git a/tests/hpipower-segfault/runtest.sh b/tests/hpipower-segfault/runtest.sh new file mode 100755 index 0000000..4519e7f --- /dev/null +++ b/tests/hpipower-segfault/runtest.sh @@ -0,0 +1,54 @@ +#!/bin/sh + +# Copyright (c) 2006 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 v.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. +# +# Author: Radek Biba + +. /usr/bin/rhts-environment.sh + +exec 5>&1 6>&2 +exec >> ${OUTPUTFILE} 2>&1 + +result=FAIL + +# Check if openhpid is already running +service openhpid status &> /dev/null && hpi_was_on=1 || hpi_was_on=0 + +# If not, start the openhpi daemon and a wait a few seconds +if [ $hpi_was_on -eq 0 ]; then + service openhpid start + sleep 5 +fi + +# Run hpipower with an index that surely doesn't exist, +# there's no apparent way to find the first unused index. +# Number 3 means displaying status. +# The wrong version will segfault here. + +echo 3 | hpipower -b 9 + +if [ $? -eq 255 ]; then + echo + echo 'Success' + result=PASS +fi + + +# Stop the daemon unless it was running before the test +if [ $hpi_was_on -eq 0 ]; then + service openhpid stop +fi + +exec 1>&5 2>&6 +report_result $TEST $result diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..f09ae13 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,14 @@ +--- +# Run tests in all contexts +- hosts: localhost + tags: + - classic + roles: + - role: standard-test-beakerlib + tests: + - hpipower-segfault + - Regression + - Sanity + required_packages: + - openhpi + - man-db From f46648cf93c39241d097bcae8048bff936b10109 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 24 Jan 2020 20:29:02 +0100 Subject: [PATCH 15/40] fix testcase for using systemd --- tests/Sanity/initscript/runtest.sh | 48 ++++++++++++++---------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/tests/Sanity/initscript/runtest.sh b/tests/Sanity/initscript/runtest.sh index 479e156..4e1b794 100755 --- a/tests/Sanity/initscript/runtest.sh +++ b/tests/Sanity/initscript/runtest.sh @@ -33,6 +33,7 @@ PACKAGE="openhpi" SERVICE="openhpid" +SERVICE_CMD=systemctl rlJournalStart @@ -45,48 +46,43 @@ rlJournalStart rlPhaseStartTest rlLog ">>>>>>>>> service start" - rlRun "service $SERVICE start" 0 " Service must start without problem" - rlRun "service $SERVICE status" 0 " Then Status command " - rlRun "service $SERVICE start" 0 " Already started service " - rlRun "service $SERVICE status" 0 " Again status command " + rlRun "$SERVICE_CMD start $SERVICE" 0 " Service must start without problem" + rlRun "$SERVICE_CMD status $SERVICE" 0 " Then Status command " + rlRun "$SERVICE_CMD start $SERVICE" 0 " Already started service " + rlRun "$SERVICE_CMD status $SERVICE" 0 " Again status command " rlLog ">>>>>>>>> service restart" - rlRun "service $SERVICE restart" 0 " Restarting of service" - rlRun "service $SERVICE status" 0 " Status command " + rlRun "$SERVICE_CMD restart $SERVICE" 0 " Restarting of service" + rlRun "$SERVICE_CMD status $SERVICE" 0 " Status command " rlLog ">>>>>>>>> service stop" - rlRun "service $SERVICE stop" 0 " Stopping service " - rlRun "service $SERVICE status" 3 " Status of stopped service " - rlRun "service $SERVICE stop" 0 " Stopping service again " - rlRun "service $SERVICE status" 3 " Status of stopped service " + rlRun "$SERVICE_CMD stop $SERVICE" 0 " Stopping service " + rlRun "$SERVICE_CMD status $SERVICE" 3 " Status of stopped service " + rlRun "$SERVICE_CMD stop $SERVICE" 0 " Stopping service again " + rlRun "$SERVICE_CMD status $SERVICE" 3 " Status of stopped service " rlLog ">>>>>>>>> pid file" rlServiceStart $SERVICE rlAssertExists "/var/run/$SERVICE.pid" "Pid file /var/run/$SERVICE.pid must exist" rlRun "kill -9 `pidof $SERVICE`" 0 "Kill $SERVICE" - rlRun "service $SERVICE status" 1 " Existing pid file, but service not started " - rlRun "rm -fv /var/run/$SERVICE.pid" 0 "Remove .pid file" + rlRun "$SERVICE_CMD status $SERVICE" 3 " Status of stopped service " rlLog ">>>>>>>>> lock file" - rlAssertExists "/var/lock/subsys/$SERVICE" "Lock file /var/lock/subsys/$SERVICE must exist" - rlRun "service $SERVICE status" 2 " Existing lock file, but service not started " + rlAssertNotExists "/var/lock/subsys/$SERVICE" "Lock file /var/lock/subsys/$SERVICE should not exist" + rlRun "$SERVICE_CMD status $SERVICE" 3 " Status of stopped service " rlServiceStop $SERVICE rlLog ">>>>>>>>> insufficient rights" - rlRun "service $SERVICE start " 0 " Starting service for restarting under nonpriv user " - rlRun "su testuserqa -c 'service $SERVICE restart'" 4 "Insufficient rights, restarting service under nonprivileged user must fail" + rlRun "$SERVICE_CMD start $SERVICE" 0 " Starting service for restarting under nonpriv user " + rlRun "su testuserqa -c '$SERVICE_CMD restart $SERVICE'" 4 "Insufficient rights, restarting service under nonprivileged user must fail" rlLog ">>>>>>>>> operations" - rlRun "service $SERVICE start" 0 " Service have to implement start function " - rlRun "service $SERVICE restart" 0 " Service have to implement restart function " - rlRun "service $SERVICE status" 0 " Service have to implement status function " - rlRun "service $SERVICE condrestart" 0 " Service have to implement condrestart function " - rlRun "service $SERVICE try-restart" 0 " Service have to implement try-restart function " - rlRun "service $SERVICE reload" 0 " Service have to implement reload function " - rlRun "service $SERVICE force-reload" 0 " Service have to implement force-reload function " - - rlLog ">>>>>>>>> nonexist operations" - rlRun "service $SERVICE noexistop" 2 " Testing proper return code when nonexisting function" + rlRun "$SERVICE_CMD start $SERVICE" 0 " Service have to implement start function " + rlRun "$SERVICE_CMD restart $SERVICE" 0 " Service have to implement restart function " + rlRun "$SERVICE_CMD status $SERVICE" 0 " Service have to implement status function " + rlRun "$SERVICE_CMD condrestart $SERVICE" 0 " Service have to implement condrestart function " + rlRun "$SERVICE_CMD try-restart $SERVICE" 0 " Service have to implement try-restart function " + rlRun "$SERVICE_CMD force-reload $SERVICE" 0 " Service have to implement force-reload function " rlPhaseEnd From d405c0a3894a8577a2e27bdacc37ff7f9ae5dd95 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jan 2020 20:17:37 +0000 Subject: [PATCH 16/40] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 8e4e260..459ca14 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,7 +1,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 9%{?dist} +Release: 10%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -149,6 +149,9 @@ make check %changelog +* Wed Jan 29 2020 Fedora Release Engineering - 3.8.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Thu Jul 25 2019 Fedora Release Engineering - 3.8.0-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 33aa136261eb5df2e440cb8ed81628a3a10d1e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 22 Apr 2020 00:11:56 +0200 Subject: [PATCH 17/40] Rebuild (json-c) --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 459ca14..92c55d3 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,7 +1,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 10%{?dist} +Release: 11%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -149,6 +149,9 @@ make check %changelog +* Tue Apr 21 2020 Björn Esser - 3.8.0-11 +- Rebuild (json-c) + * Wed Jan 29 2020 Fedora Release Engineering - 3.8.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 7f5b3167e223c2ced0a9a569ff2743c82fb0b3ec Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 28 Jul 2020 12:43:03 +0000 Subject: [PATCH 18/40] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 92c55d3..73ef5f5 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,7 +1,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 11%{?dist} +Release: 12%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -149,6 +149,9 @@ make check %changelog +* Tue Jul 28 2020 Fedora Release Engineering - 3.8.0-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Tue Apr 21 2020 Björn Esser - 3.8.0-11 - Rebuild (json-c) From 1b7c880836c4d104f6b95ed6e9833a877cf38e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 27 Aug 2020 14:33:27 +0200 Subject: [PATCH 19/40] Rebuilt for new net-snmp release --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 73ef5f5..82746ba 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,7 +1,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 12%{?dist} +Release: 13%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -149,6 +149,9 @@ make check %changelog +* Thu Aug 27 2020 Josef Řídký - 3.8.0-13 +- Rebuilt for new net-snmp release + * Tue Jul 28 2020 Fedora Release Engineering - 3.8.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From cefd8ad0b3a19858d445dff120d1053c0f9cd671 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 7 Jan 2021 06:32:33 +0000 Subject: [PATCH 20/40] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- openhpi.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/openhpi.spec b/openhpi.spec index 82746ba..03ed444 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -12,6 +12,7 @@ Patch2: %{name}-3.7.0-multilib.patch Patch3: %{name}-3.8.0-manpage-scan.patch Patch4: %{name}-3.8.0-ipv6-ipmidirect.patch Patch5: %{name}-3.8.0-link-libopenhpi.patch +BuildRequires: make BuildRequires: gcc-c++ BuildRequires: libsysfs-devel BuildRequires: net-snmp-devel From 53a529488f8bb23057c6fa29b05a968a94e47459 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 22:30:53 +0000 Subject: [PATCH 21/40] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 03ed444..cd78e8e 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,7 +1,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 13%{?dist} +Release: 14%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -150,6 +150,9 @@ make check %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 3.8.0-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Thu Aug 27 2020 Josef Řídký - 3.8.0-13 - Rebuilt for new net-snmp release From abfc6989c400d47efd3e19afb28a9af52f105511 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Tue, 2 Mar 2021 17:21:51 +0100 Subject: [PATCH 22/40] drop BR on sysfs in rhel >=9 --- openhpi.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index cd78e8e..d0bfdbd 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,7 +1,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 14%{?dist} +Release: 15%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -14,7 +14,9 @@ Patch4: %{name}-3.8.0-ipv6-ipmidirect.patch Patch5: %{name}-3.8.0-link-libopenhpi.patch BuildRequires: make BuildRequires: gcc-c++ +%if 0%{?fedora} || 0%{?rhel} < 9 BuildRequires: libsysfs-devel +%endif BuildRequires: net-snmp-devel BuildRequires: OpenIPMI-devel BuildRequires: glib2-devel @@ -150,6 +152,9 @@ make check %changelog +* Tue Mar 02 2021 Than Ngo - 3.8.0-15 +- drop BR on sysfs in rhel >=9 + * Tue Jan 26 2021 Fedora Release Engineering - 3.8.0-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From ffbd4eefd9e852dbaee01ef93acafe7ab013f63e Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Wed, 31 Mar 2021 13:56:03 +0200 Subject: [PATCH 23/40] Add SELinux subpackage Add openhpi-selinux subpackage containing selinux policy for openhpi. This policy module will override the distribution policy. Policy files where extracted from https://github.com/fedora-selinux/selinux-policy See Independent policy project guidelines for more details about shipping custom SELinux policy. https://fedoraproject.org/wiki/SELinux/IndependentPolicy --- openhpi.spec | 79 +++++++++++++++++++++++-- openhpid.fc | 10 ++++ openhpid.if | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++ openhpid.te | 67 ++++++++++++++++++++++ 4 files changed, 309 insertions(+), 6 deletions(-) create mode 100644 openhpid.fc create mode 100644 openhpid.if create mode 100644 openhpid.te diff --git a/openhpi.spec b/openhpi.spec index d0bfdbd..1dd005b 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,11 +1,21 @@ +# defining macros needed by SELinux +%global selinuxtype targeted +%global moduletype contrib +%global modulename openhpid +%global with_selinux 1 + Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 15%{?dist} +Release: 16%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz -# convert from initscript to systemd unit +# selinux policy for openhpi, Policy files where extracted from +# https://github.com/fedora-selinux/selinux-policy +Source1: openhpid.fc +Source2: openhpid.if +Source3: openhpid.te Patch0: %{name}-3.4.0-systemd.patch Patch1: %{name}-3.6.1-ssl.patch Patch2: %{name}-3.7.0-multilib.patch @@ -33,6 +43,11 @@ BuildRequires: systemd BuildRequires: autoconf automake libtool BuildRequires: libgcrypt-devel BuildRequires: net-snmp +%if 0%{?with_selinux} +# This ensures that the *-selinux package and all it’s dependencies are not pulled +# into containers and other systems that do not use SELinux +Requires: (%{name}-selinux if selinux-policy-%{selinuxtype}) +%endif Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -53,14 +68,12 @@ easily. Many plug-ins exist in the OpenHPI source tree to provide access to various types of hardware. This includes, but is not limited to, IPMI based servers, Blade Center, and machines which export data via sysfs. - %package libs Summary: The system libraries for the OpenHPI project %description libs The system libraries for the OpenHPI project. - %package devel Summary: The development environment for the OpenHPI project Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -69,6 +82,19 @@ Requires: glib2-devel %description devel The development libraries and header files for the OpenHPI project. +%if 0%{?with_selinux} +# SELinux subpackage +%package selinux +Summary: openhpi SELinux policy +BuildArch: noarch +Requires: selinux-policy-%{selinuxtype} +Requires(post): selinux-policy-%{selinuxtype} +BuildRequires: selinux-policy-devel +%{?selinux_requires} + +%description selinux +Custom SELinux policy module +%endif %prep %autosetup -p1 @@ -88,7 +114,6 @@ if [ $UID -eq 0 ]; then find . -name openhpi.conf -execdir chown root:root . \; fi - %build export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %configure --disable-static --with-systemdsystemunitdir=%{_unitdir} --docdir=%{_docdir}/%{name}-%{version} @@ -99,6 +124,14 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} +%if 0%{?with_selinux} +# SELinux policy (originally from selinux-policy-contrib) +# this policy module will override the production module +mkdir selinux +cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} selinux/ +make -f %{_datadir}/selinux/devel/Makefile %{modulename}.pp +bzip2 -9 %{modulename}.pp +%endif %install mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name} @@ -110,9 +143,36 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/%{name}/*.la cp plugins/dynamic_simulator/README $RPM_BUILD_ROOT/%{_docdir}/%{name}-%{version}/README-dynamic_simulator +# install selinux module +install -D -m 0644 %{modulename}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2 + %check make check +%if 0%{?with_selinux} +# SELinux contexts are saved so that only affected files can be +# relabeled after the policy module installation +%pre selinux +%selinux_relabel_pre -s %{selinuxtype} + +%post selinux +%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2 +%selinux_relabel_post -s %{selinuxtype} + +if [ "$1" -le "1" ]; then # First install + %systemd_postun_with_restart openhpid.service +fi + +%postun selinux +if [ $1 -eq 0 ]; then + %selinux_modules_uninstall -s %{selinuxtype} %{modulename} + %selinux_relabel_post -s %{selinuxtype} + %systemd_postun_with_restart openhpid.service +fi + +%posttrans selinux +%selinux_relabel_post -s %{selinuxtype} +%endif %post %systemd_post openhpid.service @@ -123,7 +183,6 @@ make check %postun %systemd_postun_with_restart openhpid.service - %files %license %{_docdir}/%{name}-%{version}/COPYING %doc %{_docdir}/%{name}-%{version}/ChangeLog @@ -150,8 +209,16 @@ make check %{_includedir}/%{name} %{_libdir}/pkgconfig/*.pc +%if 0%{?with_selinux} +%files selinux +%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.* +%ghost %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename} +%endif %changelog +* Wed Mar 31 2021 Than Ngo - 3.8.0-16 +- Add openhpi-selinux subpackage containing selinux policy for openhpi + * Tue Mar 02 2021 Than Ngo - 3.8.0-15 - drop BR on sysfs in rhel >=9 diff --git a/openhpid.fc b/openhpid.fc new file mode 100644 index 0000000..df219e6 --- /dev/null +++ b/openhpid.fc @@ -0,0 +1,10 @@ + +/etc/rc\.d/init\.d/openhpid -- gen_context(system_u:object_r:openhpid_initrc_exec_t,s0) + +/usr/sbin/openhpid -- gen_context(system_u:object_r:openhpid_exec_t,s0) + +/var/lib/openhpi(/.*)? gen_context(system_u:object_r:openhpid_var_lib_t,s0) + +/var/log/dynsim[0-9]*\.log -- gen_context(system_u:object_r:openhpid_log_t,s0) + +/var/run/openhpid\.pid -- gen_context(system_u:object_r:openhpid_var_run_t,s0) diff --git a/openhpid.if b/openhpid.if new file mode 100644 index 0000000..598789a --- /dev/null +++ b/openhpid.if @@ -0,0 +1,159 @@ + +## policy for openhpid + + +######################################## +## +## Transition to openhpid. +## +## +## +## Domain allowed to transition. +## +## +# +interface(`openhpid_domtrans',` + gen_require(` + type openhpid_t, openhpid_exec_t; + ') + + corecmd_search_bin($1) + domtrans_pattern($1, openhpid_exec_t, openhpid_t) +') + + +######################################## +## +## Execute openhpid server in the openhpid domain. +## +## +## +## Domain allowed access. +## +## +# +interface(`openhpid_initrc_domtrans',` + gen_require(` + type openhpid_initrc_exec_t; + ') + + init_labeled_script_domtrans($1, openhpid_initrc_exec_t) +') + + +######################################## +## +## Search openhpid lib directories. +## +## +## +## Domain allowed access. +## +## +# +interface(`openhpid_search_lib',` + gen_require(` + type openhpid_var_lib_t; + ') + + allow $1 openhpid_var_lib_t:dir search_dir_perms; + files_search_var_lib($1) +') + +######################################## +## +## Read openhpid lib files. +## +## +## +## Domain allowed access. +## +## +# +interface(`openhpid_read_lib_files',` + gen_require(` + type openhpid_var_lib_t; + ') + + files_search_var_lib($1) + read_files_pattern($1, openhpid_var_lib_t, openhpid_var_lib_t) +') + +######################################## +## +## Manage openhpid lib files. +## +## +## +## Domain allowed access. +## +## +# +interface(`openhpid_manage_lib_files',` + gen_require(` + type openhpid_var_lib_t; + ') + + files_search_var_lib($1) + manage_files_pattern($1, openhpid_var_lib_t, openhpid_var_lib_t) +') + +######################################## +## +## Manage openhpid lib directories. +## +## +## +## Domain allowed access. +## +## +# +interface(`openhpid_manage_lib_dirs',` + gen_require(` + type openhpid_var_lib_t; + ') + + files_search_var_lib($1) + manage_dirs_pattern($1, openhpid_var_lib_t, openhpid_var_lib_t) +') + + +######################################## +## +## All of the rules required to administrate +## an openhpid environment +## +## +## +## Domain allowed access. +## +## +## +## +## Role allowed access. +## +## +## +# +interface(`openhpid_admin',` + gen_require(` + type openhpid_t; + type openhpid_initrc_exec_t; + type openhpid_var_lib_t; + ') + + allow $1 openhpid_t:process { ptrace signal_perms }; + ps_process_pattern($1, openhpid_t) + + openhpid_initrc_domtrans($1) + domain_system_change_exemption($1) + role_transition $2 openhpid_initrc_exec_t system_r; + allow $2 system_r; + + files_search_var_lib($1) + admin_pattern($1, openhpid_var_lib_t) + + + +') + diff --git a/openhpid.te b/openhpid.te new file mode 100644 index 0000000..a0e0eaf --- /dev/null +++ b/openhpid.te @@ -0,0 +1,67 @@ +policy_module(openhpid, 1.0.0) + +######################################## +# +# Declarations +# + +type openhpid_t; +type openhpid_exec_t; +init_daemon_domain(openhpid_t, openhpid_exec_t) + +type openhpid_initrc_exec_t; +init_script_file(openhpid_initrc_exec_t) + +type openhpid_log_t; +logging_log_file(openhpid_log_t) + +type openhpid_var_lib_t; +files_type(openhpid_var_lib_t) + +type openhpid_var_run_t; +files_pid_file(openhpid_var_run_t) + +######################################## +# +# openhpid local policy +# + +allow openhpid_t self:capability { kill }; +allow openhpid_t self:process signal_perms; + +allow openhpid_t self:fifo_file rw_fifo_file_perms; +allow openhpid_t self:netlink_route_socket r_netlink_socket_perms; +allow openhpid_t self:unix_stream_socket create_stream_socket_perms; +allow openhpid_t self:tcp_socket create_stream_socket_perms; +allow openhpid_t self:udp_socket create_socket_perms; + + +manage_files_pattern(openhpid_t, openhpid_log_t, openhpid_log_t) +logging_log_filetrans(openhpid_t, openhpid_log_t, file) + +manage_dirs_pattern(openhpid_t, openhpid_var_lib_t, openhpid_var_lib_t) +manage_files_pattern(openhpid_t, openhpid_var_lib_t, openhpid_var_lib_t) +files_var_lib_filetrans(openhpid_t, openhpid_var_lib_t, { dir file }) + +manage_files_pattern(openhpid_t, openhpid_var_run_t, openhpid_var_run_t) +files_pid_filetrans(openhpid_t, openhpid_var_run_t, { file }) + +kernel_read_system_state(openhpid_t) + +corenet_tcp_bind_generic_node(openhpid_t) +corenet_tcp_bind_openhpid_port(openhpid_t) +corenet_tcp_connect_http_port(openhpid_t) + +dev_read_urand(openhpid_t) +dev_rw_watchdog(openhpid_t) + +logging_send_syslog_msg(openhpid_t) + +miscfiles_read_generic_certs(openhpid_t) + +sysnet_read_config(openhpid_t) + +optional_policy(` + snmp_manage_var_lib_files(openhpid_t) + snmp_manage_var_lib_dirs(openhpid_t) +') From e189b8018c23ed00b293912559070fcda5c13b55 Mon Sep 17 00:00:00 2001 From: Vit Mojzis Date: Wed, 7 Apr 2021 14:08:02 +0200 Subject: [PATCH 24/40] selinux: remove duplicate selinux_relabel_post * selinux_relabel_post should only be called once per package, in this case in %post/%postun * "moduletype" is unused since the package is not shipping an interface file Signed-off-by: Vit Mojzis --- openhpi.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/openhpi.spec b/openhpi.spec index 1dd005b..10be02c 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -1,6 +1,5 @@ # defining macros needed by SELinux %global selinuxtype targeted -%global moduletype contrib %global modulename openhpid %global with_selinux 1 @@ -169,9 +168,6 @@ if [ $1 -eq 0 ]; then %selinux_relabel_post -s %{selinuxtype} %systemd_postun_with_restart openhpid.service fi - -%posttrans selinux -%selinux_relabel_post -s %{selinuxtype} %endif %post From 5a662765247d9021160de4f2a72be73fbebef12a Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Wed, 30 Jun 2021 10:31:22 +0200 Subject: [PATCH 25/40] Port to net-snmp without DES support --- openhpi-snmp-disable-des.patch | 35 ++++++++++++++++++++++++++++++++++ openhpi.spec | 6 +++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 openhpi-snmp-disable-des.patch diff --git a/openhpi-snmp-disable-des.patch b/openhpi-snmp-disable-des.patch new file mode 100644 index 0000000..8280e86 --- /dev/null +++ b/openhpi-snmp-disable-des.patch @@ -0,0 +1,35 @@ +This patch is required because net-smp is not build with DES support, +so usmDESPrivProtocol is not available. + +diff --git a/plugins/snmp_bc/snmp_bc_session.c b/plugins/snmp_bc/snmp_bc_session.c +index 767cdb1a77ee420e..cb724fcee0668bd5 100644 +--- a/plugins/snmp_bc/snmp_bc_session.c ++++ b/plugins/snmp_bc/snmp_bc_session.c +@@ -239,23 +239,10 @@ void *snmp_bc_open(GHashTable *handler_config, + err("Cannot find \"privacy_passwd\" configuration parameter."); + return NULL; + } +- +- custom_handle->session.securityLevel = SNMP_SEC_LEVEL_AUTHPRIV; +- custom_handle->session.securityPrivProto = usmDESPrivProtocol; +- custom_handle->session.securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN; +- custom_handle->session.securityPrivKeyLen = USM_PRIV_KU_LEN; +- if (generate_Ku(custom_handle->session.securityAuthProto, +- custom_handle->session.securityAuthProtoLen, +- (u_char *) privacy_passwd, strlen(privacy_passwd), +- custom_handle->session.securityPrivKey, +- &(custom_handle->session.securityPrivKeyLen)) != SNMPERR_SUCCESS) { +- snmp_perror("snmp_bc"); +- snmp_log(LOG_ERR, +- "Error generating Ku from private passphrase.\n"); +- err("Unable to establish SNMP authpriv session."); +- return NULL; +- } +- ++ snmp_perror("snmp_bc"); ++ snmp_log(LOG_ERR, "DES authentication is not supported.\n"); ++ err("Unable to establish SNMP authpriv session."); ++ return NULL; + } + + diff --git a/openhpi.spec b/openhpi.spec index 10be02c..af009ee 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 16%{?dist} +Release: 17%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -21,6 +21,7 @@ Patch2: %{name}-3.7.0-multilib.patch Patch3: %{name}-3.8.0-manpage-scan.patch Patch4: %{name}-3.8.0-ipv6-ipmidirect.patch Patch5: %{name}-3.8.0-link-libopenhpi.patch +Patch6: openhpi-snmp-disable-des.patch BuildRequires: make BuildRequires: gcc-c++ %if 0%{?fedora} || 0%{?rhel} < 9 @@ -212,6 +213,9 @@ fi %endif %changelog +* Wed Jun 30 2021 Than Ngo - 3.8.0-17 +- Port to net-snmp without DES support + * Wed Mar 31 2021 Than Ngo - 3.8.0-16 - Add openhpi-selinux subpackage containing selinux policy for openhpi From d905aef7bb8a6248b708c0730ae8846a2aa734a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Sat, 10 Jul 2021 11:56:33 +0200 Subject: [PATCH 26/40] Rebuild for versioned symbols in json-c --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index af009ee..1bf0d20 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 17%{?dist} +Release: 18%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -213,6 +213,9 @@ fi %endif %changelog +* Sat Jul 10 2021 Björn Esser - 3.8.0-18 +- Rebuild for versioned symbols in json-c + * Wed Jun 30 2021 Than Ngo - 3.8.0-17 - Port to net-snmp without DES support From d9810ff3a5ccec47f22cfed3fec2a5d7556ce9c9 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 22 Jul 2021 17:14:38 +0000 Subject: [PATCH 27/40] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 1bf0d20..d5c8a65 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 18%{?dist} +Release: 19%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -213,6 +213,9 @@ fi %endif %changelog +* Thu Jul 22 2021 Fedora Release Engineering - 3.8.0-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Sat Jul 10 2021 Björn Esser - 3.8.0-18 - Rebuild for versioned symbols in json-c From 80e1e8c827690a8404495d339a47d118699515de Mon Sep 17 00:00:00 2001 From: Sahana Prasad Date: Tue, 14 Sep 2021 19:09:47 +0200 Subject: [PATCH 28/40] Rebuilt with OpenSSL 3.0.0 --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index d5c8a65..274010c 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 19%{?dist} +Release: 20%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -213,6 +213,9 @@ fi %endif %changelog +* Tue Sep 14 2021 Sahana Prasad - 3.8.0-20 +- Rebuilt with OpenSSL 3.0.0 + * Thu Jul 22 2021 Fedora Release Engineering - 3.8.0-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 78a12b39cfdf4b8eefe454c3d8e68bac40011c5e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 22:22:49 +0000 Subject: [PATCH 29/40] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 274010c..997286b 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 20%{?dist} +Release: 21%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -213,6 +213,9 @@ fi %endif %changelog +* Thu Jan 20 2022 Fedora Release Engineering - 3.8.0-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Tue Sep 14 2021 Sahana Prasad - 3.8.0-20 - Rebuilt with OpenSSL 3.0.0 From 600330e9e54caf06e019b62b05b50db43209458a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 22 Jul 2022 02:06:36 +0000 Subject: [PATCH 30/40] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 997286b..6f81715 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 21%{?dist} +Release: 22%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -213,6 +213,9 @@ fi %endif %changelog +* Fri Jul 22 2022 Fedora Release Engineering - 3.8.0-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Thu Jan 20 2022 Fedora Release Engineering - 3.8.0-21 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 9459ce3c19c5cf77e6d07aa6f67ac39912ded6f5 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 22:50:18 +0000 Subject: [PATCH 31/40] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 6f81715..c0334b6 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 22%{?dist} +Release: 23%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -213,6 +213,9 @@ fi %endif %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 3.8.0-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Fri Jul 22 2022 Fedora Release Engineering - 3.8.0-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From c8524762e0f6a1dcba3b8551da30e1ee9493d50d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 18:04:30 +0000 Subject: [PATCH 32/40] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index c0334b6..c47e1d0 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 23%{?dist} +Release: 24%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -213,6 +213,9 @@ fi %endif %changelog +* Thu Jul 20 2023 Fedora Release Engineering - 3.8.0-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Thu Jan 19 2023 Fedora Release Engineering - 3.8.0-23 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From a30cd1a2775c545501f22038c893cca6bf4883b0 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 5 Jan 2024 06:48:40 +0100 Subject: [PATCH 33/40] Fix C compatibility issue Related to: --- openhpi-c99.patch | 17 +++++++++++++++++ openhpi.spec | 6 +++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 openhpi-c99.patch diff --git a/openhpi-c99.patch b/openhpi-c99.patch new file mode 100644 index 0000000..99a18bb --- /dev/null +++ b/openhpi-c99.patch @@ -0,0 +1,17 @@ +Avoid an int-conversion C type error and a build failure with GCC 14. + +Submitted upstream: + +diff --git a/plugins/ov_rest/ov_rest_re_discover.c b/plugins/ov_rest/ov_rest_re_discover.c +index 5ad542793f628041..7cdd13d8c395f5d6 100644 +--- a/plugins/ov_rest/ov_rest_re_discover.c ++++ b/plugins/ov_rest/ov_rest_re_discover.c +@@ -704,7 +704,7 @@ SaErrorT remove_composer(struct oh_handler_state *handler, + byte bayNumber) + { + +- SaErrorT rv = NULL; ++ SaErrorT rv = 0; + SaHpiResourceIdT resource_id = 0; + struct oh_event event = {0}; + struct ovRestHotswapState *hotswap_state = NULL; diff --git a/openhpi.spec b/openhpi.spec index c47e1d0..2122509 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 24%{?dist} +Release: 25%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -22,6 +22,7 @@ Patch3: %{name}-3.8.0-manpage-scan.patch Patch4: %{name}-3.8.0-ipv6-ipmidirect.patch Patch5: %{name}-3.8.0-link-libopenhpi.patch Patch6: openhpi-snmp-disable-des.patch +Patch7: openhpi-c99.patch BuildRequires: make BuildRequires: gcc-c++ %if 0%{?fedora} || 0%{?rhel} < 9 @@ -213,6 +214,9 @@ fi %endif %changelog +* Fri Jan 05 2024 Florian Weimer - 3.8.0-25 +- Fix C compatibility issue + * Thu Jul 20 2023 Fedora Release Engineering - 3.8.0-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From fd9b9340839c51990f3603a337deb3f8413f7ccb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 11:13:42 +0000 Subject: [PATCH 34/40] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 2122509..6e02e86 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 25%{?dist} +Release: 26%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -214,6 +214,9 @@ fi %endif %changelog +* Sun Jan 21 2024 Fedora Release Engineering - 3.8.0-26 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jan 05 2024 Florian Weimer - 3.8.0-25 - Fix C compatibility issue From 8fa465101f11ab58ee84111dfba130340443f428 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 11:19:38 +0000 Subject: [PATCH 35/40] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 6e02e86..007cd78 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 26%{?dist} +Release: 27%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -214,6 +214,9 @@ fi %endif %changelog +* Thu Jan 25 2024 Fedora Release Engineering - 3.8.0-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Jan 21 2024 Fedora Release Engineering - 3.8.0-26 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 213a0b11f6afc812bbb03c033fa0f5d4637355c4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 20:52:36 +0000 Subject: [PATCH 36/40] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 007cd78..461b15f 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 27%{?dist} +Release: 28%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -214,6 +214,9 @@ fi %endif %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 3.8.0-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Thu Jan 25 2024 Fedora Release Engineering - 3.8.0-27 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From b6b6c20d31ff3aee8d932c42c821342a13e7bdcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Fri, 19 Jul 2024 17:21:44 +0200 Subject: [PATCH 37/40] - fix build without OpenSSL engines --- openhpi-3.8.0-openssl-no-engine.patch | 20 ++++++++++++++++++++ openhpi.spec | 10 +++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 openhpi-3.8.0-openssl-no-engine.patch diff --git a/openhpi-3.8.0-openssl-no-engine.patch b/openhpi-3.8.0-openssl-no-engine.patch new file mode 100644 index 0000000..40d7cdd --- /dev/null +++ b/openhpi-3.8.0-openssl-no-engine.patch @@ -0,0 +1,20 @@ +diff --git a/ssl/oh_ssl.c b/ssl/oh_ssl.c +index 45748d40..b5499eb2 100644 +--- a/ssl/oh_ssl.c ++++ b/ssl/oh_ssl.c +@@ -66,7 +66,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -363,7 +362,6 @@ void oh_ssl_finit(void) + { + /* TODO: Check whether any other SSL library cleanup should be called */ + thread_cleanup(); +- ENGINE_cleanup(); + CONF_modules_unload(0); + ERR_free_strings(); + EVP_cleanup(); diff --git a/openhpi.spec b/openhpi.spec index 461b15f..42400ff 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 28%{?dist} +Release: 29%{?dist} License: BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -21,8 +21,9 @@ Patch2: %{name}-3.7.0-multilib.patch Patch3: %{name}-3.8.0-manpage-scan.patch Patch4: %{name}-3.8.0-ipv6-ipmidirect.patch Patch5: %{name}-3.8.0-link-libopenhpi.patch -Patch6: openhpi-snmp-disable-des.patch -Patch7: openhpi-c99.patch +Patch6: %{name}-snmp-disable-des.patch +Patch7: %{name}-c99.patch +Patch8: %{name}-3.8.0-openssl-no-engine.patch BuildRequires: make BuildRequires: gcc-c++ %if 0%{?fedora} || 0%{?rhel} < 9 @@ -214,6 +215,9 @@ fi %endif %changelog +* Fri Jul 19 2024 Dan Horák - 3.8.0-29 +- fix build without OpenSSL engines + * Thu Jul 18 2024 Fedora Release Engineering - 3.8.0-28 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 7453ecab7f0b17af6bb218d10d88bd4aa02cbf9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Mon, 2 Sep 2024 12:22:19 +0200 Subject: [PATCH 38/40] convert license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- openhpi.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openhpi.spec b/openhpi.spec index 42400ff..e95ef71 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,8 +6,9 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 29%{?dist} -License: BSD +Release: 30%{?dist} +# Automatically converted from old format: BSD - review is highly recommended. +License: LicenseRef-Callaway-BSD URL: http://www.openhpi.org Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz # selinux policy for openhpi, Policy files where extracted from @@ -215,6 +216,9 @@ fi %endif %changelog +* Mon Sep 02 2024 Miroslav Suchý - 3.8.0-30 +- convert license to SPDX + * Fri Jul 19 2024 Dan Horák - 3.8.0-29 - fix build without OpenSSL engines From c299973d7b63e90b067354fba3ef35b496540238 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 21:42:11 +0000 Subject: [PATCH 39/40] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index e95ef71..182796a 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 30%{?dist} +Release: 31%{?dist} # Automatically converted from old format: BSD - review is highly recommended. License: LicenseRef-Callaway-BSD URL: http://www.openhpi.org @@ -216,6 +216,9 @@ fi %endif %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 3.8.0-31 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Mon Sep 02 2024 Miroslav Suchý - 3.8.0-30 - convert license to SPDX From b69317c46559c18a78e208798798b49a43a73b30 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 23:36:14 +0000 Subject: [PATCH 40/40] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- openhpi.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openhpi.spec b/openhpi.spec index 182796a..fad680a 100644 --- a/openhpi.spec +++ b/openhpi.spec @@ -6,7 +6,7 @@ Summary: Hardware Platform Interface library and tools Name: openhpi Version: 3.8.0 -Release: 31%{?dist} +Release: 32%{?dist} # Automatically converted from old format: BSD - review is highly recommended. License: LicenseRef-Callaway-BSD URL: http://www.openhpi.org @@ -216,6 +216,9 @@ fi %endif %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 3.8.0-32 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Fri Jan 17 2025 Fedora Release Engineering - 3.8.0-31 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild