| 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 tidy of submits of previous runs. |
| 19 |
export REQUIRE_PLATFORM='loc:remote' |
| 20 |
. "$(dirname "$0")/test_header" |
| 21 |
set_test_number 11 |
| 22 |
|
| 23 |
install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" |
| 24 |
run_ok "${TEST_NAME_BASE}-validate" \ |
| 25 |
cylc validate "${WORKFLOW_NAME}" \ |
| 26 |
-s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'" |
| 27 |
workflow_run_ok "${TEST_NAME_BASE}-run" \ |
| 28 |
cylc play --debug --no-detach --reference-test "${WORKFLOW_NAME}" \ |
| 29 |
-s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'" |
| 30 |
RLOGD1="cylc-run/${WORKFLOW_NAME}/log/job/1/t1/01" |
| 31 |
RLOGD2="cylc-run/${WORKFLOW_NAME}/log/job/1/t1/02" |
| 32 |
LOGD1="${RUN_DIR}/${WORKFLOW_NAME}/log/job/1/t1/01" |
| 33 |
LOGD2="${RUN_DIR}/${WORKFLOW_NAME}/log/job/1/t1/02" |
| 34 |
|
| 35 |
SSH='ssh -n -oBatchMode=yes -oConnectTimeout=5' |
| 36 |
# shellcheck disable=SC2086 |
| 37 |
run_ok "exists-rlogd1" ${SSH} "${CYLC_TEST_HOST}" test -e "${RLOGD1}" |
| 38 |
# shellcheck disable=SC2086 |
| 39 |
run_ok "exists-rlogd2" ${SSH} "${CYLC_TEST_HOST}" test -e "${RLOGD2}" |
| 40 |
|
| 41 |
exists_ok "${LOGD1}" |
| 42 |
exists_ok "${LOGD2}" |
| 43 |
|
| 44 |
sed -i 's/script =.*$/script = true/' "${RUN_DIR}/${WORKFLOW_NAME}/flow.cylc" |
| 45 |
sed -i -n '1,/triggered off/p' "${RUN_DIR}/${WORKFLOW_NAME}/reference.log" |
| 46 |
|
| 47 |
delete_db |
| 48 |
workflow_run_ok "${TEST_NAME_BASE}-run" \ |
| 49 |
cylc play --debug --no-detach --reference-test "${WORKFLOW_NAME}" \ |
| 50 |
-s "CYLC_TEST_PLATFORM='${CYLC_TEST_PLATFORM}'" |
| 51 |
# shellcheck disable=SC2086 |
| 52 |
run_ok "exists-rlogd1" ${SSH} "${CYLC_TEST_HOST}" test -e "${RLOGD1}" |
| 53 |
# shellcheck disable=SC2086 |
| 54 |
run_fail "not-exists-rlogd2" ${SSH} "${CYLC_TEST_HOST}" test -e "${RLOGD2}" |
| 55 |
|
| 56 |
exists_ok "${LOGD1}" |
| 57 |
exists_fail "${LOGD2}" |
| 58 |
#------------------------------------------------------------------------------- |
| 59 |
purge |
| 60 |
exit |