| 1 |
#!/usr/bin/env bash |
| 2 |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. |
| 3 |
# Copyright (C) NIWA & British Crown (Met Office) & Contributors. |
| 4 |
# |
| 5 |
# This program is free software: you can redistribute it and/or modify |
| 6 |
# it under the terms of the GNU General Public License as published by |
| 7 |
# the Free Software Foundation, either version 3 of the License, or |
| 8 |
# (at your option) any later version. |
| 9 |
# |
| 10 |
# This program is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
# GNU General Public License for more details. |
| 14 |
# |
| 15 |
# You should have received a copy of the GNU General Public License |
| 16 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
#------------------------------------------------------------------------------- |
| 18 |
# Test whether job vacation trap is included in a loadleveler job or not. |
| 19 |
# A job for a task with the restart=yes directive will have the trap. |
| 20 |
# This does not test loadleveler job vacation itself, because the test will |
| 21 |
# require a site admin to pre-empt a job. |
| 22 |
# TODO Check this test on a dockerized system or VM. |
| 23 |
export REQUIRE_PLATFORM="runner:loadleveler" |
| 24 |
. "$(dirname "$0")/test_header" |
| 25 |
#------------------------------------------------------------------------------- |
| 26 |
set_test_number 6 |
| 27 |
install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" |
| 28 |
#------------------------------------------------------------------------------- |
| 29 |
TEST_NAME="${TEST_NAME_BASE}-validate" |
| 30 |
run_ok "${TEST_NAME}" cylc validate "${WORKFLOW_NAME}" |
| 31 |
#------------------------------------------------------------------------------- |
| 32 |
TEST_NAME="${TEST_NAME_BASE}-run" |
| 33 |
run_ok "${TEST_NAME}" cylc play --reference-test --debug --no-detach "${WORKFLOW_NAME}" |
| 34 |
sleep 5 |
| 35 |
#------------------------------------------------------------------------------- |
| 36 |
TEST_NAME="${TEST_NAME_BASE}-t1.1" |
| 37 |
T1_JOB_FILE="${WORKFLOW_RUN_DIR}/log/job/1/t1/01/job" |
| 38 |
exists_ok "${T1_JOB_FILE}" |
| 39 |
run_fail "${TEST_NAME}" grep -q -e '^CYLC_VACATION_SIGNALS' "${T1_JOB_FILE}" |
| 40 |
#------------------------------------------------------------------------------- |
| 41 |
TEST_NAME="${TEST_NAME_BASE}-t2.1" |
| 42 |
T2_JOB_FILE="${WORKFLOW_RUN_DIR}/log/job/1/t2/01/job" |
| 43 |
exists_ok "${T2_JOB_FILE}" |
| 44 |
grep_ok '^CYLC_VACATION_SIGNALS' "${T2_JOB_FILE}" |
| 45 |
#------------------------------------------------------------------------------- |
| 46 |
purge |
| 47 |
exit |