From 3c629c52a93fbf1a98c341bf01a7ddeb761499a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0abata?= Date: Wed, 14 Oct 2020 23:20:28 +0200 Subject: [PATCH] RHEL 9.0.0 Alpha bootstrap The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/crontabs#29368b04c54ba45164448b229458783f510a1836 --- .gitignore | 2 + crontabs.spec | 290 ++++++++++++++++++ sources | 1 + .../Makefile | 63 ++++ .../test-of-functionality-of-crontabs/PURPOSE | 3 + .../runtest.sh | 83 +++++ tests/tests.yml | 12 + 7 files changed, 454 insertions(+) create mode 100644 crontabs.spec create mode 100644 sources create mode 100644 tests/test-of-functionality-of-crontabs/Makefile create mode 100644 tests/test-of-functionality-of-crontabs/PURPOSE create mode 100644 tests/test-of-functionality-of-crontabs/runtest.sh create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index e69de29..d39dbc2 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +*.tar.* diff --git a/crontabs.spec b/crontabs.spec new file mode 100644 index 0000000..4081ca7 --- /dev/null +++ b/crontabs.spec @@ -0,0 +1,290 @@ +%global snap_release 20190603 +Summary: Root crontab files used to schedule the execution of programs +Name: crontabs +Version: 1.11 +Release: 23.%{snap_release}git%{?dist} +License: Public Domain and GPLv2 +URL: https://github.com/cronie-crond/crontabs +Source0: https://github.com/cronie-crond/crontabs/releases/download/crontabs-%{snap_release}/%{name}-%{version}-%{snap_release}git.tar.gz +BuildArch: noarch +Requires: sed +Recommends: cronie + +%description +This package is used by Fedora mainly for executing files by cron. + +The crontabs package contains root crontab files and directories. +You will need to install cron daemon to run the jobs from the crontabs. +The cron daemon such as cronie or fcron checks the crontab files to +see when particular commands are scheduled to be executed. If commands +are scheduled, it executes them. + +Crontabs handles a basic system function, so it should be installed on +your system. + +%prep +%setup -q + +%build +#empty + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/etc/cron.{hourly,daily,weekly,monthly} +mkdir -p $RPM_BUILD_ROOT/usr/bin +mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man4/ + +install -m644 ./crontab $RPM_BUILD_ROOT/etc/crontab +install -m755 ./run-parts $RPM_BUILD_ROOT/usr/bin/run-parts +install -m644 ./{crontabs,run-parts}.4 $RPM_BUILD_ROOT/%{_mandir}/man4/ + +mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/ +touch $RPM_BUILD_ROOT/etc/sysconfig/run-parts + +%files +%{!?_licensedir:%global license %%doc} +%license COPYING +%config(noreplace) /etc/crontab +%attr(0644,root,root) %config(noreplace) /etc/sysconfig/run-parts +%{_bindir}/run-parts +%dir /etc/cron.hourly +%dir /etc/cron.daily +%dir /etc/cron.weekly +%dir /etc/cron.monthly +%{_mandir}/man4/* + +%changelog +* Mon Jul 27 2020 Fedora Release Engineering - 1.11-23.20190603git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jan 28 2020 Fedora Release Engineering - 1.11-22.20190603git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jul 24 2019 Fedora Release Engineering - 1.11-21.20190603git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Mon Jun 3 2019 Tomáš Mráz - 1.11-20.20190603git +- fix regression from the previous release (#1716114) + +* Thu May 30 2019 Tomáš Mráz - 1.11-19.20190530git +- fix race condition in run-parts causing it to hang occasionally +- fix upstream URLs + +* Thu Jan 31 2019 Fedora Release Engineering - 1.11-18.20150630git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jul 12 2018 Fedora Release Engineering - 1.11-17.20150630git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 1.11-16.20150630git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.11-15.20150630git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 1.11-14.20150630git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Nov 24 2016 Tomáš Mráz - 1.11-13.20150630git +- use Recommends to pull in cronie (#1269172) + +* Wed Feb 03 2016 Fedora Release Engineering - 1.11-12.20150630git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Aug 12 2015 Tomáš Mráz - 1.11-11.20150630git +- fix logging of PID in the finished line (#1236841) + +* Wed Jun 17 2015 Fedora Release Engineering - 1.11-10.20130830git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri Jul 11 2014 Tom Callaway - 1.11-9.20130830git +- fix license handling + +* Sat Jun 07 2014 Fedora Release Engineering - 1.11-8.20130830git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri Aug 30 2013 Marcela Mašláňová 1.11-7.20121102git +- fix man page link 971583 + +* Sat Aug 03 2013 Fedora Release Engineering - 1.11-6.20121102git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Feb 13 2013 Fedora Release Engineering - 1.11-5.20121102git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Nov 1 2012 Marcela Mašláňová 1.11-5.20121102git +- update to the latest git snapshot with copying file and fixed man pages + +* Wed Jul 18 2012 Fedora Release Engineering - 1.11-4.20101115git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 1.11-3.20101115git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 1.11-2.20101115git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Nov 15 2010 Marcela Mašláňová 1.11-1 +- run-parts attempted to execute jobs that are not executable. + +* Thu Nov 11 2010 Marcela Mašláňová 1.11-1 +- 652268 fix missing / + +* Tue Nov 9 2010 Marcela Mašláňová 1.11-1 +- new git snapshot with --test and --list options + +* Fri Oct 22 2010 Marcela Mašláňová 1.11-1 +- use sources from source fedorahosted + +* Mon Oct 18 2010 Marcela Mašláňová 1.10-34 +- add --list option into run-parts + +* Wed Mar 24 2010 Marcela Mašláňová 1.10-33 +- remove useless seting of home to "/" + +* Mon Oct 12 2009 Marcela Mašláňová 1.10-32 +- rebuilt for review + +* Fri Jul 24 2009 Fedora Release Engineering - 1.10-31 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Jun 18 2009 Marcela Mašláňová 1.10-30 +- 491793 thanks Andrew Hecox for patch which allows set allow/deny jobs +- comment change "empty crontab" + +* Tue Feb 24 2009 Fedora Release Engineering - 1.10-29 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Jan 27 2009 Marcela Mašláňová 1.10-28 +- 474219 requires on /etc/cron.d + +* Mon Jan 26 2009 Marcela Mašláňová 1.10-27 +- Change requires back to cronie. + +* Mon Jan 26 2009 Marcela Mašláňová 1.10-26 +- change /etc/crontab. All anacron jobs in cron.daily,weekly,... + are check by anacron every hour. Anacron run them if they didn't + run today. + +* Mon Dec 1 2008 Jan ONDREJ (SAL) 1.10-25 +- Added /etc/cron.{hourly,daily,weekly,monthly} dirs again. bz#473353 + +* Mon Jun 9 2008 Marcela Maslanova 1.10-23 +- 450084 LANG=C is set up for running scripts + +* Wed May 28 2008 Marcela Maslanova 1.10-22 +- remove scripts for delay, anacron now own most of the scripts. +Crontabs owns only run-parts, /etc/crontab and crontabs sysconfig. + +* Mon May 5 2008 Marcela Maslanova 1.10-21 +- 445079 delay script failed in case DELAY is zero + +* Fri Apr 4 2008 Marcela Maslanova 1.10-20 +- 440410 log pid of process instead of logger's pid + +* Mon Oct 22 2007 Marcela Maslanova 1.10-19 +- run-parts log also end of each job (patch from J. Kamens) +- Resolves: rhbz#303081 + +* Tue Sep 25 2007 Marcela Maslanova 1.10-18 +- cron.{hourly, daily,...} run ok +- rhbz#296741 + +* Thu Aug 30 2007 Marcela Maslanova 1.10-17 +- better solution of configuration script + +* Mon Aug 27 2007 Marcela Maslanova 1.10-16 +- 254220 typo in script run-parts + +* Tue Aug 21 2007 Marcela Maslanova 1.10-15 +- corrected license tag in spec +- add config file to crontab - delay of cron.{daily,...} could be + switch off +- Resolves: rhbz#253536 + +* Tue Feb 27 2007 Marcela Maslanova 1.10-14 +- review again + +* Thu Feb 8 2007 Marcela Maslanova 1.10-13 +- rhbz#225662 review + +* Mon Jan 29 2007 Marcela Maslanova 1.10-12 +- link daily,weekly,monthly +- rhbz#224687 + +* Wed Jan 24 2007 Marcela Maslanova 1.10-11 +- crontabs should ignore Cfengine files, rebuilt +- Resolves: rhbz#223472 + +* Wed Oct 11 2006 Marcela Maslanova 1.10-9 +- patch (#110894) for delaying more emails in the moment + +* Fri Jul 14 2006 Jesse Keating 0 1.10-8 +- rebuilt + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Mon Sep 20 2004 Jason Vas Dias +- rebuilt under new CVS for dist-fc3 + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Fri Feb 7 2003 Bill Nottingham +- not-as-automated rebuild + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Wed Jan 09 2002 Tim Powers +- automated rebuild + +* Thu Jul 19 2001 Preston Brown +- don't require tmpwatch + +* Tue Feb 27 2001 Preston Brown +- noreplace crontab file; use tmppath + +* Wed Jan 31 2001 Bill Nottingham +- don't process ,v files (#15968) + +* Mon Aug 7 2000 Bill Nottingham +- put name of script in output of stuff run by run-parts (#12411) + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Tue Jun 6 2000 Bill Nottingham +- rebuild + +* Fri Aug 27 1999 Jeff Johnson +- don't run *~ or *, files (#4740). + +* Thu Apr 15 1999 Bill Nottingham +- don't run .rpm{save,new,orig} files (bug #2190) + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 5) + +* Mon Nov 30 1998 Bill Nottingham +- crontab: set HOME=/ + +* Sat Jun 27 1998 Jeff Johnson +- run-parts: skip sub-directories (e.g. CVS) found instead of complaining + +* Fri Apr 24 1998 Prospector System +- translations modified for de, fr, tr + +* Tue Apr 07 1998 Erik Troan +- moved crontab jobs up a bit to make sure they aren't confused by + switching to and fro daylight savings time + +* Fri Oct 24 1997 Erik Troan +- removed tmpwatch and at entries + +* Thu Jul 31 1997 Erik Troan +- made a noarch package diff --git a/sources b/sources new file mode 100644 index 0000000..4c06f8a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (crontabs-1.11-20190603git.tar.gz) = 1f0dae337c9dcd07cbc20bdc2c596f4e6aa314c025329fa5d2d53048cf84ba1e0c82bb0b66fefb7333aa58290d421debe0aaf8bf5d6733ddd4442d9ad668a945 diff --git a/tests/test-of-functionality-of-crontabs/Makefile b/tests/test-of-functionality-of-crontabs/Makefile new file mode 100644 index 0000000..2d71943 --- /dev/null +++ b/tests/test-of-functionality-of-crontabs/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/crontabs/Sanity/test-of-functionality-of-crontabs +# Description: test of functionality of crontabs +# Author: Petr Sklenar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 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/crontabs/Sanity/test-of-functionality-of-crontabs +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) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Petr Sklenar " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: test of functionality of crontabs" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 30m" >> $(METADATA) + @echo "RunFor: crontabs" >> $(METADATA) + @echo "Requires: crontabs" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/test-of-functionality-of-crontabs/PURPOSE b/tests/test-of-functionality-of-crontabs/PURPOSE new file mode 100644 index 0000000..7e082f0 --- /dev/null +++ b/tests/test-of-functionality-of-crontabs/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/crontabs/Sanity/test-of-functionality-of-crontabs +Description: test of functionality of crontabs +Author: Petr Sklenar diff --git a/tests/test-of-functionality-of-crontabs/runtest.sh b/tests/test-of-functionality-of-crontabs/runtest.sh new file mode 100644 index 0000000..98548b2 --- /dev/null +++ b/tests/test-of-functionality-of-crontabs/runtest.sh @@ -0,0 +1,83 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/crontabs/Sanity/test-of-functionality-of-crontabs +# Description: test of functionality of crontabs +# Author: Petr Sklenar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 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/lib/beakerlib/beakerlib.sh + +PACKAGE="crontabs" +#how long should we wait: +COUNT=5 +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + user="petr$RANDOM" + rlRun "rm -rf /tmp/test.createdbypetr /tmp/test.createdbyroot" 0 "Removing tmp directory" + rlRun "useradd $user" + rlFileBackup /etc/crontab + rlPhaseEnd + + rlPhaseStartTest + echo "* * * * * root echo root >> /tmp/test.createdbyroot" >> /etc/crontab + rlAssert0 "added first entry into crontab" $? + echo "* * * * * $user echo petr >> /tmp/test.createdbypetr" >> /etc/crontab + rlAssert0 "added second entry into crontab" $? + #sleep a while + rlRun "sleep ${COUNT}m" 0 "sleeping for 5m to wait for cron to create files" + rlPhaseEnd + + rlPhaseStartTest "check content" + byroot=`grep root /tmp/test.createdbyroot | wc -l` + bypetr=`grep petr /tmp/test.createdbypetr | wc -l` + if [ "$byroot" -ge "${COUNT}" ];then + rlPass "there is $byroot line" + else + rlFail "there is $byroot line" + fi + + if [ "$bypetr" -ge "${COUNT}" ];then + rlPass "there is $bypetr line" + else + rlFail "there is $bypetr line" + fi + rlPhaseEnd + + rlPhaseStartTest "check permissions of created files" + /bin/ls -la /tmp/test.createdbyroot | grep "root root" + rlAssert0 "permissions are root root" $? + /bin/ls -la /tmp/test.createdbypetr | grep "$user $user" + rlAssert0 "permissions are $user $user" $? + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "rm -rf /tmp/test.createdbypetr /tmp/test.createdbyroot" 0 "Removing tmp directory" + rlRun "userdel -r $user" + rlFileRestore + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..22f9d4d --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +--- +# This first play always runs on the local staging system +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + tests: + - test-of-functionality-of-crontabs + required_packages: + - crontabs # test-of-functionality-of-crontabs needs crontabs + - findutils # beakerlib needs find command