Compare commits

..

No commits in common. "c8" and "c10s" have entirely different histories.
c8 ... c10s

8 changed files with 830 additions and 265 deletions

54
.gitignore vendored
View File

@ -1,2 +1,52 @@
SOURCES/corosync-3.1.8.tar.gz
SOURCES/spausedd-20201112.tar.gz
corosync-1.2.6.tar.gz
corosync-1.2.7.tar.gz
/corosync-1.2.8.tar.gz
/corosync-1.3.0.tar.gz
/corosync-1.3.1.tar.gz
/corosync-1.3.2.tar.gz
/corosync-1.4.0.tar.gz
/corosync-1.4.1.tar.gz
/corosync-1.4.2.tar.gz
/corosync-1.99.1.tar.gz
/corosync-1.99.2.tar.gz
/corosync-1.99.3.tar.gz
/corosync-1.99.4.tar.gz
/corosync-1.99.5.tar.gz
/corosync-1.99.6.tar.gz
/corosync-1.99.7.tar.gz
/corosync-1.99.8.tar.gz
/corosync-1.99.9.tar.gz
/corosync-2.0.0.tar.gz
/corosync-2.0.1.tar.gz
/corosync-2.1.0.tar.gz
/corosync-2.2.0.tar.gz
/corosync-2.3.0.tar.gz
/corosync-2.3.1.tar.gz
/corosync-2.3.2.tar.gz
/corosync-2.3.3.tar.gz
/corosync-2.3.4.tar.gz
/corosync-2.3.5.tar.gz
/corosync-2.3.6.tar.gz
/corosync-2.4.0.tar.gz
/corosync-2.4.1.tar.gz
/corosync-2.4.2.tar.gz
/corosync-2.4.3.tar.gz
/corosync-2.99.1.tar.gz
/corosync-2.99.2.tar.gz
/corosync-2.99.3.tar.gz
/corosync-2.99.4.tar.gz
/corosync-2.99.5.tar.gz
/corosync-3.0.0.tar.gz
/corosync-3.0.1.tar.gz
/corosync-3.0.2.tar.gz
/corosync-3.0.3.tar.gz
/corosync-3.0.4.tar.gz
/corosync-3.1.0.tar.gz
/corosync-3.1.1.tar.gz
/corosync-3.1.2.tar.gz
/corosync-3.1.3.tar.gz
/corosync-3.1.4.tar.gz
/corosync-3.1.5.tar.gz
/corosync-3.1.6.tar.gz
/corosync-3.1.7.tar.gz
/corosync-3.1.8.tar.gz

29
corosync.rpmlintrc Normal file
View File

@ -0,0 +1,29 @@
# Empty %postun
addFilter(r'W: empty-%postun')
# Spelling error init
addFilter(r'W: spelling-error %description -l en_US init')
# Spelling error corosync
addFilter(r'W: spelling-error .* (C|c)orosync')
# Spelling error votequorum and subprocesses
addFilter(r'corosync-vqsim\.[^:]+: W: spelling-error .* votequorum')
addFilter(r'corosync-vqsim\.[^:]+: W: spelling-error .* subprocesses')
# Repeated Corosync
addFilter(r'W: name-repeated-in-summary C Corosync')
# Explicit lib dependency - knet nss has been requested by QA,
# libxslt may be replaced with xsltproc binary
addFilter(r'corosync\.[^:]+: (E|W): explicit-lib-dependency libknet1-crypto-nss-plugin')
addFilter(r'corosync\.[^:]+: (E|W): explicit-lib-dependency libxslt')
# Dbus is not config file
addFilter(r'corosync\.[^:]+: (E|W): non-conffile-in-etc /etc/dbus-1/system\.d/corosync-signals\.conf')
# Logrotate is not requirement
addFilter(r'corosync\.[^:]+: (E|W): missing-dependency-to-logrotate')
# libcorosync_common.so has no libc call
addFilter(r'corosynclib\.[^:]+: (E|W): library-not-linked-against-libc /usr/lib(64)?/libcorosync_common\.so')

View File

