Compare commits

..

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

12 changed files with 255 additions and 63 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

15
.gitignore vendored
View File

@ -1 +1,14 @@
SOURCES/tlog-14.tar.gz /tlog-2.tar.gz
/tlog-3.tar.gz
/tlog-4.tar.gz
/tlog-5.tar.gz
/tlog-6.tar.gz
/tlog-7.tar.gz
/tlog-8.tar.gz
/tlog-9.tar.gz
/tlog-10.tar.gz
/tlog-11.tar.gz
/tlog-12.tar.gz
/tlog-12.1.tar.gz
/tlog-13.tar.gz
/tlog-14.tar.gz

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
# recipients: jstephen, spoore, aborah
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (tlog-14.tar.gz) = 593d0d845b6b10de33094658160fb6d675d7f07493e5e3a84b20ea26154c56bb1f75a85805468bc061f0a14e305f6c2140e56e6cfa8e94d9849387d47f674ccd

11
tests/full_tests.yml Normal file
View File

@ -0,0 +1,11 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- tlogtests:
dir: scripts
run: ./run_tests.sh
required_packages:
- git

8
tests/plans/all.fmf Normal file
View File

@ -0,0 +1,8 @@
summary: Run gating tests
discover:
how: fmf
dist-git-source: true
dist-git-type: centos
execute:
how: tmt

5
tests/provision.fmf Normal file
View File

@ -0,0 +1,5 @@
---
standard-inventory-qcow2:
qemu:
m: 4G
smp: cpus=4,sockets=4,maxcpus=16

6
tests/scripts/main.fmf Normal file
View File

@ -0,0 +1,6 @@
summary: Run tlog tier1 tests
require:
- git
- tlog
test: ./run_tests.sh -m tier1
duration: 30m

28
tests/scripts/run_tests.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash -x
RETVAL=0
dnf -y install expect beakerlib make restraint-rhts
. /usr/share/beakerlib/beakerlib.sh
if rlIsRHEL '>=9'; then
dnf --enablerepo rhel-buildroot install python3-pytest -y
fi
# RHEL10 cloud-init disables password authentication
# tlog tests need this to run currently
cat > /etc/ssh/sshd_config.d/00-tlog-override.conf <<EOF
PasswordAuthentication yes
EOF
chmod 600 /etc/ssh/sshd_config.d/00-tlog-override.conf
systemctl restart sshd
git clone https://github.com/Scribery/tlog.git
pushd tlog/src/tlitest
./tlitest-setup
./tlitest-run --junit-xml=/tmp/artifacts/junit.xml $*
#./teltest-teardown
RETVAL=$(( RETVAL + $? ))
popd
exit $RETVAL

12
tests/tests.yml Normal file
View File

@ -0,0 +1,12 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- tlogtests:
dir: scripts
run: ./run_tests.sh -m tier1
required_packages:
- git

View File

