From 6743dfe08fb41889643ffe8837c1fec2ac340040 Mon Sep 17 00:00:00 2001 From: Andrei Stepanov Date: Fri, 6 Oct 2017 10:38:34 +0000 Subject: [PATCH] Add CI tests using the standard test interface Adds tests according to the CI wiki [0] specifically the standard test interface in the spec [1]. [0]: https://fedoraproject.org/wiki/CI [1]: https://fedoraproject.org/wiki/Changes/InvokingTests --- .../Makefile | 62 ++++++ .../PURPOSE | 3 + .../runtest.sh | 63 ++++++ .../Makefile | 62 ++++++ .../PURPOSE | 4 + .../runtest.sh | 53 +++++ tests/MAILTO-problem-with-anacron/Makefile | 62 ++++++ tests/MAILTO-problem-with-anacron/PURPOSE | 4 + tests/MAILTO-problem-with-anacron/anacrontab | 5 + tests/MAILTO-problem-with-anacron/runtest.sh | 155 +++++++++++++++ tests/Make-crontab-a-PIE/Makefile | 63 ++++++ tests/Make-crontab-a-PIE/PURPOSE | 3 + tests/Make-crontab-a-PIE/runtest.sh | 56 ++++++ .../Makefile | 62 ++++++ .../PURPOSE | 3 + .../configs/scenario-01_1 | 16 ++ .../configs/scenario-02_0 | 16 ++ .../configs/scenario-03_1 | 18 ++ .../configs/scenario-04_1 | 17 ++ .../configs/scenario-05_1 | 14 ++ .../runtest.sh | 66 +++++++ .../Makefile | 62 ++++++ .../PURPOSE | 3 + .../core.sh | 3 + .../runtest.sh | 76 +++++++ tests/config-parsing-issue/Makefile | 62 ++++++ tests/config-parsing-issue/PURPOSE | 4 + tests/config-parsing-issue/runtest.sh | 53 +++++ .../Makefile | 62 ++++++ .../PURPOSE | 4 + .../runtest.sh | 59 ++++++ tests/crond-is-missing-RELRO-flags/Makefile | 63 ++++++ tests/crond-is-missing-RELRO-flags/PURPOSE | 5 + tests/crond-is-missing-RELRO-flags/runtest.sh | 43 ++++ .../Makefile | 62 ++++++ .../PURPOSE | 4 + .../crontab-job | 1 + .../run-job.sh | 9 + .../runtest.sh | 79 ++++++++ tests/cronie-jobs-environment/Makefile | 63 ++++++ tests/cronie-jobs-environment/PURPOSE | 3 + tests/cronie-jobs-environment/cron_test.sh | 5 + tests/cronie-jobs-environment/crontab.temp | 12 ++ .../libfaketime-0.9.1.tar.gz | Bin 0 -> 30398 bytes tests/cronie-jobs-environment/runtest.sh | 124 ++++++++++++ .../Makefile | 62 ++++++ .../PURPOSE | 4 + .../runtest.sh | 102 ++++++++++ tests/crontab-has-wrong-permissions/Makefile | 63 ++++++ tests/crontab-has-wrong-permissions/PURPOSE | 3 + .../crontab-has-wrong-permissions/runtest.sh | 56 ++++++ tests/echos-OK-twice-in-init-script/Makefile | 63 ++++++ tests/echos-OK-twice-in-init-script/PURPOSE | 4 + .../echos-OK-twice-in-init-script/runtest.sh | 76 +++++++ tests/init-script-failure/Makefile | 63 ++++++ tests/init-script-failure/PURPOSE | 3 + tests/init-script-failure/runtest.sh | 73 +++++++ tests/init-scripts-LSB/Makefile | 62 ++++++ tests/init-scripts-LSB/PURPOSE | 3 + tests/init-scripts-LSB/runtest.sh | 186 ++++++++++++++++++ tests/ldap-users/Makefile | 63 ++++++ tests/ldap-users/PURPOSE | 5 + tests/ldap-users/data.ldif | 26 +++ tests/ldap-users/runtest.sh | 133 +++++++++++++ tests/ldap-users/slapd.conf | 32 +++ tests/ldap-users/user1.cron | 10 + .../Makefile | 63 ++++++ .../only-one-running-instance-in-time/PURPOSE | 3 + .../runtest.sh | 52 +++++ tests/run-with-syslog-flag/Makefile | 62 ++++++ tests/run-with-syslog-flag/PURPOSE | 4 + tests/run-with-syslog-flag/runtest.sh | 81 ++++++++ tests/tests.yml | 62 ++++++ .../Makefile | 63 ++++++ .../PURPOSE | 5 + .../runtest.sh | 44 +++++ 76 files changed, 3199 insertions(+) create mode 100644 tests/Can-t-remove-crontab-from-expired-accounts/Makefile create mode 100644 tests/Can-t-remove-crontab-from-expired-accounts/PURPOSE create mode 100644 tests/Can-t-remove-crontab-from-expired-accounts/runtest.sh create mode 100644 tests/Cron-does-uid-lookups-for-non-existent-users/Makefile create mode 100644 tests/Cron-does-uid-lookups-for-non-existent-users/PURPOSE create mode 100644 tests/Cron-does-uid-lookups-for-non-existent-users/runtest.sh create mode 100644 tests/MAILTO-problem-with-anacron/Makefile create mode 100644 tests/MAILTO-problem-with-anacron/PURPOSE create mode 100644 tests/MAILTO-problem-with-anacron/anacrontab create mode 100644 tests/MAILTO-problem-with-anacron/runtest.sh create mode 100644 tests/Make-crontab-a-PIE/Makefile create mode 100644 tests/Make-crontab-a-PIE/PURPOSE create mode 100644 tests/Make-crontab-a-PIE/runtest.sh create mode 100644 tests/anacron-segfaults-with-certain-config-data-2/Makefile create mode 100644 tests/anacron-segfaults-with-certain-config-data-2/PURPOSE create mode 100644 tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-01_1 create mode 100644 tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-02_0 create mode 100644 tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-03_1 create mode 100644 tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-04_1 create mode 100644 tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-05_1 create mode 100644 tests/anacron-segfaults-with-certain-config-data-2/runtest.sh create mode 100644 tests/anacron-segfaults-with-certain-config-data/Makefile create mode 100644 tests/anacron-segfaults-with-certain-config-data/PURPOSE create mode 100644 tests/anacron-segfaults-with-certain-config-data/core.sh create mode 100644 tests/anacron-segfaults-with-certain-config-data/runtest.sh create mode 100644 tests/config-parsing-issue/Makefile create mode 100644 tests/config-parsing-issue/PURPOSE create mode 100644 tests/config-parsing-issue/runtest.sh create mode 100644 tests/cron-daemon-fails-to-log-that-it-is-shutting-down/Makefile create mode 100644 tests/cron-daemon-fails-to-log-that-it-is-shutting-down/PURPOSE create mode 100644 tests/cron-daemon-fails-to-log-that-it-is-shutting-down/runtest.sh create mode 100644 tests/crond-is-missing-RELRO-flags/Makefile create mode 100644 tests/crond-is-missing-RELRO-flags/PURPOSE create mode 100644 tests/crond-is-missing-RELRO-flags/runtest.sh create mode 100644 tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/Makefile create mode 100644 tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/PURPOSE create mode 100644 tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/crontab-job create mode 100644 tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/run-job.sh create mode 100644 tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/runtest.sh create mode 100644 tests/cronie-jobs-environment/Makefile create mode 100644 tests/cronie-jobs-environment/PURPOSE create mode 100644 tests/cronie-jobs-environment/cron_test.sh create mode 100644 tests/cronie-jobs-environment/crontab.temp create mode 100644 tests/cronie-jobs-environment/libfaketime-0.9.1.tar.gz create mode 100644 tests/cronie-jobs-environment/runtest.sh create mode 100644 tests/crontab-can-invoke-lookup-for-nonexisted-user/Makefile create mode 100644 tests/crontab-can-invoke-lookup-for-nonexisted-user/PURPOSE create mode 100644 tests/crontab-can-invoke-lookup-for-nonexisted-user/runtest.sh create mode 100644 tests/crontab-has-wrong-permissions/Makefile create mode 100644 tests/crontab-has-wrong-permissions/PURPOSE create mode 100644 tests/crontab-has-wrong-permissions/runtest.sh create mode 100644 tests/echos-OK-twice-in-init-script/Makefile create mode 100644 tests/echos-OK-twice-in-init-script/PURPOSE create mode 100644 tests/echos-OK-twice-in-init-script/runtest.sh create mode 100644 tests/init-script-failure/Makefile create mode 100644 tests/init-script-failure/PURPOSE create mode 100644 tests/init-script-failure/runtest.sh create mode 100644 tests/init-scripts-LSB/Makefile create mode 100644 tests/init-scripts-LSB/PURPOSE create mode 100644 tests/init-scripts-LSB/runtest.sh create mode 100644 tests/ldap-users/Makefile create mode 100644 tests/ldap-users/PURPOSE create mode 100644 tests/ldap-users/data.ldif create mode 100644 tests/ldap-users/runtest.sh create mode 100644 tests/ldap-users/slapd.conf create mode 100644 tests/ldap-users/user1.cron create mode 100644 tests/only-one-running-instance-in-time/Makefile create mode 100644 tests/only-one-running-instance-in-time/PURPOSE create mode 100644 tests/only-one-running-instance-in-time/runtest.sh create mode 100644 tests/run-with-syslog-flag/Makefile create mode 100644 tests/run-with-syslog-flag/PURPOSE create mode 100644 tests/run-with-syslog-flag/runtest.sh create mode 100644 tests/tests.yml create mode 100644 tests/usr-bin-crontab-has-wrong-permissions/Makefile create mode 100644 tests/usr-bin-crontab-has-wrong-permissions/PURPOSE create mode 100644 tests/usr-bin-crontab-has-wrong-permissions/runtest.sh diff --git a/tests/Can-t-remove-crontab-from-expired-accounts/Makefile b/tests/Can-t-remove-crontab-from-expired-accounts/Makefile new file mode 100644 index 0000000..eea8ff8 --- /dev/null +++ b/tests/Can-t-remove-crontab-from-expired-accounts/Makefile @@ -0,0 +1,62 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/Can-t-remove-crontab-from-expired-accounts +# Description: Test for Can't remove crontab from expired accounts +# Author: Karel Volny +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/cronie/Regression/Can-t-remove-crontab-from-expired-accounts +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: Karel Volny " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for Can't remove crontab from expired accounts" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Can-t-remove-crontab-from-expired-accounts/PURPOSE b/tests/Can-t-remove-crontab-from-expired-accounts/PURPOSE new file mode 100644 index 0000000..addedc0 --- /dev/null +++ b/tests/Can-t-remove-crontab-from-expired-accounts/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/cronie/Regression/Can-t-remove-crontab-from-expired-accounts +Description: Test for Can't remove crontab from expired accounts +Author: Karel Volny diff --git a/tests/Can-t-remove-crontab-from-expired-accounts/runtest.sh b/tests/Can-t-remove-crontab-from-expired-accounts/runtest.sh new file mode 100644 index 0000000..73d8914 --- /dev/null +++ b/tests/Can-t-remove-crontab-from-expired-accounts/runtest.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/Can-t-remove-crontab-from-expired-accounts +# Description: Test for Can't remove crontab from expired accounts +# Author: Karel Volny +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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="cronie" +TestUser="usertest" +ct_file="/var/spool/cron/$TestUser" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "useradd $TestUser" 0 "Adding the testing user" + rlPhaseEnd + + rlPhaseStartTest + rlRun "echo '1 1 1 1 1 nonsense' | crontab -u $TestUser -" 0 "Setting up crontab for the testing user" + rlRun -s "crontab -u $TestUser -l" 0 "Checking the testing crontab" + rlAssertGrep "nonsense" $rlRun_LOG + rlRun "chage -E 1 $TestUser" 0 "Expiring the testing user account" + rlRun "crontab -u $TestUser -r" 0 "Removing the testing crontab" + rlAssertNotGrep "not allowed" $rlRun_LOG + rlRun -s "crontab -u $TestUser -l" 1 "Checking the testing crontab (should not exist)" + rlAssertGrep "no crontab for $TestUser" $rlRun_LOG + rlAssertNotGrep "not allowed" $rlRun_LOG + rlAssertNotExists "$ct_file" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "userdel $TestUser" 0 "Deleting the testing user" + rlRun "popd" + rlRun "rm -rf $TmpDir $ct_file" 0 "Removing tmp directory and possible cruft" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Cron-does-uid-lookups-for-non-existent-users/Makefile b/tests/Cron-does-uid-lookups-for-non-existent-users/Makefile new file mode 100644 index 0000000..230390a --- /dev/null +++ b/tests/Cron-does-uid-lookups-for-non-existent-users/Makefile @@ -0,0 +1,62 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/Cron-does-uid-lookups-for-non-existent-users +# Description: Test for Cron does uid lookups for non-existent users +# Author: Vaclav Danek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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/cronie/Regression/Cron-does-uid-lookups-for-non-existent-users +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: Vaclav Danek " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for Cron does uid lookups for non-existent users" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Cron-does-uid-lookups-for-non-existent-users/PURPOSE b/tests/Cron-does-uid-lookups-for-non-existent-users/PURPOSE new file mode 100644 index 0000000..9d7cf13 --- /dev/null +++ b/tests/Cron-does-uid-lookups-for-non-existent-users/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/cronie/Regression/Cron-does-uid-lookups-for-non-existent-users +Description: Test for Cron does uid lookups for non-existent users +Author: Vaclav Danek +Bug summary: Cron does uid lookups for non-existent users diff --git a/tests/Cron-does-uid-lookups-for-non-existent-users/runtest.sh b/tests/Cron-does-uid-lookups-for-non-existent-users/runtest.sh new file mode 100644 index 0000000..72329da --- /dev/null +++ b/tests/Cron-does-uid-lookups-for-non-existent-users/runtest.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/Cron-does-uid-lookups-for-non-existent-users +# Description: Test for Cron does uid lookups for non-existent users +# Author: Vaclav Danek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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="cronie" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "sleep 61 | crontab -" 0 + rlRun -s "tail /var/log/cron" 0 + rlAssertNotGrep "ORPHAN (no passwd entry)" $rlRun_LOG + rm -f $rlRun_LOG + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/MAILTO-problem-with-anacron/Makefile b/tests/MAILTO-problem-with-anacron/Makefile new file mode 100644 index 0000000..cc54f39 --- /dev/null +++ b/tests/MAILTO-problem-with-anacron/Makefile @@ -0,0 +1,62 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/MAILTO-problem-with-anacron +# Description: Test for MAILTO problem with anacron +# Author: Karel Volny +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/cronie/Regression/MAILTO-problem-with-anacron +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE anacrontab + +.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: Karel Volny " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for MAILTO problem with anacron" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/MAILTO-problem-with-anacron/PURPOSE b/tests/MAILTO-problem-with-anacron/PURPOSE new file mode 100644 index 0000000..0eb365c --- /dev/null +++ b/tests/MAILTO-problem-with-anacron/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/cronie/Regression/MAILTO-problem-with-anacron +Description: Test for MAILTO problem with anacron +Author: Karel Volny +Bug summary: MAILTO problem with anacron diff --git a/tests/MAILTO-problem-with-anacron/anacrontab b/tests/MAILTO-problem-with-anacron/anacrontab new file mode 100644 index 0000000..c672b71 --- /dev/null +++ b/tests/MAILTO-problem-with-anacron/anacrontab @@ -0,0 +1,5 @@ +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=testuser1 + +1 0 test echo "Hello anacron!" diff --git a/tests/MAILTO-problem-with-anacron/runtest.sh b/tests/MAILTO-problem-with-anacron/runtest.sh new file mode 100644 index 0000000..9504398 --- /dev/null +++ b/tests/MAILTO-problem-with-anacron/runtest.sh @@ -0,0 +1,155 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/MAILTO-problem-with-anacron +# Description: Test for MAILTO problem with anacron +# Author: Karel Volny +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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="cronie" +TestDir=$PWD + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "useradd testuser1" 0 "Adding the testing user" + rlFileBackup --clean /var/spool/mail/root /var/log/cron + # stop cron not to interfere with our logs + rlServiceStop crond + rlPhaseEnd + + # email should be sent to user specified via MAILTO (testuser1) + rlPhaseStartTest anacronmail + rlRun "truncate --size 0 /var/spool/mail/testuser1" 0 "Truncating mail queue for the user 'testuser1'" + rlRun "truncate --size 0 /var/log/cron" 0 "Truncating cron log" + # DEBUG + echo "anacrontab:" + echo "***********" + cat ${TestDir}/anacrontab + rlRun "anacron -f -n -d -t ${TestDir}/anacrontab" 0 "Forcing anacron to run job" + sleep 5 + # DEBUG + echo "/var/spool/mail/testuser1:" + echo "**************************" + cat /var/spool/mail/testuser1 + rlAssertGrep "anacron" "/var/spool/mail/testuser1" + rlAssertGrep "To: testuser1" "/var/spool/mail/testuser1" + # DEBUG + echo "/var/log/cron:" + echo "**************" + cat /var/log/cron + rlAssertGrep "\(produced output\)" /var/log/cron + rlAssertNotGrep "not mailing" /var/log/cron -i + rlPhaseEnd + + # email should NOT be sent with empty MAILTO + rlPhaseStartTest noanacronmail-empty + rlRun "truncate --size 0 /var/spool/mail/root" 0 "Truncating mail queue for root" + rlRun "truncate --size 0 /var/log/cron" 0 "Truncating cron log" + rlRun "sed -i -e 's/MAILTO=testuser1/MAILTO=/' ${TestDir}/anacrontab" 0 "Removing mailto user from anacrontab" + # DEBUG + echo "anacrontab:" + echo "***********" + cat ${TestDir}/anacrontab + rlRun "anacron -f -n -d -t ${TestDir}/anacrontab" 0 "Forcing anacron to run job" + sleep 5 + # DEBUG + echo "/var/spool/mail/root:" + echo "*********************" + cat /var/spool/mail/root + rlAssertNotGrep "anacron" "/var/spool/mail/root" + # DEBUG + echo "/var/log/cron:" + echo "**************" + cat /var/log/cron + rlAssertGrep "\(produced output\)" /var/log/cron + rlAssertGrep "not mailing" /var/log/cron -i + rlPhaseEnd + + # email should be sent to nonexisting user double-doublequotes, as the string after '=' is treated literally + rlPhaseStartTest anacronmail-quotes + rlRun "truncate --size 0 /var/spool/mail/root" 0 "Truncating mail queue for root" + rlRun "truncate --size 0 /var/log/cron" 0 "Truncating cron log" + rlRun "sed -i -e 's/MAILTO=/MAILTO=\"\"/' ${TestDir}/anacrontab" 0 "Setting mailto to double quotes in anacrontab" + # DEBUG + echo "anacrontab:" + echo "***********" + cat ${TestDir}/anacrontab + rlRun "anacron -f -n -d -t ${TestDir}/anacrontab" 0 "Forcing anacron to run job" + sleep 5 + # DEBUG + echo "/var/spool/mail/root:" + echo "*********************" + cat /var/spool/mail/root + rlAssertGrep "anacron" "/var/spool/mail/root" + #rlAssertGrep "To: \"\"" "/var/spool/mail/root" + # ^ this doesn't work in Beaker for some reason, check the quotes in 'Received: ... for "";' + rlAssertGrep "for \"\"" "/var/spool/mail/root" + # DEBUG + echo "/var/log/cron:" + echo "**************" + cat /var/log/cron + rlAssertGrep "\(produced output\)" /var/log/cron + rlAssertNotGrep "not mailing" /var/log/cron -i + rlPhaseEnd + + # email should be sent to the user running anacron, when MAILTO is missing + rlPhaseStartTest anacronmail-missing + rlRun "truncate --size 0 /var/spool/mail/root" 0 "Truncating mail queue for root" + rlRun "truncate --size 0 /var/log/cron" 0 "Truncating cron log" + rlRun "sed -i -e '/MAILTO/d' ${TestDir}/anacrontab" 0 "Removing mailto from anacrontab" + # DEBUG + echo "anacrontab:" + echo "***********" + cat ${TestDir}/anacrontab + rlRun "anacron -f -n -d -t ${TestDir}/anacrontab" 0 "Forcing anacron to run job" + sleep 5 + # DEBUG + echo "/var/spool/mail/root:" + echo "*********************" + cat /var/spool/mail/root + rlAssertGrep "anacron" "/var/spool/mail/root" + # DEBUG + echo "/var/log/cron:" + echo "**************" + cat /var/log/cron + rlAssertGrep "\(produced output\)" /var/log/cron + rlAssertNotGrep "not mailing" /var/log/cron -i + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "userdel testuser1" + rlServiceRestore crond + rlFileRestore + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Make-crontab-a-PIE/Makefile b/tests/Make-crontab-a-PIE/Makefile new file mode 100644 index 0000000..43e6a94 --- /dev/null +++ b/tests/Make-crontab-a-PIE/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/Regression/Regression/Make-crontab-a-PIE +# Description: What the test does +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 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/Regression/Make-crontab-a-PIE +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: Jakub Prokes " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: What the test does" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Make-crontab-a-PIE/PURPOSE b/tests/Make-crontab-a-PIE/PURPOSE new file mode 100644 index 0000000..2d2bf11 --- /dev/null +++ b/tests/Make-crontab-a-PIE/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/Regression/Regression/Make-crontab-a-PIE +Description: What the test does +Author: Jakub Prokes diff --git a/tests/Make-crontab-a-PIE/runtest.sh b/tests/Make-crontab-a-PIE/runtest.sh new file mode 100644 index 0000000..b0341a1 --- /dev/null +++ b/tests/Make-crontab-a-PIE/runtest.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/Regression/Regression/Make-crontab-a-PIE +# Description: What the test does +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 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 Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGES="cronie vixie-cron" + +function myAssertRpms() { + rlRun "rpm -q $*" $((${#@}-1)) "One of required packages was found"; +} + + +rlJournalStart + rlPhaseStartSetup + myAssertRpms $PACKAGES + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "eu-readelf -h /usr/bin/crontab | grep -E 'Type:[[:space:]]+DYN[[:space:]]+\(Shared object file\)'" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/anacron-segfaults-with-certain-config-data-2/Makefile b/tests/anacron-segfaults-with-certain-config-data-2/Makefile new file mode 100644 index 0000000..4323b82 --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data-2/Makefile @@ -0,0 +1,62 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/anacron-segfaults-with-certain-config-data +# Description: try some invalid configs for anacron to check config parser +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 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/cronie/Regression/anacron-segfaults-with-certain-config-data-2 +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE configs + +.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: Jakub Prokes " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: try some invalid configs for anacron to check config parser" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/anacron-segfaults-with-certain-config-data-2/PURPOSE b/tests/anacron-segfaults-with-certain-config-data-2/PURPOSE new file mode 100644 index 0000000..6c8e9e2 --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data-2/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/cronie/Regression/anacron-segfaults-with-certain-config-data-2 +Description: try some invalid configs for anacron to check config parser +Author: Jakub Prokes diff --git a/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-01_1 b/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-01_1 new file mode 100644 index 0000000..3f10d0b --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-01_1 @@ -0,0 +1,16 @@ +# /etc/anacrontab: configuration file for anacron + +# See anacron(8) and anacrontab(5) for details. + +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +# the maximal random delay added to the base delay of the jobs +RANDOM_DELAY=45 +# the jobs will be started during the following hours only +START_HOURS_RANGE=0 + +#period in days delay in minutes job-identifier command +1 5 cron.daily nice run-parts /etc/cron.daily +7 25 cron.weekly nice run-parts /etc/cron.weekly +@monthly 45 cron.monthly nice run-parts /etc/cron.monthly diff --git a/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-02_0 b/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-02_0 new file mode 100644 index 0000000..fee29eb --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-02_0 @@ -0,0 +1,16 @@ +# /etc/anacrontab: configuration file for anacron + +# See anacron(8) and anacrontab(5) for details. + +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +# the maximal random delay added to the base delay of the jobs +RANDOM_DELAY=45 +# the jobs will be started during the following hours only +START_HOURS_RANGE=3-8 + +#period in days delay in minutes job-identifier command +1 5 cron.daily nice run-parts /etc/cron.daily +7 25 cron.weekly nice run-parts /etc/cron.weekly +@monthly 45 cron.monthly nice run-parts /etc/cron.monthly diff --git a/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-03_1 b/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-03_1 new file mode 100644 index 0000000..1767210 --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-03_1 @@ -0,0 +1,18 @@ +# /etc/anacrontab: configuration file for anacron + +# See anacron(8) and anacrontab(5) for details. + +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +# the maximal random delay added to the base delay of the jobs +RANDOM_DELAY=45 +VAR=8 +# the jobs will be started during the following hours only +START_HOURS_RANGE=3-$VAR +#START_HOURS_RANGE=0 + +#period in days delay in minutes job-identifier command +1 5 cron.daily nice run-parts /etc/cron.daily +7 25 cron.weekly nice run-parts /etc/cron.weekly +@monthly 45 cron.monthly nice run-parts /etc/cron.monthly diff --git a/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-04_1 b/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-04_1 new file mode 100644 index 0000000..504a7cb --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-04_1 @@ -0,0 +1,17 @@ +# /etc/anacrontab: configuration file for anacron + +# See anacron(8) and anacrontab(5) for details. + +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +# the maximal random delay added to the base delay of the jobs +RANDOM_DELAY=45 +%@$&=^^^^ +# the jobs will be started during the following hours only +START_HOURS_RANGE=%@$&=^^^^ + +#period in days delay in minutes job-identifier command +1 5 cron.daily nice run-parts /etc/cron.daily +7 25 cron.weekly nice run-parts /etc/cron.weekly +@monthly 45 cron.monthly nice run-parts /etc/cron.monthly diff --git a/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-05_1 b/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-05_1 new file mode 100644 index 0000000..c2d2b58 --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data-2/configs/scenario-05_1 @@ -0,0 +1,14 @@ +# /etc/anacrontab: configuration file for anacron + +# See anacron(8) and anacrontab(5) for details. + +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +# the maximal random delay added to the base delay of the jobs +RANDOM_DELAY=%@$&=^^^^ + +#period in days delay in minutes job-identifier command +1 5 cron.daily nice run-parts /etc/cron.daily +7 25 cron.weekly nice run-parts /etc/cron.weekly +@monthly 45 cron.monthly nice run-parts /etc/cron.monthly diff --git a/tests/anacron-segfaults-with-certain-config-data-2/runtest.sh b/tests/anacron-segfaults-with-certain-config-data-2/runtest.sh new file mode 100644 index 0000000..bf78c58 --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data-2/runtest.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/anacron-segfaults-with-certain-config-data-2 +# Description: try some invalid configs for anacron to check config parser +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 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 + +assertRpms() { + rlRun "rpm -q $*" 0-$((${#@}-1)) "One of required packages was found"; + RC=$?; + [[ $RC -lt ${#@} ]] && return 0; + return $RC; +} + +PACKAGES="${PACKAGES:-cronie vixie-cron}" + +rlJournalStart + rlPhaseStartSetup + assertRpms $PACKAGES + rlPhaseEnd + + rlPhaseStartTest + for scenario in ./configs/*; do + [[ ! -f $scenario ]] && rlFail "$scenario isn't regular file"; + ## File name has 'special' format: scenario-X_Y where X is scenario number and Y is expected + ## exit code. And of course there must be some issues related to RHEL 5 :-) + if rlIsRHEL 5; then + rlRun "anacron -f -u -d -t $(readlink -f $scenario)" 0 "Testing $(basename ${scenario%_[0-9]})"; + else + if rlRun "anacron -T -t $scenario;" ${scenario##*_} "Verifying $(basename ${scenario%_[0-9]})"; then + rlRun "anacron -f -u -d -t $scenario" 0 "Testing $(basename ${scenario%_[0-9]})"; + else + [[ $? -eq 139 ]] && cat $scenario; + fi + fi + done + rlPhaseEnd + + rlPhaseStartCleanup + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/anacron-segfaults-with-certain-config-data/Makefile b/tests/anacron-segfaults-with-certain-config-data/Makefile new file mode 100644 index 0000000..e4475ae --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data/Makefile @@ -0,0 +1,62 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/anacron-segfaults-with-certain-config-data +# Description: Test for anacron segfaults with certain config data +# Author: Robin Hack +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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/cronie/Regression/anacron-segfaults-with-certain-config-data +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE core.sh + +.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: Robin Hack " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for anacron segfaults with certain config data" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/anacron-segfaults-with-certain-config-data/PURPOSE b/tests/anacron-segfaults-with-certain-config-data/PURPOSE new file mode 100644 index 0000000..28d8f4b --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/cronie/Regression/anacron-segfaults-with-certain-config-data +Description: anacron segfaults with certain config data +Author: Robin Hack diff --git a/tests/anacron-segfaults-with-certain-config-data/core.sh b/tests/anacron-segfaults-with-certain-config-data/core.sh new file mode 100644 index 0000000..21c0cc9 --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data/core.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "$1" > /tmp/core.lock diff --git a/tests/anacron-segfaults-with-certain-config-data/runtest.sh b/tests/anacron-segfaults-with-certain-config-data/runtest.sh new file mode 100644 index 0000000..a2d784d --- /dev/null +++ b/tests/anacron-segfaults-with-certain-config-data/runtest.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/anacron-segfaults-with-certain-config-data +# Description: Test for anacron segfaults with certain config data +# Author: Robin Hack +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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="cronie" + +rlJournalStart + rlPhaseStartSetup "Set anacron" + rlAssertRpm $PACKAGE + TESTDIR="${PWD}" + + rlFileBackup "/etc/anacrontab" + + rlRun "echo 'START_HOURS_RANGE=0' > /etc/anacrontab" + + # Prepare coredump handler + rlServiceStop crond + rlRun "chmod +x ${TESTDIR}/core.sh" + + rlRun "cat /proc/sys/kernel/core_pattern > /tmp/core_pattern" + rlRun "echo \"|${TESTDIR}/core.sh %e\" > /proc/sys/kernel/core_pattern" + rlPhaseEnd + + rlPhaseStartTest + rlRun "anacron" + + rlRun "sleep 2" 0 "Wait for kernel" + + # Anacron segfaults + rlAssertNotExists "/tmp/core.lock" + if [ -s "/tmp/core.lock" ]; then + rlAssertNotGrep "anacron" "/tmp/core.lock" + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "cat /tmp/core_pattern > /proc/sys/kernel/core_pattern" + + rm -f /tmp/core.lock + rm -f /tmp/core_pattern + killall anacron + + rlFileRestore + rlServiceRestore crond + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/config-parsing-issue/Makefile b/tests/config-parsing-issue/Makefile new file mode 100644 index 0000000..894a5c3 --- /dev/null +++ b/tests/config-parsing-issue/Makefile @@ -0,0 +1,62 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/config-parsing-issue +# Description: Test for cronie-anacron-1.4.4-14.el6.x86_64 doesn't like +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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/cronie/Regression/config-parsing-issue +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: Jakub Prokes " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for cronie-anacron-1.4.4-14.el6.x86_64 doesn't like" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie-anacron" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/config-parsing-issue/PURPOSE b/tests/config-parsing-issue/PURPOSE new file mode 100644 index 0000000..fe80c7e --- /dev/null +++ b/tests/config-parsing-issue/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/cronie/Regression/config-parsing-issue +Description: Test for cronie-anacron-1.4.4-14.el6.x86_64 doesn't like +Author: Jakub Prokes +Bug summary: cronie-anacron-1.4.4-14.el6.x86_64 doesn't like its own /etc/anacrontab syntax diff --git a/tests/config-parsing-issue/runtest.sh b/tests/config-parsing-issue/runtest.sh new file mode 100644 index 0000000..d95adab --- /dev/null +++ b/tests/config-parsing-issue/runtest.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/config-parsing-issue +# Description: Test for cronie-anacron-1.4.4-14.el6.x86_64 doesn't like +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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="cronie-anacron" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "grep '^SHELL' /etc/anacrontab"; + rlRun "grep '^PATH' /etc/anacrontab"; + rlRun "grep '^MAILTO' /etc/anacrontab"; + rlPhaseEnd + + rlPhaseStartTest + rlRun "anacron -T" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/cron-daemon-fails-to-log-that-it-is-shutting-down/Makefile b/tests/cron-daemon-fails-to-log-that-it-is-shutting-down/Makefile new file mode 100644 index 0000000..c4d85ea --- /dev/null +++ b/tests/cron-daemon-fails-to-log-that-it-is-shutting-down/Makefile @@ -0,0 +1,62 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/cron-daemon-fails-to-log-that-it-is-shutting-down +# Description: Test for cron daemon fails to log that it is shutting down. +# Author: Robin Hack +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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/cronie/Regression/cron-daemon-fails-to-log-that-it-is-shutting-down +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: Robin Hack " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for cron daemon fails to log that it is shutting down." >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/cron-daemon-fails-to-log-that-it-is-shutting-down/PURPOSE b/tests/cron-daemon-fails-to-log-that-it-is-shutting-down/PURPOSE new file mode 100644 index 0000000..4b459e8 --- /dev/null +++ b/tests/cron-daemon-fails-to-log-that-it-is-shutting-down/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/cronie/Regression/cron-daemon-fails-to-log-that-it-is-shutting-down +Description: Test for cron daemon fails to log that it is shutting down. +Author: Robin Hack +Bug summary: cron daemon fails to log that it is shutting down. diff --git a/tests/cron-daemon-fails-to-log-that-it-is-shutting-down/runtest.sh b/tests/cron-daemon-fails-to-log-that-it-is-shutting-down/runtest.sh new file mode 100644 index 0000000..0aa147d --- /dev/null +++ b/tests/cron-daemon-fails-to-log-that-it-is-shutting-down/runtest.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/cron-daemon-fails-to-log-that-it-is-shutting-down +# Description: Test for cron daemon fails to log that it is shutting down. +# Author: Robin Hack +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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="cronie" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlServiceStop crond + rlPhaseEnd + + rlPhaseStartTest + start_time=$(timedatectl | grep "Local time" | awk '{print$4" "$5}') + rlServiceStart crond + sleep 20 + rlRun "journalctl --since \"$start_time\" | grep \"(CRON) INFO\"" 0 "cron startup" + rlServiceStop crond + # give dbus and cronie some time to shut down... + sleep 20 + rlRun "journalctl --since \"$start_time\" | grep \"(CRON) INFO (Shutting down)\"" 0 "cron shutdown" + # DEBUG + journalctl _COMM=cron --since="$start_time" + rlPhaseEnd + + rlPhaseStartCleanup + rlServiceRestore crond + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/crond-is-missing-RELRO-flags/Makefile b/tests/crond-is-missing-RELRO-flags/Makefile new file mode 100644 index 0000000..87a9651 --- /dev/null +++ b/tests/crond-is-missing-RELRO-flags/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/crond-is-missing-RELRO-flags +# Description: Test for crond is missing RELRO flags +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/cronie/Regression/crond-is-missing-RELRO-flags +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: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for crond is missing RELRO flags" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/crond-is-missing-RELRO-flags/PURPOSE b/tests/crond-is-missing-RELRO-flags/PURPOSE new file mode 100644 index 0000000..1ea8ffc --- /dev/null +++ b/tests/crond-is-missing-RELRO-flags/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/cronie/Regression/crond-is-missing-RELRO-flags +Description: Test for crond is missing RELRO flags +Author: Martin Cermak +Bug summary: crond is missing RELRO flags + diff --git a/tests/crond-is-missing-RELRO-flags/runtest.sh b/tests/crond-is-missing-RELRO-flags/runtest.sh new file mode 100644 index 0000000..c6b55df --- /dev/null +++ b/tests/crond-is-missing-RELRO-flags/runtest.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/crond-is-missing-RELRO-flags +# Description: Test for crond is missing RELRO flags +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="cronie" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest + rlRun "eu-readelf -l /usr/sbin/crond | fgrep -q 'GNU_RELRO'" 0 "Binary was compiled with RELRO." + rlPhaseEnd +rlJournalEnd diff --git a/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/Makefile b/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/Makefile new file mode 100644 index 0000000..729126c --- /dev/null +++ b/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/Makefile @@ -0,0 +1,62 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/crond-subtask-abnormal-termination-removes-pid-file-in-error +# Description: Test for crond subtask abnormal termination removes pid +# Author: Robin Hack +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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/cronie/Regression/crond-subtask-abnormal-termination-removes-pid-file-in-error +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE crontab-job run-job.sh + +.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: Robin Hack " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for crond subtask abnormal termination removes pid" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/PURPOSE b/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/PURPOSE new file mode 100644 index 0000000..3bc1db0 --- /dev/null +++ b/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/cronie/Regression/crond-subtask-abnormal-termination-removes-pid-file-in-error +Description: Test for crond subtask abnormal termination removes pid +Author: Robin Hack +Bug summary: crond subtask abnormal termination removes pid file in error diff --git a/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/crontab-job b/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/crontab-job new file mode 100644 index 0000000..390ab9b --- /dev/null +++ b/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/crontab-job @@ -0,0 +1 @@ +*/1 * * * * /tmp/run-job.sh diff --git a/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/run-job.sh b/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/run-job.sh new file mode 100644 index 0000000..265e8db --- /dev/null +++ b/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/run-job.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ -s /tmp/run-job.lock ]; then + exit 0 +fi + +echo $PPID > /tmp/run-job.lock +sleep 1234567 +exit 0 diff --git a/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/runtest.sh b/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/runtest.sh new file mode 100644 index 0000000..caaa895 --- /dev/null +++ b/tests/crond-subtask-abnormal-termination-removes-pid-file-in-error/runtest.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/crond-subtask-abnormal-termination-removes-pid-file-in-error +# Description: Test for crond subtask abnormal termination removes pid +# Author: Robin Hack +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 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="cronie" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + + rlRun "cp ./run-job.sh /tmp/" + rlRun "chmod +x /tmp/run-job.sh" + rm -f /tmp/run-job.lock + + rlServiceStop crond + rlServiceStart crond + rlRun "crontab -u root ./crontab-job" + rlRun "sleep 60" 0 "Wait for cron job to run" + rlPhaseEnd + + rlPhaseStartTest + if [ -s /var/run/crond.pid ]; then + rlPass "Crond pid file exists"; + else + rlFail "Cront pid file doesn't exists or is empty" + fi + + # /tmp/run-job.lock contains PPID of my job + rlRun "kill -SIGTERM $(cat /tmp/run-job.lock)" + + # Cut and pasta! Check file again! + # We love boiler plate code in our tests! + if [ -s /var/run/crond.pid ]; then + rlPass "Crond pid file exists"; + else + rlFail "Cront pid file doesn't exists or is empty" + fi + rlPhaseEnd + + rlPhaseStartCleanup + killall sleep + crontab -u root -r + rm -f /tmp/run-job.sh + rm -f /tmp/run-job.lock + + rlServiceStop crond + rlServiceRestore crond + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/cronie-jobs-environment/Makefile b/tests/cronie-jobs-environment/Makefile new file mode 100644 index 0000000..c2a43a8 --- /dev/null +++ b/tests/cronie-jobs-environment/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/cronie-jobs-environment +# Description: testing EUID with jobs are executed and if LANG is correctly set +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 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/cronie/Regression/cronie-jobs-environment +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE libfaketime-0.9.1.tar.gz crontab.temp cron_test.sh + +.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: Jakub Prokes " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: testing EUID with jobs are executed and if LANG is correctly set" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/cronie-jobs-environment/PURPOSE b/tests/cronie-jobs-environment/PURPOSE new file mode 100644 index 0000000..6ef4539 --- /dev/null +++ b/tests/cronie-jobs-environment/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/cronie/Regression/cronie-jobs-environment +Description: testing EUID with jobs are executed and if LANG is correctly set +Author: Jakub Prokes diff --git a/tests/cronie-jobs-environment/cron_test.sh b/tests/cronie-jobs-environment/cron_test.sh new file mode 100644 index 0000000..6a82d15 --- /dev/null +++ b/tests/cronie-jobs-environment/cron_test.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +printf "LANG=$LANG\n" > /tmp/cronie-jobs-environment.log; +printf "EUID=$EUID\n" >> /tmp/cronie-jobs-environment.log; + diff --git a/tests/cronie-jobs-environment/crontab.temp b/tests/cronie-jobs-environment/crontab.temp new file mode 100644 index 0000000..643879d --- /dev/null +++ b/tests/cronie-jobs-environment/crontab.temp @@ -0,0 +1,12 @@ +# Example of job definition: +# .---------------- minute (0 - 59) +# | .------------- hour (0 - 23) +# | | .---------- day of month (1 - 31) +# | | | .------- month (1 - 12) OR jan,feb,mar,apr ... +# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat +# | | | | | +# * * * * * command to be executed + +CRON_CORRECT_MAIL_HEADER=1 + +* * * * * %TMPDIR/cron_test.sh diff --git a/tests/cronie-jobs-environment/libfaketime-0.9.1.tar.gz b/tests/cronie-jobs-environment/libfaketime-0.9.1.tar.g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dk8N2_9#eK_mj4H0#6E#mw)9B&(j&?0kWzo9|jeHSct~^T$*9jB5tFiNf|};PvHSndSm?8{iwo6{mHRy`dapW~XHLDe7u6 z3F$GxI4U{NMoeV6vwd_Kpc4T%JQoi>ob+v?g=Nwu#)*<$N9iQOY7{eVs+agM$Q;SP?w12kydgr*g^Wxy}p!qZI z>&t`Y@qVL$_mJ8NPIq8NyKfG6&eZ9fv(uBtep&sD*FL%L(R|Fb4rD(GT{VUUk?5KAE5*e?AUgYFmY8DLCh-0+8;Y?+G5R zqB)VISzyduhn5R=Kz5|Dzpr)<8z;G--zg_?zE+T8!*%#Y+h&6Q^Z4_CKlAPX51Ri| zU4t)E_W!lD+N1sdA%5=a$0mPTU_EOoFCFf$bsEige^FdAkr(`1b9_v>VCmxb-e{rU t?1mRTZ{H2Bw}nlVFMdzC;vO#c^6}^K=ke$9=db+v{{Sd^qXYoh0RW$wa?t<) literal 0 HcmV?d00001 diff --git a/tests/cronie-jobs-environment/runtest.sh b/tests/cronie-jobs-environment/runtest.sh new file mode 100644 index 0000000..c6d83ac --- /dev/null +++ b/tests/cronie-jobs-environment/runtest.sh @@ -0,0 +1,124 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/cronie-jobs-environment +# Description: testing EUID with jobs are executed and if LANG is correctly set +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 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 Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + + +## Is nice to know when things going wrong +trap 'errorHandler ${LINENO}' ERR; +function errorHandler() { + local code="${?}"; + local lineNO="$1"; + + case $code in + 127) + rlFail "Command not found on line $lineNO" + ;; + *) + rlFail "Unhandled error $code near line $lineNO"; + ;; + esac +} + +function makeUser() { + local userName="$(tr -dc "[:lower:]" < /dev/urandom | head -c 5 | sed 's/^/qa_/')"; + while getent passwd $userName; do + userName="$(tr -dc "[:lower:]" < /dev/urandom | head -c 5 | sed 's/^/qa_/')"; + done + useradd -d $tmpDir $userName; + echo $userName; +} + + +PACKAGE="cronie" +declare -r LIBFAKETTIMEPACKAGE="libfaketime-0.9.1.tar.gz"; +declare -r LIBFAKETIME="libfaketime.so.1"; + +rlJournalStart + rlPhaseStartSetup "Setup test environment" + rlAssertRpm $PACKAGE + rlRun "tmpDir=\$(mktemp -d)" 0 "Creating tmp directory"; + testDir="$(pwd)"; + rlRun "chmod 755 $tmpDir" 0 "Setting permissions for tmp directory"; + ls -lahdZ $tmpDir; + rlRun "pushd $tmpDir" + testUser="$(makeUser)"; + rlRun "getent passwd $testUser" 0 "Test user $testUser created"; + rlServiceStop crond; + rlPhaseEnd + + rlPhaseStartSetup "Prepare libfaketime"; + rlRun "cp ${testDir}/$LIBFAKETTIMEPACKAGE ./" 0 "Get library sources"; + rlRun "tar -xvzf $LIBFAKETTIMEPACKAGE" 0 "Unpack library sources"; + pushd ${LIBFAKETTIMEPACKAGE%.tar.gz}; + rlRun "make &>/dev/null" 0 "Building library from sources"; + rlRun "cp ./src/$LIBFAKETIME ../" 0 "Coping library to working directory"; + popd; + LD_PRELOAD=./libfaketime.so.1 FAKETIME='1994-07-29 12:00:01' date +%G | { year="$(cat)"; [[ $year -eq 1994 ]]; }; + rlAssert0 "Library preloading working well" $?; + rlPhaseEnd + + rlPhaseStartSetup "Prepare tests"; + rlRun "sed 's#%TMPDIR#$tmpDir#' $testDir/crontab.temp > crontab.source" #0 "Crontab prepared from template"; + rlRun "crontab -u $testUser crontab.source" 0 "Set crontab for test user"; + crontab -lu $testUser; + rlRun "cp $testDir/cron_test.sh ./" 0 "Copyed script for cron job"; + rlRun "chmod a+x cron_test.sh" 0 "Permissions to executed set"; + rlRun "[[ -e /var/spool/mail/$testUser ]] && printf '' > /var/spool/mail/$testUser" 0 "Clean up mails" + rlLog "Execute crond with faked time"; + LD_PRELOAD=./libfaketime.so.1 FAKETIME='@1994-07-29 12:12:50' /usr/sbin/crond -n -x sch & + cronPID=$!; + pstree -Aph + rlRun "kill -0 $cronPID" 0 "crond is running"; + rlLog "Security timeout for 30 sec to ensure all configs are loaded and crontab is succesfully processed"; + sleep 30; + rlPhaseEnd + + rlPhaseStartTest "cronie drops \$LANG and never passes it on to jobs run" + rlRun "[[ $(sed -n '/^LANG/s/LANG=//p' /tmp/cronie-jobs-environment.log) = $LANG ]]" 0 "LANG is set" + rlPhaseEnd + + rlPhaseStartTest "cronie doesn't drop privileges before popen" + rlRun "[[ $(sed -n '/^EUID/s/EUID=//p' /tmp/cronie-jobs-environment.log) -eq $(id -u $testUser) ]]" 0 \ + "Crontab is executed with correct EUID"; + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "kill $cronPID" 0 "Terminating crond" + rlRun "crontab -ru $testUser" 0 "Crontab removed" + rlRun "popd" + rlRun "rm -r $tmpDir" 0 "Removing tmp directory" + rlRun "userdel -rf $testUser"; + rlServiceRestore crond; + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/crontab-can-invoke-lookup-for-nonexisted-user/Makefile b/tests/crontab-can-invoke-lookup-for-nonexisted-user/Makefile new file mode 100644 index 0000000..78b55ab --- /dev/null +++ b/tests/crontab-can-invoke-lookup-for-nonexisted-user/Makefile @@ -0,0 +1,62 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/crontab-can-invoke-lookup-for-nonexisted-user +# Description: Test for Cron does uid lookups for non-existent users +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/cronie/Regression/crontab-can-invoke-lookup-for-nonexisted-user +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: Jakub Prokes " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for Cron does uid lookups for non-existent users" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/crontab-can-invoke-lookup-for-nonexisted-user/PURPOSE b/tests/crontab-can-invoke-lookup-for-nonexisted-user/PURPOSE new file mode 100644 index 0000000..056f3fb --- /dev/null +++ b/tests/crontab-can-invoke-lookup-for-nonexisted-user/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/cronie/Regression/crontab-can-invoke-lookup-for-nonexisted-user +Description: Test for Cron does uid lookups for non-existent users +Author: Jakub Prokes +Bug summary: Cron does uid lookups for non-existent users diff --git a/tests/crontab-can-invoke-lookup-for-nonexisted-user/runtest.sh b/tests/crontab-can-invoke-lookup-for-nonexisted-user/runtest.sh new file mode 100644 index 0000000..7387dd1 --- /dev/null +++ b/tests/crontab-can-invoke-lookup-for-nonexisted-user/runtest.sh @@ -0,0 +1,102 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k ft=beakerlib +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/crontab-can-invoke-lookup-for-nonexisted-user +# Description: Test for Cron does uid lookups for non-existent users +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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="cronie" +declare -ri EXIT_FAILURE=1; +declare -ri EXIT_SUCCESS=0; +declare -r reportAllErrors=no; + +function isTrue() { + local string="$@"; + local oldOpt="shopt -p nocasematch"; + local -i rc=1; + + shopt -s nocasematch; + [[ -z "$string" ]] && return 1; + + case $string in + yes) rc=0;; + true) rc=0;; + ano) rc=0;; + 1) rc=0;; + jo) rc=0;; + yeah) rc=0;; + y) rc=0;; + a) rc=0;; + esac; + eval $oldOpt; + return $rc; +} + +## Is nice to know when things going wrong +function errorHandler() { + local code="${?}"; + local lineNO="$1"; + + case $code in + 127) + rlFail "Command not found on line $lineNO" + ;; + *) + isTrue $reportAllErrors && rlFail "Unhandled error $code near line $lineNO"; + ;; + esac +} + + +rlJournalStart + trap 'errorHandler ${LINENO}' ERR; + rlPhaseStart FAIL "Setup" + rlAssertRpm $PACKAGE; + rlRun "rlServiceStop 'crond'" + echo > /var/log/cron + rlRun "rlServiceStart 'crond'" + rlPhaseEnd + + rlPhaseStartTest + rlRun "sleep 61 | crontab -" & + sleep 5 + fileName="$(ls /var/spool/cron/ | grep 'tmp' | head -n 1)"; + ls -lah /var/spool/cron/; + rlRun "[[ -n '$fileName' ]]" 0 "$fileName found"; + rlRun "wait"; + rlRun "grep 'ORPHAN' /var/log/cron | grep '$fileName'" 1 ; + tail -n 20 /var/log/cron; + rlPhaseEnd + + rlPhaseStart WARN "Cleanup" + rlRun "rlServiceRestore 'crond'" + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd + rlJournalPrintText + trap - ERR; +rlJournalEnd diff --git a/tests/crontab-has-wrong-permissions/Makefile b/tests/crontab-has-wrong-permissions/Makefile new file mode 100644 index 0000000..fd02095 --- /dev/null +++ b/tests/crontab-has-wrong-permissions/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/crontab-has-wrong-permissions +# Description: What the test does +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 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/cronie/Regression/crontab-has-wrong-permissions +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) + 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: Jakub Prokes " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: What the test does" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/crontab-has-wrong-permissions/PURPOSE b/tests/crontab-has-wrong-permissions/PURPOSE new file mode 100644 index 0000000..61f54cb --- /dev/null +++ b/tests/crontab-has-wrong-permissions/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/cronie/Regression/crontab-has-wrong-permissions +Description: What the test does +Author: Jakub Prokes diff --git a/tests/crontab-has-wrong-permissions/runtest.sh b/tests/crontab-has-wrong-permissions/runtest.sh new file mode 100644 index 0000000..6a72dd2 --- /dev/null +++ b/tests/crontab-has-wrong-permissions/runtest.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/crontab-has-wrong-permissions +# Description: What the test does +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 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 Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGES="cronie vixie-cron" + +function myAssertRpms() { + rlRun "rpm -q $*" $((${#@}-1)) "One of required packages was found"; +} + + +rlJournalStart + rlPhaseStartSetup + myAssertRpms $PACKAGES + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "[[ $(stat /usr/bin/crontab -c \"%a\") -eq 4755 ]]" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/echos-OK-twice-in-init-script/Makefile b/tests/echos-OK-twice-in-init-script/Makefile new file mode 100644 index 0000000..dec6383 --- /dev/null +++ b/tests/echos-OK-twice-in-init-script/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/echos-OK-twice-in-init-script +# Description: Test for echos "OK" twice in init script +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/cronie/Regression/echos-OK-twice-in-init-script +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: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for echos \"OK\" twice in init script" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/echos-OK-twice-in-init-script/PURPOSE b/tests/echos-OK-twice-in-init-script/PURPOSE new file mode 100644 index 0000000..9a334d7 --- /dev/null +++ b/tests/echos-OK-twice-in-init-script/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/cronie/Regression/echos-OK-twice-in-init-script +Description: Test for echos "OK" twice in init script +Author: Martin Cermak + diff --git a/tests/echos-OK-twice-in-init-script/runtest.sh b/tests/echos-OK-twice-in-init-script/runtest.sh new file mode 100644 index 0000000..54afa80 --- /dev/null +++ b/tests/echos-OK-twice-in-init-script/runtest.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/echos-OK-twice-in-init-script +# Description: Test for echos "OK" twice in init script +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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="cronie" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TEMPDIR=\`mktemp -d\`" 0 "Creating tmp directory" + rlRun "pushd $TEMPDIR" + + rlFileBackup "/etc/rc.d/init.d/crond" + rlServiceStop crond + +cat > /etc/rc.d/init.d/functions2 <> $TEMPDIR/log.txt +} +EOF1 + rlRun "cat /etc/rc.d/init.d/functions2" + + sed -i "s/^\..*$/\0\n\. \/etc\/rc\.d\/init\.d\/functions2/" /etc/rc.d/init.d/crond + rlRun "grep ^\\\. /etc/rc.d/init.d/crond" + rlPhaseEnd + + rlPhaseStartTest + rlAssertNotExists log.txt + rlServiceStart crond + rlAssertExists log.txt + + rlRun "TIMES_PRINTED_OK=`grep OK log.txt | wc -l`" + rlRun "test $TIMES_PRINTED_OK -eq 1" + + rlServiceStop crond + rlPhaseEnd + + rlPhaseStartCleanup + rlBundleLogs TESTLOGS /etc/rc.d/init.d/functions2 /etc/rc.d/init.d/crond + rlRun "rm -f /etc/rc.d/init.d/functions2" + rlFileRestore + rlServiceRestore crond + rlRun "popd" + rlRun "rm -r $TEMPDIR" 0 "Removing tmp directory" + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd +rlJournalEnd diff --git a/tests/init-script-failure/Makefile b/tests/init-script-failure/Makefile new file mode 100644 index 0000000..49b556c --- /dev/null +++ b/tests/init-script-failure/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/init-script-failure +# Description: Testing some init script failures +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 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/cronie/Regression/init-script-failure +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: Jakub Prokes " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Testing some init script failures" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/init-script-failure/PURPOSE b/tests/init-script-failure/PURPOSE new file mode 100644 index 0000000..81de15d --- /dev/null +++ b/tests/init-script-failure/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/cronie/Regression/init-script-failure +Description: Testing some init script failures +Author: Jakub Prokes diff --git a/tests/init-script-failure/runtest.sh b/tests/init-script-failure/runtest.sh new file mode 100644 index 0000000..c0f6d02 --- /dev/null +++ b/tests/init-script-failure/runtest.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/init-script-failure +# Description: Testing some init script failures +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 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 Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="cronie" + +function makeUser() { + local userName="$(tr -dc "[:lower:]" < /dev/urandom | head -c 5 | sed 's/^/qa_/')"; + while getent passwd $userName; do + userName="$(tr -dc "[:lower:]" < /dev/urandom | head -c 5 | sed 's/^/qa_/')"; + done + useradd -d $tmpDir $userName; + echo $userName; +} + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlServiceStop crond + rlRun "tmpDir=\$(mktemp -d)" 0 "Creating tmp directory"; + testUser="$(makeUser)"; + rlPhaseEnd + + rlPhaseStartTest "Service restart needlessly reports failure" + rlRun -s "service crond restart" + rlAssertNotGrep "FAILED" $rlRun_LOG + rlPhaseEnd + + if ! rpm -q systemd &>/dev/null; then + rlPhaseStartTest "Check service restart exit code" + su -l $testUser -c "service crond restart"; + rlAssertEquals "Expected result of call initscript by unprivileged user is 4" $? 4 + rlPhaseEnd + fi + + rlPhaseStartCleanup + rm -f $rlRun_LOG + rm -rf $tmpDir; + userdel -rf $testUser; + rlServiceRestore crond + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/init-scripts-LSB/Makefile b/tests/init-scripts-LSB/Makefile new file mode 100644 index 0000000..712f909 --- /dev/null +++ b/tests/init-scripts-LSB/Makefile @@ -0,0 +1,62 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Sanity/init-script-LSB +# Description: Init script should meet LSB specifications +# Author: Yulia Kopkova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2009 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/cronie/Sanity/init-script-LSB +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: Petr Sklenar " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Init script should meet LSB specifications" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + rhts-lint $(METADATA) diff --git a/tests/init-scripts-LSB/PURPOSE b/tests/init-scripts-LSB/PURPOSE new file mode 100644 index 0000000..26efe1c --- /dev/null +++ b/tests/init-scripts-LSB/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/cronie/Sanity/init-script-LSB +Description: Init script should meet LSB specifications +Author: Yulia Kopkova diff --git a/tests/init-scripts-LSB/runtest.sh b/tests/init-scripts-LSB/runtest.sh new file mode 100644 index 0000000..7b72ea7 --- /dev/null +++ b/tests/init-scripts-LSB/runtest.sh @@ -0,0 +1,186 @@ +#!/bin/bash +# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Sanity/init-script-LSB +# Description: Init script should meet LSB specifications +# Author: Jan Scotka , Yulia Kopkova +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2009 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include rhts environment +. /usr/bin/rhts-environment.sh +. /usr/share/rhts-library/rhtslib.sh + +PACKAGE="cronie" + +SERVICE="crond"; +reportAllErrors=no; + +function isTrue() { + local string="$@"; + local oldOpt="shopt -p nocasematch"; + local -i rc=1; + + shopt -s nocasematch; + [[ -z "$string" ]] && return 1; + + case $string in + yes) rc=0;; + true) rc=0;; + ano) rc=0;; + 1) rc=0;; + jo) rc=0;; + yeah) rc=0;; + y) rc=0;; + a) rc=0;; + esac; + eval $oldOpt; + return $rc; +} + +isTrue no && echo Yes || echo No; + +## Is nice to know when things going wrong +function errorHandler() { + local code="${?}"; + local lineNO="$1"; + + case $code in + 127) + rlFail "Command not found on line $lineNO" + ;; + *) + isTrue $reportAllErrors && rlFail "Unhandled error $code near line $lineNO"; + ;; + esac +} + +function getUserName() { + local userName="qa_$(tr -dc "[:lower:]" < /dev/urandom | head -c 5)"; + echo "$userName" >&2;⏎ + if getent passwd $userName &>/dev/null; then + getUserName; + return $? + fi + if [[ -n "$userName" ]]; then + echo "$userName"; + return $EXIT_SUCCESS; + else + return $EXIT_FAILURE; + fi +} + + +rlJournalStart +trap 'errorHandler ${LINENO}' ERR; + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "tmpDir=\$(mktemp -d)" 0 "Creating tmp directory"; + testUser="$(getUserName || rlDie "Cannot get username")" + rlLog "${testUser}" + rlRun "useradd -d $tmpDir $testUser"; + pushd $tmpDir; + rlServiceStop $SERVICE + rlPhaseEnd + + rlPhaseStartTest "starts the service" + rlRun "service $SERVICE start" 0 " Service must start without problem" + rlRun "service $SERVICE status" 0 " Then Status command " + rlRun "service $SERVICE start" 0 " Already started service " + rlRun "service $SERVICE status" 0 " Again status command " + rlPhaseEnd + + rlPhaseStartTest "restart the service" + firstPid=$(ps h -C $SERVICE -o pid); + rlRun "service $SERVICE restart" 0 " Restarting of service" + rlRun "service $SERVICE status" 0 " Status command " + secondPid=$(ps h -C $SERVICE -o pid); + rlRun "[[ -n $firstPid ]] && [[ -n $secondPid ]] && [[ $firstPid -ne $secondPid ]]" 0 \ + "Pids are different after restart"; + rlPhaseEnd + + rlPhaseStartTest "stop the service" + rlRun "service $SERVICE stop" 0 " Stopping service " + rlRun "service $SERVICE status" 3 " Status of stopped service " || true + rlRun "service $SERVICE stop" 0 " Stopping service again " + rlRun "service $SERVICE status" 3 " Status of stopped service " || true + rlPhaseEnd + + if ! rlIsRHEL ">=7"; then + rlPhaseStartTest "pid file" + rlServiceStart $SERVICE + rlAssertExists "/var/run/$SERVICE.pid" "Pid file /var/run/$SERVICE.pid must exist" + sleep 1 + rlRun "kill -9 `pidof crond`" 0 "Kill $SERVICE" + sleep 10 + rlRun "service $SERVICE status" 1 " Existing pid file, but service not started " || true; + sleep 1 + rlRun "rm -fv /var/run/$SERVICE.pid" 0 "Remove .pid file" + rlPhaseEnd + + rlPhaseStartTest "lock file" + rlAssertExists "/var/lock/subsys/$SERVICE" "Lock file /var/lock/subsys/$SERVICE must exist" + rlRun "service $SERVICE status" 2 " Existing lock file, but service not started " || true; + rlServiceStop $SERVICE + rlPhaseEnd + fi + + rlPhaseStartTest "insufficient rights" + rlRun "service $SERVICE start " 0 " Starting service for restarting under nonpriv user " + rlRun "su $testUser -c 'service $SERVICE restart'" \ + $(rpm -q systemd &>/dev/null && echo 1 || echo 4) \ + "Insufficient rights, restarting service under nonprivileged user must fail"; + rlPhaseEnd + + rlPhaseStartTest "operations" + rlRun "service $SERVICE start" 0 " Service have to implement start function " + rlRun "service $SERVICE restart" 0 " Service have to implement restart function " + rlRun "service $SERVICE status" 0 " Service have to implement status function " + rlRun "service $SERVICE reload" 0 " Service have to implement reload function " + rlRun "service $SERVICE force-reload" 0 " Service have to implement force-reload function " + rlRun "service $SERVICE condrestart" 0 " Service have to implement condrestart function " + if ! rlIsRHEL ">=7"; then + rlRun "service $SERVICE try-restart" 0 " Service have to implement try-restart function " + fi + rlPhaseEnd + + rlPhaseStartTest "nonexisting operations" + rlRun "service $SERVICE noexistop" 2 " Testing proper return code when nonexisting function"; + rlRun "service $SERVICE stopex" 2 " Testing proper return code when nonexisting function"; + rlRun "service $SERVICE foo" 2 " Testing proper return code when nonexisting function" || true + rlPhaseEnd + + rlPhaseEnd + + rlPhaseStartCleanup + rlServiceRestore $SERVICE + rlRun "getent passwd $testUser"; + popd tmpDir; + rlRun "userdel -fr $testUser" 0 "Remove test user"; +# rlRun "rm -rf $testDir"; + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd + +rlJournalPrintText +trap - ERR; +rlJournalEnd diff --git a/tests/ldap-users/Makefile b/tests/ldap-users/Makefile new file mode 100644 index 0000000..e1967a1 --- /dev/null +++ b/tests/ldap-users/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/ldap-users +# Description: Test for cronie not creating jobs for ldap users if ldap +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/cronie/Regression/ldap-users +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE data.ldif slapd.conf user1.cron + +.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: Jakub Prokes " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for cronie not creating jobs for ldap users if ldap" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: cronie openldap" >> $(METADATA) + @echo "Requires: cronie authconfig openldap openldap-servers openldap-clients sssd sssd-ldap" >> $(METADATA) + @echo "RhtsRequires: library(authconfig/basic)" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/ldap-users/PURPOSE b/tests/ldap-users/PURPOSE new file mode 100644 index 0000000..786822b --- /dev/null +++ b/tests/ldap-users/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/cronie/Regression/ldap-users +Description: Test for cronie not creating jobs for ldap users if ldap +Author: Jakub Prokes +Bug summary: cronie not creating jobs for ldap users if ldap server is temporarily down. + diff --git a/tests/ldap-users/data.ldif b/tests/ldap-users/data.ldif new file mode 100644 index 0000000..9d8836a --- /dev/null +++ b/tests/ldap-users/data.ldif @@ -0,0 +1,26 @@ +dn: dc=foo,dc=bar,dc=com +dc: foo +objectClass: top +objectClass: domain + +dn: ou=people,dc=foo,dc=bar,dc=com +ou: people +objectClass: top +objectClass: organizationalUnit + +dn: uid=user1,ou=people,dc=foo,dc=bar,dc=com +uid: user1 +cn: user1 +objectClass: account +objectClass: posixAccount +objectClass: top +objectClass: shadowAccount +userPassword: {CRYPT}hebc0ErNA0uXY +shadowLastChange: 14460 +shadowMax: 99999 +shadowWarning: 7 +loginShell: /bin/bash +uidNumber: 1001 +gidNumber: 1000 +homeDirectory: /home/ldap/user1 +gecos: user1 diff --git a/tests/ldap-users/runtest.sh b/tests/ldap-users/runtest.sh new file mode 100644 index 0000000..4de269b --- /dev/null +++ b/tests/ldap-users/runtest.sh @@ -0,0 +1,133 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/ldap-users +# Description: Test for cronie not creating jobs for ldap users if ldap +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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="cronie" + +rlJournalStart + rlPhaseStart FAIL "General Setup" + rlAssertRpm $PACKAGE + rlRun "tmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "testDir=\"$(pwd)\"" + rlRun "pushd $tmpDir" + rlRun "rlImport --all" + rlServiceStart "crond" + rlFileBackup /var/log/cron + echo > /var/log/cron + /bin/kill -HUP $(cat /var/run/syslogd.pid) + rlRun "getent passwd user1" 2 + rlPhaseEnd + + rlPhaseStart FAIL "LDAP Server Setup" + rlServiceStop "slapd" + rlFileBackup --clean "/etc/openldap" + rlFileBackup --clean "/var/run/openldap" + rlFileBackup --clean "/var/lib/ldap" + rlRun "rm -rf /etc/openldap/slapd.d/* /var/lib/ldap/* /var/run/openldap/*" 0 "Cleaning LDAP directories" + rlRun "slapadd -l ${testDir}/data.ldif -f ${testDir}/slapd.conf" 0 "Importing testing user into LDAP" + rlRun "chown ldap:ldap /var/run/openldap/*" 0 "Fixing permissions on '/var/run/openldap/*'" + rlRun "restorecon -Rv /etc/" 0 "Fixing SELinux contexts" + rlRun "slaptest -f ${testDir}/slapd.conf -F /etc/openldap/slapd.d" 0 "Importing LDAP configuration" + rlRun "chown -R ldap:ldap /etc/openldap/slapd.d" 0 "Fixing permissions on '/etc/openldap/slapd.d'" + rlServiceStart "slapd" + rlPhaseEnd + + rlPhaseStart FAIL "LDAP auth setup" + rlServiceStop "sssd" + rlRun "authconfig_setup" + rlRun "authconfig --savebackup=CoreOS_cronie_Regression_ldap-users" + rlRun "authconfig --enableldap --enableldapauth --ldapserver=ldap://127.0.0.1/ \ + --ldapbasedn=dc=foo,dc=bar,dc=com --update" + rlRun "getent passwd user1" + rlRun "mkdir -p /home/ldap/user1" + rlRun "chown user1 /home/ldap/user1" + rlPhaseEnd + + rlPhaseStartTest + rlRun "su user1 -c 'crontab ${testDir}/user1.cron'" 0 "Creating user cronjob" && \ + cat ${testDir}/user1.cron; + rlFileBackup /etc/crontab + rlRun "rlServiceStop slapd" + rlRun "service sssd stop" + rlRun "rm -rf /var/lib/sss/db/*" + rlRun "service sssd start" + rlRun "getent passwd user1" 2 + rlRun "echo \"* * * * * user1 /bin/echo foo > /tmp/cron.out\" > /etc/crontab" 0 \ + "Create record in system crontab" + cat /etc/crontab + rlRun "service crond restart" + rlRun "rlServiceStart slapd" + rlRun "service sssd stop" + rlRun "rm -rf /var/lib/sss/db/*" + rlRun "service sssd start" + waitCounter=60; + echo "Waiting for LDAP" + while ! getent passwd user1; do + sleep 1; + echo -n . + [[ waitCounter -le 0 ]] && break; + waitCounter=$((waitCounter-1)); + done + echo; + rlRun "getent passwd user1" + rm -f /home/ldap/user1/cron.out + echo "Waiting for cronjob execution" + sleep 65; + if rlRun "[[ -f /home/ldap/user1/cron.out ]]" 0 "User cronjob executed successfully"; then + rlAssertGrep "foo" /home/ldap/user1/cron.out; + fi + if rlRun "[[ -f /tmp/cron.out ]]" 0 "Crontab cronjob executed successfully"; then + rlAssertGrep "foo" /tmp/cron.out; + fi + rlRun "service crond stop" + cat /var/log/cron + rlPhaseEnd + + rlPhaseStart WARN "Cleanup" + rlRun "service crond restart" + rlRun "crontab -r -u user1" + rlRun "rlServiceStop slapd" + rlRun "authconfig --disableldap --disableldapauth --update" + rlRun "authconfig --restorebackup=CoreOS_cronie_Regression_ldap-users" + rlRun "authconfig_cleanup" + rlRun "popd" + rlRun "rm -r $tmpDir" 0 "Removing tmp directory" + rlRun "rm -r /home/ldap/user1" + rlRun "rm -r /home/ldap" + rlFileRestore + rlServiceRestore slapd + rlServiceRestore sssd + /bin/kill -HUP $(cat /var/run/syslogd.pid) + rlServiceRestore crond + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/ldap-users/slapd.conf b/tests/ldap-users/slapd.conf new file mode 100644 index 0000000..97b3c2d --- /dev/null +++ b/tests/ldap-users/slapd.conf @@ -0,0 +1,32 @@ +include /etc/openldap/schema/core.schema +include /etc/openldap/schema/cosine.schema +include /etc/openldap/schema/inetorgperson.schema +include /etc/openldap/schema/nis.schema + +allow bind_v2 + +pidfile /var/run/openldap/slapd.pid +argsfile /var/run/openldap/slapd.args + +database bdb +suffix "dc=foo,dc=bar,dc=com" +rootdn "cn=admin,dc=foo,dc=bar,dc=com" + +# Password is 'x'. +rootpw {SSHA}GPhzu7pTYP4I+nGeujpBkODiPxX0v8n8 + +directory /var/run/openldap/ + +index objectClass eq,pres +index ou,cn,mail,surname,givenname eq,pres,sub +index uidNumber,gidNumber,loginShell eq,pres +index uid,memberUid eq,pres,sub +index nisMapName,nisMapEntry eq,pres,sub +index entryCSN,entryUUID eq + +access to attrs=shadowLastChange,userPassword + by self write + by * auth + +access to * + by * read diff --git a/tests/ldap-users/user1.cron b/tests/ldap-users/user1.cron new file mode 100644 index 0000000..20d07a4 --- /dev/null +++ b/tests/ldap-users/user1.cron @@ -0,0 +1,10 @@ +# Example of job definition: +# .---------------- minute (0 - 59) +# | .------------- hour (0 - 23) +# | | .---------- day of month (1 - 31) +# | | | .------- month (1 - 12) OR jan,feb,mar,apr ... +# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat +# | | | | | +# * * * * * command to be executed + + * * * * * /bin/echo foo > $HOME/cron.out diff --git a/tests/only-one-running-instance-in-time/Makefile b/tests/only-one-running-instance-in-time/Makefile new file mode 100644 index 0000000..25272de --- /dev/null +++ b/tests/only-one-running-instance-in-time/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/only-one-running-instance-in-time +# Description: When crond is running in multiple instance, then cron jobs are executed multiple times. Is neccesary to prevent multiple instances of crond running in time. +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 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/cronie/Regression/only-one-running-instance-in-time +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: Jakub Prokes " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: When crond is running in multiple instance, then cron jobs are executed multiple times. Is neccesary to prevent multiple instances of crond running in time." >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/only-one-running-instance-in-time/PURPOSE b/tests/only-one-running-instance-in-time/PURPOSE new file mode 100644 index 0000000..7928fc9 --- /dev/null +++ b/tests/only-one-running-instance-in-time/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /CoreOS/cronie/Regression/only-one-running-instance-in-time +Description: When crond is running in multiple instance, then cron jobs are executed multiple times. Is neccesary to prevent multiple instances of crond running in time. +Author: Jakub Prokes diff --git a/tests/only-one-running-instance-in-time/runtest.sh b/tests/only-one-running-instance-in-time/runtest.sh new file mode 100644 index 0000000..7d7e8cb --- /dev/null +++ b/tests/only-one-running-instance-in-time/runtest.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/only-one-running-instance-in-time +# Description: When crond is running in multiple instance, then cron jobs are executed multiple times. Is neccesary to prevent multiple instances of crond running in time. +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 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 Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="cronie" + +rlJournalStart + rlPhaseStartSetup + rlServiceStart crond + rlPhaseEnd + + rlPhaseStartTest + rlRun "kill -0 $(cat /var/run/crond.pid)" 0 "Service crond is running"; + rlRun "/usr/sbin/crond" 1 "Executing another instance fail"; + rlAssertEquals "There is stil one instance of crond" $(ps h -C crond -o pid | wc -l) 1; + rlPhaseEnd + + rlPhaseStartCleanup + rlServiceRestore crond + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/run-with-syslog-flag/Makefile b/tests/run-with-syslog-flag/Makefile new file mode 100644 index 0000000..bc16c08 --- /dev/null +++ b/tests/run-with-syslog-flag/Makefile @@ -0,0 +1,62 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/run-with-syslog-flag +# Description: Test for cronie has a bug when run with syslog flag +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/cronie/Regression/run-with-syslog-flag +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: Jakub Prokes " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for cronie has a bug when run with syslog flag" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie rsyslog" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/run-with-syslog-flag/PURPOSE b/tests/run-with-syslog-flag/PURPOSE new file mode 100644 index 0000000..bd80d4b --- /dev/null +++ b/tests/run-with-syslog-flag/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/cronie/Regression/run-with-syslog-flag +Description: Test for cronie has a bug when run with syslog flag +Author: Jakub Prokes +Bug summary: cronie has a bug when run with syslog flag diff --git a/tests/run-with-syslog-flag/runtest.sh b/tests/run-with-syslog-flag/runtest.sh new file mode 100644 index 0000000..1770208 --- /dev/null +++ b/tests/run-with-syslog-flag/runtest.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/run-with-syslog-flag +# Description: Test for cronie has a bug when run with syslog flag +# Author: Jakub Prokes +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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="cronie" +declare -r sysConfig="/etc/sysconfig/crond"; +declare -r cronJobFile=/etc/cron.d/testjob + +rlJournalStart + rlPhaseStart FAIL "Setup" + ## nasty hack for journalctl + export PAGER="" + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlServiceStart rsyslog + rlPhaseEnd + + rlPhaseStartTest + rlFileBackup ${sysConfig}; + crondOpts="$(sed -n '/^\s*CRONDARGS/s/^\s*CRONDARGS\s*=//p' ${sysConfig})"; + rlLog "Old CRONDARGS=\"${crondOpts}\""; + if echo "$crondOpts" | grep '"'; then + ## strip trailing quotes + crondOpts="$(echo "$crondOpts" | sed 's/\(^"\)\|\("$\)//g')"; + fi + crondOpts="$crondOpts -s -m off"; + rlLog "New CRONDARGS=\"${crondOpts}\""; + echo "CRONDARGS=\"${crondOpts}\"" > ${sysConfig}; + phrase="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 32)"; + echo "* * * * * root /bin/echo $phrase" > ${cronJobFile}; + cp /var/log/cron ./oldLog; + [[ -f ./oldLog ]] || touch ./oldLog; + rlServiceStop crond; + sleep 1 + rlServiceStart crond; + sleep 65; + rlRun "diff ./oldLog /var/log/cron |grep -v '/bin/echo' \ + | grep '$phrase'" 0 "Output is logged correctly." \ + || rlLog "$(tail -n 5 /var/log/cron)" + rlPhaseEnd + + rlPhaseStart WARN "Cleanup" + rlRun "rm ${cronJobFile}"; + rlFileRestore; + rlRun "rlServiceRestore crond"; + rlServiceRestore rsyslog + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + #avoid systemd failing to start crond due start-limit + sleep 10 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..2b58b01 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,62 @@ +--- +# Tests to run in a classic environment +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + tests: + - anacron-segfaults-with-certain-config-data + - anacron-segfaults-with-certain-config-data-2 + - Can-t-remove-crontab-from-expired-accounts + - Cron-does-uid-lookups-for-non-existent-users + - cron-daemon-fails-to-log-that-it-is-shutting-down + - crond-is-missing-RELRO-flags + - crond-subtask-abnormal-termination-removes-pid-file-in-error + - config-parsing-issue + - cronie-jobs-environment + - crontab-can-invoke-lookup-for-nonexisted-user + - crontab-has-wrong-permissions +# - echos-OK-twice-in-init-script Does not work on Fedora-26 + - init-script-failure +# - init-scripts-LSB Does not work on Fedora-26 +# - ldap-users Does not work on Fedora-26 +# - MAILTO-problem-with-anacron Does not work on Fedora-26 + - Make-crontab-a-PIE + - only-one-running-instance-in-time + - run-with-syslog-flag + - usr-bin-crontab-has-wrong-permissions + required_packages: + - authconfig # ldap-users needs this package + - findutils # beakerlib needs find command + - elfutils # crond-is-missing-RELRO-flags needs eu-readelf tool + - gcc # cronie-jobs-environment needs gcc command + - openldap # ldap-users needs this package + - openldap-servers # ldap-users needs this package + - openldap-clients # ldap-users needs this package + - procps-ng # multiple tests need ps and pidof commands + - psmisc # multiple tests need killall command + - rsyslog # run-with-syslog-flag requires this package + - sendmail # MAILTO-problem-with-anacron needs sendmail command + - sssd # ldap-users needs this package + - sssd-ldap # ldap-users needs this package + +# Tests to run in a container environment +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - container + tests: + - Can-t-remove-crontab-from-expired-accounts + - Make-crontab-a-PIE + - config-parsing-issue + - crond-is-missing-RELRO-flags + - crontab-has-wrong-permissions + - usr-bin-crontab-has-wrong-permissions + required_packages: + - cronie # everything needs cronie package + - findutils # beakerlib needs find command + - procps-ng # multiple tests need ps and pidof commands + - psmisc # multiple tests need killall command + - elfutils # multiple tests need eu-readelf tool diff --git a/tests/usr-bin-crontab-has-wrong-permissions/Makefile b/tests/usr-bin-crontab-has-wrong-permissions/Makefile new file mode 100644 index 0000000..f76a672 --- /dev/null +++ b/tests/usr-bin-crontab-has-wrong-permissions/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/cronie/Regression/usr-bin-crontab-has-wrong-permissions +# Description: Test for /usr/bin/crontab has wrong permissions +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/cronie/Regression/usr-bin-crontab-has-wrong-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) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for /usr/bin/crontab has wrong permissions" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: cronie" >> $(METADATA) + @echo "Requires: cronie" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/usr-bin-crontab-has-wrong-permissions/PURPOSE b/tests/usr-bin-crontab-has-wrong-permissions/PURPOSE new file mode 100644 index 0000000..fb2bd73 --- /dev/null +++ b/tests/usr-bin-crontab-has-wrong-permissions/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/cronie/Regression/usr-bin-crontab-has-wrong-permissions +Description: Test for /usr/bin/crontab has wrong permissions +Author: Martin Cermak +Bug summary: /usr/bin/crontab has wrong permissions + diff --git a/tests/usr-bin-crontab-has-wrong-permissions/runtest.sh b/tests/usr-bin-crontab-has-wrong-permissions/runtest.sh new file mode 100644 index 0000000..5540876 --- /dev/null +++ b/tests/usr-bin-crontab-has-wrong-permissions/runtest.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/cronie/Regression/usr-bin-crontab-has-wrong-permissions +# Description: Test for /usr/bin/crontab has wrong permissions +# Author: Martin Cermak +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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="cronie" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest + rlRun "test `stat -c %a /usr/bin/crontab` -eq 4755" + rlPhaseEnd +rlJournalEnd +rlJournalPrintText