Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/openhpi.git#1b7c880836c4d104f6b95ed6e9833a877cf38e16
This commit is contained in:
DistroBaker 2020-12-16 22:13:45 +00:00
parent a48b0cd717
commit 2936effdff
43 changed files with 2347 additions and 0 deletions

11
.gitignore vendored
View File

@ -0,0 +1,11 @@
openhpi-2.14.1.tar.gz
/openhpi-2.15.0.tar.gz
/openhpi-2.17.0.tar.gz
/openhpi-3.0.0.tar.gz
/openhpi-3.2.0.tar.gz
/openhpi-3.2.1.tar.gz
/openhpi-3.4.0.tar.gz
/openhpi-3.6.0.tar.gz
/openhpi-3.6.1.tar.gz
/openhpi-3.7.0.tar.gz
/openhpi-3.8.0.tar.gz

View File

@ -0,0 +1,94 @@
From d82555d0f32fc341d8f3e58a08f63894a3eb7ce0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 6 Mar 2012 11:23:01 +0100
Subject: [PATCH] add support for systemd
New configure parameter is introduced (--with-systemdsystemunitdir) and when set
it means that systemd service file will be installed instead of the classis initscript.
---
configure.ac | 12 ++++++++++++
openhpid/Makefile.am | 7 +++++++
openhpid/openhpid.service.in | 11 +++++++++++
3 files changed, 30 insertions(+)
create mode 100644 openhpid/openhpid.service.in
diff --git a/configure.ac b/configure.ac
index e538fb4..80157af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -709,6 +709,17 @@ AC_ARG_ENABLE([man],
AC_SUBST(MAN,"")
fi])
+dnl systemd system unit files location
+AC_ARG_WITH([systemdsystemunitdir],
+ AS_HELP_STRING([--with-systemdsystemunitdir@<:@=DIR@:>@],[systemd system unit files location]),
+ [enable_systemd=yes],
+ [enable_systemd=no])
+
+dnl enable systemd and set unit dir
+AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x$enable_systemd" = "xyes"])
+unitdir=$with_systemdsystemunitdir
+AC_SUBST(unitdir)
+
AC_CONFIG_FILES([openhpi.spec
openhpi.pc
rt-env.sh
@@ -751,6 +762,7 @@ AC_CONFIG_FILES([openhpi.spec
docs/man/Makefile
openhpid/Makefile
openhpid/openhpid.sh
+ openhpid/openhpid.service
openhpid/t/Makefile
openhpid/t/ohpi/Makefile
hpi_shell/Makefile
diff --git a/openhpid/Makefile.am b/openhpid/Makefile.am
index bccbce5..bfc6e73 100644
--- a/openhpid/Makefile.am
+++ b/openhpid/Makefile.am
@@ -28,6 +28,7 @@ DIST_SUBDIRS = t
EXTRA_DIST = \
openhpid.sh.in \
+ openhpid.service.in \
Makefile.mingw32 \
openhpid-win32.cpp \
version.rc
@@ -83,11 +84,17 @@ endif
install-data-local:
+if ENABLE_SYSTEMD
+ $(mkinstalldirs) $(DESTDIR)$(unitdir)
+ $(INSTALL) -m 0644 openhpid.service $(DESTDIR)$(unitdir)
+else
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/init.d
$(INSTALL) -m 0755 openhpid.sh $(DESTDIR)$(sysconfdir)/init.d/openhpid
+endif
uninstall-local:
rm -f $(DESTDIR)$(sysconfdir)/init.d/openhpid
+ rm -f $(DESTDIR)$(unitdir)/openhpid.service
clean-local:
rm -f *~ core core.*
diff --git a/openhpid/openhpid.service.in b/openhpid/openhpid.service.in
new file mode 100644
index 0000000..69b1348
--- /dev/null
+++ b/openhpid/openhpid.service.in
@@ -0,0 +1,11 @@
+[Unit]
+Description=Daemon providing access to the SAF Hardware Platform Interface
+After=syslog.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/openhpid.pid
+ExecStart=@sbindir@/openhpid -c @sysconfdir@/openhpi/openhpi.conf
+
+[Install]
+WantedBy=multi-user.target
--
1.9.3

10
openhpi-3.6.1-ssl.patch Normal file
View File

@ -0,0 +1,10 @@
diff -up openhpi-3.6.1/ssl/Makefile.am.than openhpi-3.6.1/ssl/Makefile.am
--- openhpi-3.6.1/ssl/Makefile.am.than 2017-02-21 12:21:12.114814698 -0500
+++ openhpi-3.6.1/ssl/Makefile.am 2017-02-21 12:22:44.576454262 -0500
@@ -19,5 +19,5 @@ lib_LTLIBRARIES = libopenhpi_ssl.la
libopenhpi_ssl_la_SOURCES = oh_ssl.c oh_ssl.h
libopenhpi_ssl_la_LDFLAGS = -version-info @HPI_LIB_VERSION@
-libopenhpi_ssl_la_LIBADD = @CRYPTO_LIB@
+libopenhpi_ssl_la_LIBADD = -lssl @CRYPTO_LIB@

View File

@ -0,0 +1,24 @@
diff -up openhpi-3.7.0/docs/man/Makefile.am.orig openhpi-3.7.0/docs/man/Makefile.am
--- openhpi-3.7.0/docs/man/Makefile.am.orig 2017-12-20 16:47:26.698845572 +0100
+++ openhpi-3.7.0/docs/man/Makefile.am 2017-12-20 16:48:39.398099242 +0100
@@ -47,7 +47,7 @@ EXTRA_DIST = openhpi.7.pod openhpid.8
SUFFIXES=.pod
.pod:
- pod2man --release=$(VERSION) --name=`echo $@ | sed 's/\..*//'` \
+ pod2man --release=$(VERSION) --date=2017-05-27 --name=`echo $@ | sed 's/\..*//'` \
-s `echo $@ | sed 's/.*\.//'` -c "OpenHPI" $< $@
#mandir = $(datadir)/man
diff -up openhpi-3.7.0/docs/man/Makefile.in.orig openhpi-3.7.0/docs/man/Makefile.in
--- openhpi-3.7.0/docs/man/Makefile.in.orig 2017-12-20 16:49:00.671295613 +0100
+++ openhpi-3.7.0/docs/man/Makefile.in 2017-12-20 16:49:23.724424748 +0100
@@ -729,7 +729,7 @@ uninstall-man: uninstall-man1 uninstall-
.pod:
- pod2man --release=$(VERSION) --name=`echo $@ | sed 's/\..*//'` \
+ pod2man --release=$(VERSION) --date=2017-05-27 --name=`echo $@ | sed 's/\..*//'` \
-s `echo $@ | sed 's/.*\.//'` -c "OpenHPI" $< $@
clean-local: am_config_clean-local

View File

@ -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 );

View File

@ -0,0 +1,21 @@
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-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
-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
@@ -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)

View File

@ -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 <cfgfile>] [-rscwiafd] [-n nn] [-X] [-h]
+ hpitop [-D nn] [-N host[:port]] [-C <cfgfile>] [-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 <cfgfile>] [-acdiorsw ] [-n nn] [-X] [-h]
+ hpitree [-D nn] [-N host[:port]] [-C <cfgfile>] [-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<conf_file>
Sets path/name of the configuration file.
diff -up openhpi-3.8.0/openhpid/threaded.c.me openhpi-3.8.0/openhpid/threaded.c

492
openhpi.spec Normal file
View File

@ -0,0 +1,492 @@
Summary: Hardware Platform Interface library and tools
Name: openhpi
Version: 3.8.0
Release: 13%{?dist}
License: BSD
URL: http://www.openhpi.org
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
# convert from initscript to systemd unit
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
Patch5: %{name}-3.8.0-link-libopenhpi.patch
BuildRequires: gcc-c++
BuildRequires: libsysfs-devel
BuildRequires: net-snmp-devel
BuildRequires: OpenIPMI-devel
BuildRequires: glib2-devel
BuildRequires: libtool-ltdl-devel
BuildRequires: openssl-devel
BuildRequires: ncurses-devel
BuildRequires: libxml2-devel
BuildRequires: docbook-utils
BuildRequires: libuuid-devel
BuildRequires: librabbitmq-devel
BuildRequires: json-c-devel
BuildRequires: libcurl-devel
BuildRequires: systemd
BuildRequires: autoconf automake libtool
BuildRequires: libgcrypt-devel
BuildRequires: net-snmp
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description
OpenHPI is an open source project created with the intent of providing an
implementation of the SA Forum's Hardware Platform Interface (HPI). HPI
provides an abstracted interface to managing computer hardware, typically for
chassis and rack based servers. HPI includes resource modeling; access to and
control over sensor, control, watchdog, and inventory data associated with
resources; abstracted System Event Log interfaces; hardware events and alerts;
and a managed hot swap interface.
OpenHPI provides a modular mechanism for adding new hardware and device support
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}
Requires: glib2-devel
%description devel
The development libraries and header files for the OpenHPI project.
%prep
%autosetup -p1
autoreconf -vif
# fix permissions
chmod a-x plugins/simulator/*.[ch]
chmod a-x clients/hpipower.c
# Fix ownership of config files and dirs for building/running tests as root
# Due to security check the daemon breaks with error if the config file
# does not belong to the current user.
# https://bugzilla.redhat.com/show_bug.cgi?id=1267928
if [ $UID -eq 0 ]; then
find . -name openhpi.conf -exec chown root:root {} \;
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}
# Don't use rpath!
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
%install
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
mkdir -p -m1755 $RPM_BUILD_ROOT%{_var}/lib/%{name}
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
%post
%systemd_post openhpid.service
%preun
%systemd_preun openhpid.service
%postun
%systemd_postun_with_restart openhpid.service
%files
%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
%config(noreplace) %{_sysconfdir}/%{name}/simulation.data
%{_unitdir}/openhpid.service
%attr(1755,root,root) %{_var}/lib/%{name}
%{_bindir}/*
%{_sbindir}/*
%{_libdir}/%{name}
%{_mandir}/man1/*
%{_mandir}/man7/*
%{_mandir}/man8/*
%files libs
%{_libdir}/*.so.*
%files devel
%{_libdir}/*.so
%{_includedir}/%{name}
%{_libdir}/pkgconfig/*.pc
%changelog
* Thu Aug 27 2020 Josef Řídký <jridky@redhat.com> - 3.8.0-13
- Rebuilt for new net-snmp release
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Apr 21 2020 Björn Esser <besser82@fedoraproject.org> - 3.8.0-11
- Rebuild (json-c)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Dec 05 2018 Than Ngo <than@redhat.com> - 3.8.0-7
- add ipv6 support for ipmidirect
- fix #1654725, testcases failed due to undefined symbol: saHpiSessionOpen
* Tue Aug 07 2018 Than Ngo <than@redhat.com> - 3.8.0-6
- install README-dynamic_simulator
* Tue Aug 07 2018 Than Ngo <than@redhat.com> - 3.8.0-5
- fixed bz#1612210, manpage scan issues
* Tue Jul 24 2018 Adam Williamson <awilliam@redhat.com> - 3.8.0-4
- Rebuild for new net-snmp
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jul 09 2018 Than Ngo <than@redhat.com> - 3.8.0-2
- fix file list in docdir
* Tue Mar 13 2018 Dan Horák <dan[at]danny.cz> - 3.8.0-1
- updated to 3.8.0
* Tue Mar 06 2018 Björn Esser <besser82@fedoraproject.org> - 3.7.0-5
- Rebuilt for libjson-c.so.4 (json-c v0.13.1)
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jan 11 2018 Than Ngo <than@redhat.com> - 3.7.0-3
- fixed multilib issue
- enable file encryption (missing hpicrypt)
- add BR on net-snmp in order to fix the undefined reference issue
* Sun Dec 10 2017 Björn Esser <besser82@fedoraproject.org> - 3.7.0-2
- Rebuilt for libjson-c.so.3
* Wed Nov 01 2017 Dan Horák <dan[at]danny.cz> - 3.7.0-1
- updated to 3.7.0
- enabled ov_rest plugin
* Thu Aug 03 2017 Than Ngo <than@redhat.com> - 3.6.1-8
- Resolves bz#1267928, the testsuite failure when build as root
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Tue Feb 21 2017 Than Ngo <than@redhat.com> - 3.6.1-5
- FTBFS for gcc 7
- fixed build with openssl-1.1.x
- use %%autosetup
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Jan 19 2017 Rafael Fonseca <rdossant@redhat.com> - 3.6.1-3
- Fix #1414802 - double free or corruption on sysfs plugin.
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Mon Dec 07 2015 Rafael Fonseca <rdossant@redhat.com> - 3.6.1-1
- update to 3.6.1
* Fri Aug 28 2015 Rafael Fonseca <rdossant@redhat.com> - 3.6.0-1
- Update to upstream version 3.6.0
- Mark COPYING as %%license
- Add ChangeLog to %%doc
* Tue Jul 07 2015 Rafael Fonseca <rdossant@redhat.com> - 3.4.0-5
- fix missing header (#1239746)
* Thu Jun 25 2015 Rafael Fonseca <rdossant@redhat.com> - 3.4.0-4
- fix /var/lib/openhpi permissions (#1233521)
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 3.4.0-2
- Rebuilt for GCC 5 C++11 ABI change
* Mon Aug 25 2014 Dan Horák <dan[at]danny.cz> - 3.4.0-1
- update to 3.4.0
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri Aug 23 2013 Dan Horák <dan[at]danny.cz> - 3.2.1-4
- enable hardened build (#955180)
- backport IPv6 support for OA SOAP plugin
* Tue Aug 20 2013 Dan Horák <dan[at]danny.cz> - 3.2.1-3
- fix build with unversioned docdir (#992402)
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Jul 18 2013 Dan Horák <dan[at]danny.cz> - 3.2.1-1
- update to 3.2.1
- switch to systemd macros
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Wed Nov 21 2012 Dan Horák <dan[at]danny.cz> - 3.2.0-1
- update to 3.2.0
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Tue Mar 06 2012 Dan Horák <dan[at]danny.cz> - 3.0.0-1
- update to 3.0.0
- convert from initscript to systemd unit
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.17.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Mon Jul 11 2011 Dan Horák <dan[at]danny.cz> - 2.17.0-1
- update to 2.17.0
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.15.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Nov 8 2010 Dan Horák <dan[at]danny.cz> - 2.15.0-1
- update to 2.15.0
* Thu Jul 8 2010 Dan Horák <dan[at]danny.cz> - 2.14.1-4
- moved license text into -libs subpackage
* Wed Feb 24 2010 Dan Horák <dan[at]danny.cz> - 2.14.1-3
- update initscript (#521648, #521830)
* Fri Jan 15 2010 Dan Horák <dan[at]danny.cz> - 2.14.1-2
- added fix for inconsistent SaHpi.h
* Wed Nov 25 2009 Dan Horák <dan[at]danny.cz> - 2.14.1-1
- updated to bug fix release 2.14.1
* Fri Oct 9 2009 Dan Horák <dan[at]danny.cz> - 2.14.0-6
- rebuilt with net-snmp 5.5
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 2.14.0-5
- rebuilt with new openssl
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.14.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Jul 15 2009 Dan Horak <dan[at]danny.cz> - 2.14.0-3
- add BR: libuuid-devel
* Fri Apr 17 2009 Dan Horak <dan[at]danny.cz> - 2.14.0-2
- use upstream default config
- libtoolize/autoreconf is not needed
* Fri Apr 17 2009 Dan Horak <dan[at]danny.cz> - 2.14.0-1
- update to 2.14.0
* Wed Feb 25 2009 Dan Horak <dan[at]danny.cz> - 2.13.3-2
- fix ppc/ppc64 builds
* Wed Feb 25 2009 Dan Horak <dan[at]danny.cz> - 2.13.3-1
- update to 2.13.3
* Sat Jan 17 2009 Tomas Mraz <tmraz@redhat.com> - 2.13.1-3
- rebuild with new openssl
* Tue Nov 25 2008 Dan Horak <dan[at]danny.cz> - 2.13.1-2
- shorten Summary
* Thu Nov 20 2008 Dan Horak <dan[at]danny.cz> - 2.13.1-1
- update to 2.13.1
* Mon Nov 17 2008 Dan Horak <dan[at]danny.cz> - 2.12.0-2
- rebuild for new libtool
* Sat Jul 26 2008 Dan Horak <dan[at]danny.cz> - 2.12.0-1
- update to 2.12.0
* Thu Jun 26 2008 Dan Horak <dan[at]danny.cz> - 2.11.3-1
- update to 2.11.3
* Fri Apr 18 2008 Dan Horak <dan[at]danny.cz> - 2.10.2-2
- enable the sysfs plugin
- add missing R: for -devel subpackage
* Thu Mar 13 2008 Dan Horak <dan[at]danny.cz> - 2.10.2-1
- update to 2.10.2
- spec file and patch cleanup
* Thu Feb 28 2008 Phil Knirsch <pknirsch@redhat.com> - 2.10.1-3
- Removed incorrect patch for IBM BC snmp_bc plugin
- Fixed GCC 4.3 rebuild problems
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.10.1-2
- Autorebuild for GCC 4.3
* Wed Dec 05 2007 Phil Knirsch <pknirsch@redhat.com> - 2.10.1-1
- Updated to openhpi-2.10.1
- Bump release and rebuild due to new openssl
* Thu Aug 23 2007 Phil Knirsch <pknirsch@redhat.com> - 2.8.1-5
- Bump release and rebuild because of PPC issues
- Fix rebuild problems due to new glibc open macro
* Fri Jul 20 2007 Phil Knirsch <pknirsch@redhat.com> - 2.8.1-4
- Fix for hpipower segfaulting when using -b option out of range (#247279)
* Tue Jul 17 2007 Phil Knirsch <pknirsch@redhat.com> - 2.8.1-3
- Fixed a bug where the snmp_bc plugin didn't work in IBM BC (#247280)
* Mon Jun 04 2007 Phil Knirsch <pknirsch@redhat.com> - 2.8.1-2.fc7
- Fixed missing e2fsprogs-devel and openssl-devel build requires
* Fri Mar 30 2007 Phil Knirsch <pknirsch@redhat.com> - 2.8.1-1.fc7
- Update to openhpi-2.8.1
* Thu Feb 08 2007 Phil Knirsch <pknirsch@redhat.com> - 2.8.0-3.fc7
- Fixed some silly bugs in the specfile
* Wed Feb 07 2007 Phil Knirsch <pknirsch@redhat.com> - 2.8.0-2.fc7
- Bump and rebuild.
* Tue Feb 06 2007 Phil Knirsch <pknirsch@redhat.com> - 2.8.0-1.fc7
- Update to openhpi-2.8.0
* Tue Nov 28 2006 Phil Knirsch <pknirsch@redhat.com> - 2.4.1-7.fc7
- Rebuilt due to new net-snmp-5.4
- Small specfile updates
* Fri Sep 29 2006 Phil Knirsch <pknirsch@redhat.com> - 2.4.1-6
- Fixed file conflicts for openhpi-switcher (#205226)
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 2.4.1-5.1
- rebuild
* Mon Jul 10 2006 Phil Knirsch <pknirsch@redhat.com> - 2.4.1-5
- Had to disable sysfs support due to new libsysfs and incompatible API.
- Added missing ncurses-devel buildrequires
* Wed Jun 07 2006 Phil Knirsch <pknirsch@redhat.com> - 2.4.1-4
- Rebuilt with final memset patch
- Added missing pkgconfig buildprereq (#191935)
* Fri May 26 2006 Radek Vokal <rvokal@redhat.com> - 2.4.1-2
- rebuilt for new libnetsnmp and net-snmp-config changes
* Wed May 24 2006 Phil Knirsch <pknirsch@redhat.com> - 2.4.1-1
- Fixed buggy use of memset throughout the code
- Made the package build and install properly
* Fri May 19 2006 Phil Knirsch <pknirsch@redhat.com>
- Added missing glib2-devel build prereq (#191935)
- Update to latest stable version openhpi-2.4.1
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 2.2.1-4.2
- bump again for double-long bug on ppc(64)
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 2.2.1-4.1
- rebuilt for new gcc4.1 snapshot and glibc changes
* Mon Jan 9 2006 Peter Jones <pjones@redhat.com> 2.2.1-4
- Don't use -Werror, it doesn't build with that on ppc64 currently.
* Mon Jan 09 2006 Jesse Keating <jkeating@redhat.com> 2.2.1-3
- Fix to not use stict-aliasing.
* Wed Jan 04 2006 Radek Vokal <rvokal@redhat.com> 2.2.1-2
- Rebuilt against new libnetsnmp
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt
* Fri Nov 11 2005 Phil Knirsch <pknirsch@redhat.com> 2.2.1-1
- Update to stable openhpi-2.2.1
* Wed Nov 09 2005 Phil Knirsch <pknirsch@redhat.com> 2.0.3-5
- Rebuilt to link against latest openssl lib.
* Mon Nov 07 2005 Phil Knirsch <pknirsch@redhat.com> 2.0.3-4
- Added the openhpi config file
- Added missing /var/lib/openhpi dir with proper rights
- Added a few missing BuildPreReqs
* Thu Nov 03 2005 Phil Knirsch <pknirsch@redhat.com> 2.0.3-3
- Rebuild against new net-snmp libs
* Wed Mar 30 2005 Phil Knirsch <pknirsch@redhat.com> 2.0.3-1
- Moved the pkgconfig files to the devel package (#152507)
- Update to openhpi-2.0.3
- Had to manually disable ipmi support for now until openhpi builds correctly
against it again
- Dropped net-snmp-config patch, not needed anymore
* Thu Mar 17 2005 Phil Knirsch <pknirsch@redhat.com> 1.9.2-5
- Fixed gcc4 rebuild problems
* Wed Mar 02 2005 Phil Knirsch <pknirsch@redhat.com> 1.9.2-4
- bump release and rebuild with gcc 4
* Mon Feb 14 2005 Phil Knirsch <pknirsch@redhat.com> 1.9.2-3
- Rebuilt for new rpm-4.4
* Mon Dec 20 2004 Phil Knirsch <pknirsch@redhat.com> 1.9.2-2
- Fixed overflow in plugins/sysfs/sysfs2hpi.c
- Fixed rebuild problem with latest net-snmp
- Removed is_simulator patch, not needed anymore
* Fri Nov 26 2004 Florian La Roche <laroche@redhat.com> 1.9.2-1
- update to 1.9.2
* Tue Nov 02 2004 Phil Knirsch <pknirsch@redhat.com> 1.9.1-1
- Added proper BuildRequires
- Drop ia64 for first build, something fishy with the compiler and warning.
* Tue Oct 26 2004 Phil Knirsch <pknirsch@redhat.com>
- Initial version
- Disable dummy plugin, doesn't compile
- Fix missing () in snmp_bc_session.c

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (openhpi-3.8.0.tar.gz) = 5e7ed401bd891e19510f94dde27f4086f8a71bb727f02a8cfecc5fe91374d0f298134925c11dc3fca8b5af5390c98756665101953f6df5737aa190f95c74686e

View File

@ -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 <jscotka@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <jscotka@redhat.com>" > $(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)

View File

@ -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 <jscotka@redhat.com>
Bug summary: hpisettime exits prematurely with return code 1 (openhpi)
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1201827

View File

@ -0,0 +1,65 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Author: Jan Scotka <jscotka@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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

View File

@ -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 <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <rskvaril@redhat.com>" > $(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)

View File

@ -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 <rskvaril@redhat.com>
Bug summary: openhpid[...]: g_mutex_clear() called on uninitialised or locked mutex
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1255041

View File

@ -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 <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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

View File

@ -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 <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <rskvaril@redhat.com>" > $(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)

View File

@ -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 <rskvaril@redhat.com>
Bug summary: hpithres, segmentation fault in case input closed
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1259719

View File

@ -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 <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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

View File

@ -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 <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <rskvaril@redhat.com>" > $(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)

View File

@ -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 <rskvaril@redhat.com>
Bug summary: hpi_shell - Attempt to unlock mutex that was not locked
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1259729

View File

@ -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 <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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

View File

@ -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 <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <rskvaril@redhat.com>" > $(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)

View File

@ -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 <rskvaril@redhat.com>
Bug summary: Error in `/usr/sbin/openhpid': double free or corruption (!prev)
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1262220

View File

@ -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 <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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

View File

@ -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 <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <rskvaril@redhat.com>" > $(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)

View File

@ -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 <rskvaril@redhat.com>
Bug summary: [Nokia] openhpi creates logs with 666 permissions
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1382339

View File

@ -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 <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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

View File

@ -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 <jscotka@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <jscotka@redhat.com>" > $(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)

View File

@ -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 <jscotka@redhat.com>
Bug summary: openhpi creates world writeable directory
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1063367

View File

@ -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 <jscotka@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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

View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/openhpi/Sanity/initscript
# Description: Init script should meet LSB specifications
# Author: Yulia Kopkova <ykopkova@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <psklenar@redhat.com>" > $(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)

View File

@ -0,0 +1,3 @@
PURPOSE of /CoreOS/openhpi/Sanity/initscript
Description: Init script should meet LSB specifications
Author: Yulia Kopkova <ykopkova@redhat.com>

View File

@ -0,0 +1,95 @@
#!/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 <jscotka@redhat.com>, Yulia Kopkova <ykopkova@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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"
SERVICE_CMD=systemctl
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "useradd testuserqa" 0 "Add test user"
rlServiceStop $SERVICE
rlPhaseEnd
rlPhaseStartTest
rlLog ">>>>>>>>> service start"
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_CMD restart $SERVICE" 0 " Restarting of service"
rlRun "$SERVICE_CMD status $SERVICE" 0 " Status command "
rlLog ">>>>>>>>> service stop"
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_CMD status $SERVICE" 3 " Status of stopped service "
rlLog ">>>>>>>>> lock file"
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_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_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
rlPhaseStartCleanup
rlServiceRestore $SERVICE
rlRun "userdel -fr testuserqa" 0 "Remove test user"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -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 <jscotka@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <jscotka@redhat.com>" > $(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)

View File

@ -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 <jscotka@redhat.com>

View File

@ -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 <jscotka@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 '<Entity>.*</Entity>'"
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

View File

@ -0,0 +1,64 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/openhpi/Sanity/testsuite
# Description: Running openhpi testsuite
# Author: Radka Skvarilova <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <rskvaril@redhat.com>" > $(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)

View File

@ -0,0 +1,3 @@
PURPOSE of /CoreOS/openhpi/Sanity/testsuite
Description: Running openhpi testsuite
Author: Radka Skvarilova <rskvaril@redhat.com>

View File

@ -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 <rskvaril@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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

View File

@ -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 <rbiba@redhat.com>
# 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 <rbiba@redhat.com>" > $(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)

View File

@ -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.

View File

@ -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 <rbiba@redhat.com>
. /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

14
tests/tests.yml Normal file
View File

@ -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