@ -11,31 +11,18 @@
%bcond_without vqsim
%bcond_without runautogen
%bcond_without userflags
%bcond_without spausedd
%global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
%global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
%if %{with spausedd}
%global spausedd_version 20201112
%endif
Name: corosync
Summary: The Corosync Cluster Engine and Application Programming Interfaces
Version: 3.1.8
Release: 1%{?gitver}%{?dist}
License: BSD
Release: 5%{?gitver}%{?dist}
License: BSD-3-Clause
URL: http://corosync.github.io/corosync/
Source0: http://build.clusterlabs.org/corosync/releases/%{name}-%{version}%{?gittarver}.tar.gz
%if %{with spausedd}
Source1: https://github.com/jfriesse/spausedd/releases/download/%{spausedd_version}/spausedd-%{spausedd_version}.tar.gz
# VMGuestLib exists only for x86_64 architecture
%ifarch x86_64
%global use_vmguestlib 1
%endif
%endif
# Runtime bits
# The automatic dependency overridden in favor of explicit version lock
Requires: corosynclib%{?_isa} = %{version}-%{release}
@ -80,16 +67,10 @@ Requires: libxslt
%if %{with vqsim}
BuildRequires: readline-devel
%endif
%if %{defined use_vmguestlib}
BuildRequires: pkgconfig(vmguestlib)
%endif
BuildRequires: make
%prep
%if %{with spausedd}
%setup -q -a 1 -n %{name}-%{version}%{?gittarver}
%else
%setup -q -n %{name}-%{version}%{?gittarver}
%endif
%build
%if %{with runautogen}
@ -128,22 +109,10 @@ BuildRequires: pkgconfig(vmguestlib)
--with-systemddir=%{_unitdir} \
--docdir=%{_docdir}
make %{_smp_mflags}
%if %{with spausedd}
cd spausedd-%{spausedd_version}
CFLAGS="${CFLAGS:-%{optflags}}" ; export CFLAGS
make \
%if %{defined use_vmguestlib}
WITH_VMGUESTLIB=1 \
%else
WITH_VMGUESTLIB=0 \
%endif
%{?_smp_mflags}
%endif
%make_build
%install
make install DESTDIR=%{buildroot}
%make_install
%if %{with dbus}
mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
@ -164,21 +133,6 @@ install -m 644 tools/corosync-notifyd.sysconfig.example \
install -m 644 init/corosync.sysconfig.example \
%{buildroot}%{_sysconfdir}/sysconfig/corosync
%if %{with spausedd}
cd spausedd-%{spausedd_version}
make DESTDIR="%{buildroot}" PREFIX="%{_prefix}" install
%if %{with systemd}
mkdir -p %{buildroot}/%{_unitdir}
install -m 644 -p init/spausedd.service %{buildroot}/%{_unitdir}
%else
mkdir -p %{buildroot}/%{_initrddir}
install -m 755 -p init/spausedd %{buildroot}/%{_initrddir}
%endif
cd ..
%endif
%description
This package contains the Corosync Cluster Engine Executive, several default
APIs and libraries, default configuration files, and an init script.
@ -276,15 +230,14 @@ This package contains corosync libraries.
%{_libdir}/libsam.so.*
%{_libdir}/libcorosync_common.so.*
%post -n corosynclib -p /sbin/ldconfig
%postun -n corosynclib -p /sbin/ldconfig
%ldconfig_scriptlets -n corosynclib
%package -n corosynclib-devel
Summary: The Corosync Cluster Engine Development Kit
Requires: corosynclib%{?_isa} = %{version}-%{release}
Requires: pkgconfig
Provides: corosync-devel = %{version}
Provides: corosync-devel = %{version}-%{release}
Provides: corosync-devel%{?_isa} = %{version}-%{release}
%description -n corosynclib-devel
This package contains include files and man pages used to develop using
@ -335,266 +288,145 @@ network splits)
%{_mandir}/man8/corosync-vqsim.8*
%endif
# optional spausedd
%if %{with spausedd}
%package -n spausedd
Summary: Utility to detect and log scheduler pause
URL: https://github.com/jfriesse/spausedd
%if %{with systemd}
%{?systemd_requires}
%else
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
%endif
%description -n spausedd
Utility to detect and log scheduler pause
%files -n spausedd
%doc spausedd-%{spausedd_version}/AUTHORS spausedd-%{spausedd_version}/COPYING
%{_bindir}/spausedd
%{_mandir}/man8/spausedd*
%if %{with systemd}
%{_unitdir}/spausedd.service
%else
%{_initrddir}/spausedd
%endif
%post -n spausedd
%if %{with systemd} && 0%{?systemd_post:1}
%systemd_post spausedd.service
%else
if [ $1 -eq 1 ]; then
/sbin/chkconfig --add spausedd || :
fi
%endif
%preun -n spausedd
%if %{with systemd} && 0%{?systemd_preun:1}
%systemd_preun spausedd.service
%else
if [ $1 -eq 0 ]; then
/sbin/service spausedd stop &>/dev/null || :
/sbin/chkconfig --del spausedd || :
fi
%endif
%postun -n spausedd
%if %{with systemd} && 0%{?systemd_postun:1}
%systemd_postun spausedd.service
%endif
%endif
%changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 3.1.8-5
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 3.1.8-4
- Bump release for June 2024 mass rebuild
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Nov 15 2023 Jan Friesse <jfriesse@redhat.com> - 3.1.8-1
- Resolves: RHEL-15263
- New upstream release
- New upstream release (RHEL-15263)
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Nov 15 2022 Jan Friesse <jfriesse@redhat.com> 3.1.7-1
- Resolves: rhbz#2135860
* Tue Jun 06 2023 Jan Friesse <jfriesse@redhat.com> - 3.1.7-3
- migrated to SPDX license
- New upstream release (rhbz#2135860)
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Nov 24 2021 Jan Friesse <jfriesse@redhat.com> 3.1.5-2
- Resolves: rhbz#2002115
- Resolves: rhbz#2024658
* Tue Nov 15 2022 Jan Friesse <jfriesse@redhat.com> - 3.1.7-1
- New upstream release
- totem: Add cancel_hold_on_retransmit config option (rhbz#2002115)
- merge upstream commit cdf72925db5a81e546ca8e8d7d8291ee1fc77be4 (rhbz#2002115)
- totemsrp: Switch totempg buffers at the right time (rhbz#2024658)
- merge upstream commit e7a82370a7b5d3ca342d5e42e25763fa2c938739 (rhbz#2024658)
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Aug 04 2021 Jan Friesse <jfriesse@redhat.com> 3.1.5-1
- Related: rhbz#1948973
* Wed Mar 30 2022 Jan Friesse <jfriesse@redhat.com> - 3.1.6-3
- Use copytruncate method for logrotate
- New upstream release (rhbz#1948973)
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jun 03 2021 Jan Friesse <jfriesse@redhat.com> 3.1.4-1
- Related: rhbz#1948973
- Resolves: rhbz#1962139
* Mon Nov 15 2021 Jan Friesse <jfriesse@redhat.com> - 3.1.6-1
- New upstream release
- New upstream release (rhbz#1948973)
- stats: fix crash when iterating over deleted keys (rhbz#1962139)
* Wed Aug 04 2021 Jan Friesse <jfriesse@redhat.com> - 3.1.5-1
- New upstream release
* Fri May 21 2021 Jan Friesse <jfriesse@redhat.com> 3.1.3-1
- Resolves: rhbz#1948973
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
- New upstream release (rhbz#1948973)
* Thu Jun 03 2021 Jan Friesse <jfriesse@redhat.com> - 3.1.4-1
- New upstream release
* Fri Apr 30 2021 Jan Friesse <jfriesse@redhat.com> 3.1.0-5
- Resolves: rhbz#1954432
* Fri May 21 2021 Jan Friesse <jfriesse@redhat.com> - 3.1.3-1
- New upstream release
* Tue Apr 06 2021 Jan Friesse <jfriesse@redhat.com> 3.1.0-4
- Resolves: rhbz#1946623
* Tue Apr 06 2021 Jan Friesse <jfriesse@redhat.com> - 3.1.2-1
- New upstream release
- knet: pass correct handle to knet_handle_compress (rhbz#1946623)
* Wed Mar 31 2021 Jan Friesse <jfriesse@redhat.com> - 3.1.1-1
- New upstream release
* Thu Nov 12 2020 Jan Friesse <jfriesse@redhat.com> 3.1.0-3
- Resolves: rhbz#1897085
- Resolves: rhbz#1896493
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
- spausedd: Add ability to move process into root cgroup (rhbz#1897085)
- totemknet: Check both cipher and hash for crypto (rhbz#1896493)
* Mon Nov 02 2020 Jan Friesse <jfriesse@redhat.com> - 3.1.0-2
- Add isa version of corosync-devel
- Add release to corosync-devel version to match autogenerated
corosynclib-devel provides
* Tue Nov 10 2020 Jan Friesse <jfriesse@redhat.com> 3.1.0-2
- Resolves: rhbz#1896309
* Tue Oct 20 2020 Jan Friesse <jfriesse@redhat.com> - 3.1.0-1
- New upstream release
- Fix log_perror (rhbz#1896309)
* Thu Aug 27 2020 Josef Řídký <jridky@redhat.com> - 3.0.4-6
- Rebuilt for new net-snmp release
* Tue Oct 20 2020 Jan Friesse <jfriesse@redhat.com> 3.1.0-1
- Resolves: rhbz#1855293
- Resolves: rhbz#1855303
- Resolves: rhbz#1870449
- Resolves: rhbz#1887400
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
- New upstream release (rhbz#1855293)
- Support for reload of crypto configuration (rhbz#1855303)
- Increase default token timeout to 3000ms (rhbz#1870449)
- Add support for nodelist callback into quorum service (rhbz#1887400)
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 3.0.4-4
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Tue May 26 2020 Jan Friesse <jfriesse@redhat.com> 3.0.3-4
- Resolves: rhbz#1780137
- Resolves: rhbz#1791792
- Resolves: rhbz#1809864
- Resolves: rhbz#1816653
* Wed May 13 2020 Jan Friesse <jfriesse@redhat.com> - 3.0.4-3
- Fix typo in the changelog
- votequorum: Ignore the icmap_get_* return value (rhbz#1780137)
- merge upstream commit cddd62f972bca276c934e58f08da84071cec1ddb (rhbz#1780137)
- man: move cmap_keys man page from section 8 to 7 (rhbz#1791792)
- merge upstream commit f1d36307e524f9440733f0b01a9fc627a0e1cac7 (rhbz#1791792)
- votequorum: Reflect runtime change of 2Node to WFA (rhbz#1780137)
- merge upstream commit 8ce65bf951bc1e5b2d64b60ea027fbdc551d4fc8 (rhbz#1780137)
- stats: Add stats for scheduler misses (rhbz#1791792)
- merge upstream commit 48b6894ef41e9a06ccbb696d062d86ef60dc2c4b (rhbz#1791792)
- stats: Use nanoseconds from epoch for schedmiss (rhbz#1791792)
- merge upstream commit ebd05fa00826c366922e619b012a0684c6856539 (rhbz#1791792)
- main: Add schedmiss timestamp into message (rhbz#1791792)
- merge upstream commit 35662dd0ec53f456445c30c0ef92892f47b25aa2 (rhbz#1791792)
- votequorum: Change check of expected_votes (rhbz#1809864)
- merge upstream commit 0c16442f2d93f32a229b87d2672e2dc8025ec704 (rhbz#1809864)
- quorumtool: exit on invalid expected votes (rhbz#1809864)
- merge upstream commit 5f543465bb3506b7f4929a426f1c22a9c854cecd (rhbz#1809864)
- votequorum: set wfa status only on startup (rhbz#1816653)
- merge upstream commit ca320beac25f82c0c555799e647a47975a333c28 (rhbz#1816653)
* Wed May 13 2020 Jan Friesse <jfriesse@redhat.com> - 3.0.4-2
- Rebuild for new libqb
* Tue Apr 28 2020 Jan Friesse <jfriesse@redhat.com> - 3.0.3-3
- Resolves: rhbz#1828295
* Thu Apr 23 2020 Jan Friesse <jfriesse@redhat.com> - 3.0.4-1
- New upstream release
- Add explicit spausedd dependency for revdeps CI test
* Fri Mar 27 2020 Jan Friesse <jfriesse@redhat.com> - 3.0.3-3
- Add CI tests
- Enable gating
* Mon Nov 25 2019 Jan Friesse <jfriesse@redhat.com> - 3.0.3-2
- Related: rhbz#1745623
- New upstream release of spausedd
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Nov 25 2019 Jan Friesse <jfriesse@redhat.com> - 3.0.3-1
- Resolves: rhbz#1745623
- New upstream release
* Wed Oct 30 2019 Jan Friesse <jfriesse@redhat.com> 3.0.2-4
- Resolves: rhbz#1745624
- Resolves: rhbz#1745642
- Resolves: rhbz#1749263
- Resolves: rhbz#1765025
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
- totem: fix check if all nodes have same number of links (rhbz#1749263)
- merge upstream commit 816324c94cfb917b11f43954b8757424db28b390 (rhbz#1749263)
- totem: Increase ring_id seq after load (rhbz#1745624)
- merge upstream commit 3675daceeeeb72af043f5c051daed463fdd2d2a1 (rhbz#1745624)
- man: Fix link_mode priority description (rhbz#1745642)
- merge upstream commit 0a323ff2ed0f2aff9cb691072906e69cb96ed662 (rhbz#1745642)
- totemsrp: Reduce MTU to left room second mcast (rhbz#1765025)
- merge upstream commit ee8b8993d98b3f6af9c058194228fc534fcd0796 (rhbz#1765025)
* Wed Jun 12 2019 Jan Friesse <jfriesse@redhat.com> - 3.0.2-1
- New upstream release
* Tue Aug 06 2019 Jan Friesse <jfriesse@redhat.com> - 3.0.2-3
- Resolves: rhbz#1738218
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
- Do not set exec permission for service file
- Fix CFLAGS definition
* Thu Jun 13 2019 Jan Friesse <jfriesse@redhat.com> 3.0.2-2
- Related: rhbz#1679656
- Improve spausedd test
* Wed Jun 12 2019 Jan Friesse <jfriesse@redhat.com> 3.0.2-1
- Resolves: rhbz#1705591
- Resolves: rhbz#1688889
* Mon May 13 2019 Jan Friesse <jfriesse@redhat.com> 3.0.0-4
- Related: rhbz#1679656
- Really add gating
* Mon May 13 2019 Jan Friesse <jfriesse@redhat.com> 3.0.0-3
- Resolves: rhbz#1691401
- Related: rhbz#1679656
- Add spausedd subpackage
- Add gating tests
* Fri Jan 11 2019 Jan Friesse <jfriesse@redhat.com> 3.0.0-2
- Resolves: rhbz#1665211
- totemip: Use AF_UNSPEC for ipv4-6 and ipv6-4 (rhbz#1665211)
- merge upstream commit 2ab4d4188670356dcb82a80f2fc4598f5145c77d (rhbz#1665211)
* Tue Jan 15 2019 Jan Friesse <jfriesse@redhat.com> - 3.0.1-1
- New upstream release
* Fri Dec 14 2018 Jan Friesse <jfriesse@redhat.com> - 3.0.0-1
- Resolves: rhbz#1600915
- New upstream release
* Tue Dec 11 2018 Jan Friesse <jfriesse@redhat.com> 2.99.5-2
- Resolves: rhbz#1654630
- man: Add some information about address resolution (rhbz#1654630)
- merge upstream commit 8d50bd946dd7e01da75f06da3f885e7dc82f4f12 (rhbz#1654630)
- config: Look up hostnames in a defined order (rhbz#1654630)
- merge upstream commit 3d7f136f86a56dd9d9caa9060f7a01e8b681eb7f (rhbz#1654630)
* Fri Dec 7 2018 Jan Friesse <jfriesse@redhat.com> - 2.99.5-1
- Related: rhbz#1600915
- New upstream release
* Tue Dec 4 2018 Jan Friesse <jfriesse@redhat.com> - 2.99.4-2
- Resolves: rhbz#1655179
- Add libknet1-crypto-nss-plugin dependency
* Tue Nov 20 2018 Jan Friesse <jfriesse@redhat.com> - 2.99.4-1
- Related: rhbz#1600915
- New upstream release
* Mon Oct 15 2018 Jan Friesse <jfriesse@redhat.com> 2.99.3-5
- Resolves: rhbz#1639211
* Thu Aug 16 2018 Jan Pokorný <jpokorny+rpm-corosync@redhat.com> - 2.99.3-3
- Rebuild again, since the previous one was so unfortunate it got affected
with binutils (2.31.1-3.fc29) producing non-monotonically increasing
section offsets causing unprepared eu-strip to damage the binary
(related: rhbz#1609577)
- Apply patch to prevent redundancy in systemd journal
- config: Fix crash in reload if new interfaces are added (rhbz#1639211)
- merge upstream commit 9f2d5a3a3faa8bd1021b505bcf3c5428b3435e39 (rhbz#1639211)
* Tue Sep 18 2018 Jan Friesse <jfriesse@redhat.com> 2.99.3-4
- Related: rhbz#1615945
- Rebuild for new LibQB
* Mon Aug 20 2018 Jan Friesse <jfriesse@redhat.com> 2.99.3-3
- Resolves: rhbz#1602409
- Remove libcgroup (rhbz#1602409)
- merge upstream commit c9e5d6db13fa965d83e27a3b664477e9b5b26edf (rhbz#1602409)
* Mon Jul 30 2018 Florian Weimer <fweimer@redhat.com> - 2.99.3-2
- Rebuild with fixed binutils
* Tue Jul 24 2018 Adam Williamson <awilliam@redhat.com> - 2.99.3-2
- Rebuild for new net-snmp
* Fri Jul 13 2018 Jan Friesse <jfriesse@redhat.com> - 2.99.3-1
- New upstream release
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.99.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Apr 30 2018 Jan Friesse <jfriesse@redhat.com> - 2.99.2-1
- New upstream release

15
gating.yaml Normal file
View File

@ -0,0 +1,15 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_testing
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (corosync-3.1.8.tar.gz) = 6325ae39bada33dbc0c85eb07d137af78235a1c0f8a4d1f90a20088e011bff65263903e5688956256ddfb58daec45f6d96c04624ff320be0c00ec36aa5d568f8

3
tests/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Ignore tests runs/artefacts.
artifacts/**
**/*.retry

623
tests/smoke/runtest.sh Normal file
View File

@ -0,0 +1,623 @@
#!/bin/bash
# This file was autogenerated at 2019-05-13T13:43:38+02:00 from 90bd97ada89befa1a63133335a419ad7311c3d75
# Copyright (c) 2019, Red Hat, Inc.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND RED HAT, INC. DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL RED HAT, INC. BE LIABLE
# FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Author: Jan Friesse <jfriesse@redhat.com>
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# !!! Script overwrites corosync.conf, authkey and qdevice/qnetd certificates !!!
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Home https://github.com/jfriesse/csts/tree/master/smoke
# -e is really important
set -xe
set -o pipefail
# Variables changing test behavior
PREFIX="/"
COROSYNC_SYSCONFD="${PREFIX}etc/corosync"
COROSYNC_CONF="${COROSYNC_SYSCONFD}/corosync.conf"
COROSYNC_AUTHKEY="${COROSYNC_SYSCONFD}/authkey"
COROSYNC_CLUSTER_NAME="smoketestcluster"
TOKEN_TIMEOUT=1000
MAX_REPEATS=60
####################
# Helper functions #
####################
get_ip() {
ip_res=$(ip route get 8.8.8.8)
# Format is "8.8.8.8 via ROUTE_IPADDR dev DEV src IPADDR uid NUMBER"
# Remove everything up to "src " and then everything after " "
addr=${ip_res##*src }
addr=${addr%% *}
echo "$addr"
}
# generate_corosync_conf crypto [token] [qdevice]
# crypto can be on or off
# when token is defined it is used for token timeout
# when qdevice is set to on qdevice section is created and second node is added
generate_corosync_conf() {
case "$1" in
"on")
cipher="aes256"
hash="sha256"
;;
"off")
cipher="none"
hash="none"
;;
*)
# Unknown crypto
exit 1
esac
token=$TOKEN_TIMEOUT
if [ ! -z "$2" ];then
token="$2"
fi
qdevice="$3"
true_command=`which true`
cat << _EOF_
totem {
version: 2
cluster_name: $COROSYNC_CLUSTER_NAME
transport: knet
crypto_cipher: $cipher
crypto_hash: $hash
token: $token
}
logging {
to_logfile: yes
logfile: /var/log/cluster/corosync.log
to_syslog: yes
}
quorum {
provider: corosync_votequorum
_EOF_
if [ "$qdevice" == "on" ];then
cat << _EOF_
device {
votes: 1
model: net
net {
host: $LOCAL_IP
algorithm: ffsplit
}
heuristics {
mode: sync
exec_true: $true_command
}
}
_EOF_
fi
cat << _EOF_
}
nodelist {
node {
nodeid: 1
ring0_addr: $LOCAL_IP
}
_EOF_
if [ "$qdevice" == "on" ];then
cat << _EOF_
node {
nodeid: 2
ring0_addr: 192.0.2.2
}
_EOF_
fi
cat << _EOF_
}
_EOF_
}
# service_start service
service_start() {
# service service must be inactive
systemctl is-active "$1" && exit 1 || true
systemctl start "$1"
systemctl is-active "$1"
}
# service_stop service
service_stop() {
systemctl is-active "$1" || exit 1
systemctl stop "$1"
systemctl is-active "$1" && exit 1 || true
}
######################
# Computed variables #
######################
LOCAL_IP=$(get_ip)
##################
# C test sources #
##################
# Test sources are encoded as a base64 string and piped to base64 to store them in /tmp
# corosync-api-test.c
echo "LyoKICogQ29weXJpZ2h0IChjKSAyMDE5LCBSZWQgSGF0LCBJbmMuCiAqCiAqIFBlcm1pc3Npb24g
dG8gdXNlLCBjb3B5LCBtb2RpZnksIGFuZC9vciBkaXN0cmlidXRlIHRoaXMgc29mdHdhcmUgZm9y
IGFueQogKiBwdXJwb3NlIHdpdGggb3Igd2l0aG91dCBmZWUgaXMgaGVyZWJ5IGdyYW50ZWQsIHBy
b3ZpZGVkIHRoYXQgdGhlIGFib3ZlCiAqIGNvcHlyaWdodCBub3RpY2UgYW5kIHRoaXMgcGVybWlz
c2lvbiBub3RpY2UgYXBwZWFyIGluIGFsbCBjb3BpZXMuCiAqCiAqIFRIRSBTT0ZUV0FSRSBJUyBQ
Uk9WSURFRCAiQVMgSVMiIEFORCBSRUQgSEFULCBJTkMuIERJU0NMQUlNUyBBTEwgV0FSUkFOVElF
UwogKiBXSVRIIFJFR0FSRCBUTyBUSElTIFNPRlRXQVJFIElOQ0xVRElORyBBTEwg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fcmVzID09IC0xKSB7CgkJCXBlcnJvcigiZm9yayIpOwoJCX0KCgkJaWYgKGZvcmtf
cmVzID09IDApIHsKCQkJLyoKCQkJICogQ2hpbGQKCQkJICovCgkJCWJyZWFrIDsKCQl9IGVsc2Ug
ewoJCQkvKgoJCQkgKiBQYXJlbnQKCQkJICovCgkJCW15X2lkID0gLTE7CgkJfQoJfQoKCWlmIChm
b3JrX3JlcyA9PSAwKSB7CgkJLyoKCQkgKiBDaGlsZCBydW5zIHRoZSB0ZXN0CgkJICovCgkJdGVz
dF9jcGcoKTsKCX0gZWxzZSB7CgkJLyoKCQkgKiBXYWl0IGZvciBjaGlsZHMKCQkgKi8KCQlmb3Ig
KGkgPSAwOyBpIDwgTk9fQ0hJTERTOyBpKyspIHsKCQkJd2FpdF9yZXMgPSB3YWl0KCZzdGF0dXMp
OwoJCQlpZiAod2FpdF9yZXMgPT0gLTEpIHsKCQkJCXBlcnJvcigid2FpdCIpOwoJCQl9CgoJCQlh
c3NlcnQoV0lGRVhJVEVEKHN0YXR1cykpOwoJCQlhc3NlcnQoV0VYSVRTVEFUVVMoc3RhdHVzKSA9
PSAwKTsKCQl9Cgl9CgoJTEVBVkUoKTsKCglyZXR1cm4gKDApOwp9Cg==" | base64 -d | tee "/tmp/corosync-api-test-mp.c"
# - corosync-api-test-mp.c
##################
# Test functions #
##################
test_corosync_v() {
# Check corosync -v exits without error and
# result version contain numbers in path format [0-9]*.[0-9]*.[0-9]
ver_res=$(corosync -v)
[ "$ver_res" != "${ver_res/[0-9]*\.[0-9]*\.[0-9]/}" ]
}
test_corosync_keygen() {
rm -f "$COROSYNC_AUTHKEY"
corosync-keygen
# File exists
[ -f "$COROSYNC_AUTHKEY" ]
# ... and is not empty (wc format is "SIZE FILENAME" - remove FILENAME part)
wc_res=$(wc -c "$COROSYNC_AUTHKEY")
[ "${wc_res%% *}" -gt 0 ]
}
# test_corosync_start crypto
# crypto can be on or off
test_corosync_start() {
generate_corosync_conf "$1" > "$COROSYNC_CONF"
cat "$COROSYNC_CONF"
service_start "corosync"
}
test_corosync_stop() {
service_stop "corosync"
}
test_corosync_quorumtool() {
quorumtool_res_file=`mktemp`
# This is already fixed in upstream db38e3958c4f88d5d06e8f7c83d6d90334d9fbd2
(corosync-quorumtool -ips || true) | tee "$quorumtool_res_file"
# Ensure this is single node cluster
grep -qi '^Nodes:.*1$' "$quorumtool_res_file"
# Current node id is 1
grep -qi '^Node ID:.*1$' "$quorumtool_res_file"
# Is quorate (libquorum)
grep -qi '^Quorate:.*Yes$' "$quorumtool_res_file"
# Quorum is 1
grep -qi '^Quorum:.*1' "$quorumtool_res_file"
# Is quorate (libvotequorum)
grep -qi '^Flags:.*Quorate' "$quorumtool_res_file"
rm -f "$quorumtool_res_file"
}
test_corosync_cmapctl() {
cmapctl_res_file=`mktemp`
corosync-cmapctl | tee "$cmapctl_res_file"
# cluster_name key exists in full output
grep -qi '^totem.cluster_name (str) = smoketestcluster$' "$cmapctl_res_file"
corosync-cmapctl "totem." | tee "$cmapctl_res_file"
# cluster_name key exists in reduced output
grep -qi '^totem.cluster_name (str) = smoketestcluster$' "$cmapctl_res_file"
# cluster_name key should be returned
corosync-cmapctl -g "totem.cluster_name" | tee "$cmapctl_res_file"
grep -qi '^totem.cluster_name (str) = smoketestcluster$' "$cmapctl_res_file"
rm -f "$cmapctl_res_file"
}
# test_corosync_reload - requires stopped corosync
test_corosync_reload() {
cmapctl_res_file=`mktemp`
test_corosync_start "off"
# Get current token timeout
corosync-cmapctl -g "runtime.config.totem.token" | tee "$cmapctl_res_file"
cmapctl_res=$(cat "$cmapctl_res_file")
# Format is runtime.config.totem.token (u32) = value
token_pre_reload=${cmapctl_res##* }
[ "$token_pre_reload" -eq "$TOKEN_TIMEOUT" ]
# Generate new corosync.conf with token_timeout*10
new_token_timeout=$((TOKEN_TIMEOUT*10))
generate_corosync_conf "off" "$new_token_timeout" > "$COROSYNC_CONF"
cat "$COROSYNC_CONF"
# Main call of the test
corosync-cfgtool -R
# Check that new token timeout is in use
corosync-cmapctl -g "runtime.config.totem.token" | tee "$cmapctl_res_file"
cmapctl_res=$(cat "$cmapctl_res_file")
# Format is runtime.config.totem.token (u32) = value
token_post_reload=${cmapctl_res##* }
[ "$token_post_reload" -eq "$new_token_timeout" ]
test_corosync_stop
rm -f "$cmapctl_res_file"
}
test_corosync_api() {
cflags=$(pkg-config --cflags libcpg)
libs=$(pkg-config --libs libcpg)
gcc -ggdb -Wall $cflags "/tmp/corosync-api-test.c" \
$libs -o "/tmp/corosync-api-test"
/tmp/corosync-api-test
}
test_corosync_api_mp() {
cflags=$(pkg-config --cflags libcpg)
libs=$(pkg-config --libs libcpg)
gcc -ggdb -Wall $cflags "/tmp/corosync-api-test-mp.c" \
$libs -o "/tmp/corosync-api-test-mp"
/tmp/corosync-api-test-mp
}
test_corosync_man_pages() {
# At least these man pages should be installed
expected_mp="corosync corosync.conf corosync-cfgtool corosync-cmapctl
corosync-keygen corosync-quorumtool"
for mp in $expected_mp;do
man -w "$mp"
done
}
########
# main #
########
if [ -z "$PREFIX" ];then
echo "PREFIX not defined. Do not run *.inc.sh directly"
exit 1
fi
test_corosync_v
test_corosync_keygen
test_corosync_man_pages
for crypto in "off" "on";do
test_corosync_start "$crypto"
test_corosync_quorumtool
test_corosync_cmapctl
test_corosync_api
test_corosync_api_mp
test_corosync_stop
done
test_corosync_reload

12
tests/tests.yml Normal file
View File

@ -0,0 +1,12 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- smoke
required_packages:
- gcc
- iproute
- corosync
- corosync-devel