@ -1,25 +1,80 @@
%global _hardened_build 1
%if 0%{?rhel} && 0%{?rhel} < 7
# If it's RHEL6 and older
%bcond_with systemd
%else
%bcond_without systemd
%endif
%if "%{_vendor}" == "debbuild"
# Set values to make debian builds work well
%global _defaultdocdir /usr/share/doc/%{name}
%global _buildshell /bin/bash
%global _lib lib/%(%{__dpkg_architecture} -qDEB_HOST_MULTIARCH)
%endif
# Compatibility macros
%{!?_tmpfilesdir:%global _tmpfilesdir %{_prefix}/lib/tmpfiles.d}
%{!?make_build:%global make_build %{__make} %{?_smp_mflags}}
Name: tlog Name: tlog
Version: 14 Version: 14
Release: 1%{?dist} Release: 4%{?dist}
Summary: Terminal I/O logger Summary: Terminal I/O logger
License: GPLv2+ %if "%{_vendor}" == "debbuild"
URL: https://github.com/Scribery/%{name} # Required for Debian
Source: https://github.com/Scribery/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz Packager: Justin Stephenson <jstephen@redhat.com>
Group: admin
BuildRequires: gcc License: GPL-2.0+
BuildRequires: json-c-devel %else
BuildRequires: curl-devel Group: Applications/System
BuildRequires: m4 License: GPL-2.0-or-later
BuildRequires: libutempter-devel
# If it's not RHEL6 and older
%if 0%{?rhel} == 0 || 0%{?rhel} >= 7
BuildRequires: systemd-devel
BuildRequires: systemd-units
%endif %endif
Requires(post): sed
Requires(postun): sed
URL: https://github.com/Scribery/%{name}
Source0: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source1: tlog.sysusers
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: m4
BuildRequires: gcc
BuildRequires: make
%if "%{_vendor}" == "debbuild"
BuildRequires: libjson-c-dev
BuildRequires: libcurl4-gnutls-dev
BuildRequires: libutempter-dev
# Debian/Ubuntu doesn't automatically pull this in...
BuildRequires: pkg-config
%if %{with systemd}
BuildRequires: libsystemd-dev
# Expanded form of systemd_requires macro
Requires: systemd-sysv
Requires(preun): systemd
Requires(post): systemd
Requires(postun): systemd
%{?sysusers_requires_compat}
%endif
%else
BuildRequires: pkgconfig(json-c)
BuildRequires: pkgconfig(libcurl)
%if %{defined suse_version}
BuildRequires: utempter-devel
%else
BuildRequires: libutempter-devel
%endif
%if %{with systemd}
BuildRequires: pkgconfig(libsystemd)
%{?systemd_requires}
%endif
%endif
%description %description
Tlog is a terminal I/O recording program similar to "script", but used in Tlog is a terminal I/O recording program similar to "script", but used in
@ -27,49 +82,31 @@ place of a user's shell, starting the recording and executing the real user's
shell afterwards. The recorded I/O can then be forwarded to a logging server shell afterwards. The recorded I/O can then be forwarded to a logging server
in JSON format. in JSON format.
%global _hardened_build 1
%prep %prep
%setup -q %setup -q
%build %build
# If it's not RHEL6 and older %configure --disable-rpath --disable-static --enable-utempter %{!?with_systemd:--disable-journal} --docdir=%{_defaultdocdir}/%{name}
%if 0%{?rhel} == 0 || 0%{?rhel} >= 7 %make_build
%configure --disable-rpath --disable-static --enable-utempter
# Else, if it's RHEL6 or older
%else
%configure --disable-rpath --disable-static --disable-journal
%endif
make %{?_smp_mflags}
%check %check
make %{?_smp_mflags} check %make_build check
%pre
getent group %{name} >/dev/null ||
groupadd -r %{name}
getent passwd %{name} >/dev/null ||
useradd -r -g %{name} -d %{_localstatedir}/run/%{name} -s /sbin/nologin \
-c "Tlog terminal I/O logger" %{name}
%install %install
make install DESTDIR=%{buildroot} %make_install
rm %{buildroot}/%{_libdir}/*.la rm %{buildroot}/%{_libdir}/*.la
# Remove development files as we're not doing a devel package yet # Remove development files as we're not doing a devel package yet
rm %{buildroot}/%{_libdir}/*.so rm %{buildroot}/%{_libdir}/*.so
rm -r %{buildroot}/usr/include/%{name} rm -r %{buildroot}/usr/include/%{name}
# If it's not RHEL6 and older %if %{with systemd}
%if 0%{?rhel} == 0 || 0%{?rhel} >= 7
# Create tmpfiles.d configuration for the lock dir # Create tmpfiles.d configuration for the lock dir
mkdir -p %{buildroot}%{_tmpfilesdir} mkdir -p %{buildroot}%{_tmpfilesdir}
{ {
echo "# Type Path Mode UID GID Age Argument" echo "# Type Path Mode UID GID Age Argument"
echo "d /run/%{name} 0755 %{name} %{name}" echo "d /run/%{name} 0755 %{name} %{name}"
} > %{buildroot}%{_tmpfilesdir}/%{name}.conf } > %{buildroot}%{_tmpfilesdir}/%{name}.conf
# Create the lock dir
mkdir -p %{buildroot}/run
install -d -m 0755 %{buildroot}/run/%{name}
# Else, if it's RHEL6 or older # Else, if it's RHEL6 or older
%else %else
# Create the lock dir # Create the lock dir
@ -77,6 +114,8 @@ rm -r %{buildroot}/usr/include/%{name}
install -d -m 0755 %{buildroot}%{_localstatedir}/run/%{name} install -d -m 0755 %{buildroot}%{_localstatedir}/run/%{name}
%endif %endif
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/%{name}.conf
%files %files
%{!?_licensedir:%global license %doc} %{!?_licensedir:%global license %doc}
%license COPYING %license COPYING
@ -88,53 +127,103 @@ rm -r %{buildroot}/usr/include/%{name}
%{_datadir}/%{name} %{_datadir}/%{name}
%{_mandir}/man5/* %{_mandir}/man5/*
%{_mandir}/man8/* %{_mandir}/man8/*
# If it's not RHEL6 and older %if %{with systemd}
%if 0%{?rhel} == 0 || 0%{?rhel} >= 7 %{_tmpfilesdir}/%{name}.conf
%config(noreplace) %{_tmpfilesdir}/%{name}.conf
%dir %attr(-,%{name},%{name}) /run/%{name}
# Else if it's RHEL6 or older
%else %else
# If it's RHEL6 and older
%dir %attr(-,%{name},%{name}) %{_localstatedir}/run/%{name} %dir %attr(-,%{name},%{name}) %{_localstatedir}/run/%{name}
%endif %endif
%dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/%{name}-rec.conf %config(noreplace) %{_sysconfdir}/%{name}/%{name}-rec.conf
%config(noreplace) %{_sysconfdir}/%{name}/%{name}-rec-session.conf %config(noreplace) %{_sysconfdir}/%{name}/%{name}-rec-session.conf
%config(noreplace) %{_sysconfdir}/%{name}/%{name}-play.conf %config(noreplace) %{_sysconfdir}/%{name}/%{name}-play.conf
%{_sysusersdir}/%{name}.conf
%pre
%sysusers_create_compat %{SOURCE1}
%post %post
/sbin/ldconfig /sbin/ldconfig
%if 0%{?el7} || 0%{?suse_version} >= 1315
# For RHEL7 and SUSE Linux distributions, creation doesn't happen automatically
%tmpfiles_create %{name}.conf
%endif
%if 0%{?ubuntu} || 0%{?debian}
# For Debian/Ubuntu, creation doesn't happen automatically
systemd-tmpfiles --create %{name}.conf >/dev/null 2>&1 || :
%endif
%postun %postun
/sbin/ldconfig /sbin/ldconfig
%changelog %changelog
* Wed Feb 07 2024 Justin Stephenson <jstephen@redhat.com> - 14-1 * Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 14-4
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Jul 01 2024 Justin Stephenson <jstephen@redhat.com> - 14-3
- Bump release to validate gating
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 14-2
- Bump release for June 2024 mass rebuild
* Tue Feb 06 2024 Justin Stephenson <jstephen@redhat.com> - 14-1
- Release v14 - Release v14
- configure: correctly handle systemd versions before 245 - configure: correctly handle systemd versions before 245
* Mon Apr 17 2023 Justin Stephenson <jstephen@redhat.com> - 13-1 * Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 13-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 13-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Jul 14 2023 Justin Stephenson <jstephen@redhat.com> - 13-2
- Provide a sysusers.d file to get user() and group() provides
(see https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format).
* Fri Apr 14 2023 Justin Stephenson <jstephen@redhat.com> - 13-1
- Release v13
- Update the Fedora license - Update the Fedora license
- MAN: Add missing comma in tlog-rec-session.conf - MAN: Add missing comma in tlog-rec-session.conf
* Mon May 23 2022 Justin Stephenson <jstephen@redhat.com> - 12.1 * Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 12.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 12.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Apr 20 2022 Justin Stephenson <jstephen@redhat.com> - 12.1
- Exit transfer loop when output fd is closed - Exit transfer loop when output fd is closed
- Revert "Prevent infinite transfer loop on GDM login" - Revert "Prevent infinite transfer loop on GDM login"
* Wed Nov 17 2021 Justin Stephenson <jstephen@redhat.com> - 12-1 * Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Nov 16 2021 Justin Stephenson <jstephen@redhat.com> - 12-1
- Release v12 - Release v12
- Prevent infinite transfer loop on GDM login. - Prevent infinite transfer loop on GDM login.
- tlog-play: add journal namespace support. - tlog-play: add journal namespace support.
- tlitest: extend delay for limit-action delay test. - tlitest: extend delay for limit-action delay test.
* Tue Apr 27 2021 Justin Stephenson <jstephen@redhat.com> - 11-1 * Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 11-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Sat Jul 10 2021 Björn Esser <besser82@fedoraproject.org> - 11-3
- Rebuild for versioned symbols in json-c
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jan 19 2021 Justin Stephenson <jstephen@redhat.com> - 11-1
- Release v11
- Fire SIGCHLD after utempter_add_record since it probably eats it. - Fire SIGCHLD after utempter_add_record since it probably eats it.
* Fri Jan 8 2021 Justin Stephenson <jstephen@redhat.com> - 10-1
- Release v10
- Correct suse rpmbuild - Correct suse rpmbuild
- Update debbuild for travis CI - Update debbuild for travis CI
* Thu Oct 15 2020 Justin Stephenson <jstephen@redhat.com> - 9-2 * Tue Oct 13 2020 Justin Stephenson <jstephen@redhat.com> - 9-1
- Skip utmp removal with piped IO on stdin
* Thu Oct 15 2020 Justin Stephenson <jstephen@redhat.com> - 9-1
- Release v9 - Release v9
- Add libutempter support - Add libutempter support
- Require journal match filter - Require journal match filter
@ -143,18 +232,27 @@ rm -r %{buildroot}/usr/include/%{name}
- Add "time" real clock timestamp message field - Add "time" real clock timestamp message field
- Various upstream CI improvements - Various upstream CI improvements
* Tue May 26 2020 Justin Stephenson <jstephen@redhat.com> - 8-2 * Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 8-3
- Test fixups from v8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu May 21 2020 Justin Stephenson <jstephen@redhat.com> - 8-1 * Fri May 22 2020 Justin Stephenson <jstephen@redhat.com> - 8-2
- Minor test fixups
* Tue May 19 2020 Justin Stephenson <jstephen@redhat.com> - 8-1
- Release v8 - Release v8
- Spec file fixes for EL6 - Spec file fixes for EL6
- Spec file improvements for Debian/Ubuntu pkg-config - Spec file improvements for Debian/Ubuntu pkg-config
- Tlog-play improve authentication options - Tlog-play improve authentication options
- Handle piped in I/O from stdin and improve the main recording transfer exit - Handle piped in I/O from stdin and improve the main recording
condition. transfer exit condition.
- Use empty string on hostname resolution failure - Use empty string on hostname resolution failure
* Tue Apr 21 2020 Björn Esser <besser82@fedoraproject.org> - 7-3
- Rebuild (json-c)
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Nov 12 2019 Justin Stephenson <jstephen@redhat.com> - 7-1 * Tue Nov 12 2019 Justin Stephenson <jstephen@redhat.com> - 7-1
- Release v7 - Release v7
- Allow tlog-play redirection of stdout - Allow tlog-play redirection of stdout

2
tlog.sysusers Normal file
View File

@ -0,0 +1,2 @@
u tlog - "Tlog terminal I/O logger" /run/tlog /sbin/nologin
g tlog -