| 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 poll PBS connection refused |
| 19 |
export REQUIRE_PLATFORM="runner:pbs" |
| 20 |
. "$(dirname "$0")/test_header" |
| 21 |
|
| 22 |
set_test_number 4 |
| 23 |
|
| 24 |
create_test_global_config "" " |
| 25 |
[platforms] |
| 26 |
[[${CYLC_TEST_PLATFORM}]] |
| 27 |
job runner = my_pbs |
| 28 |
hosts = ${CYLC_TEST_BATCH_TASK_HOST} |
| 29 |
" |
| 30 |
|
| 31 |
install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" |
| 32 |
if [[ "${CYLC_TEST_HOST}" != 'localhost' ]]; then |
| 33 |
# shellcheck disable=SC2029 |
| 34 |
ssh -n "${CYLC_TEST_HOST}" "mkdir -p 'cylc-run/${WORKFLOW_NAME}/'" |
| 35 |
rsync -a 'lib' "${CYLC_TEST_HOST}:cylc-run/${WORKFLOW_NAME}/" |
| 36 |
fi |
| 37 |
|
| 38 |
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}" |
| 39 |
workflow_run_ok "${TEST_NAME_BASE}-run" \ |
| 40 |
cylc play --reference-test --debug --no-detach "${WORKFLOW_NAME}" |
| 41 |
# ssh security warnings may appear between outputs => check separately too. |
| 42 |
sed -n 's/^.*\(\[jobs-poll err\]\) \(Connection refused\).*$/\1\n\2/p; |
| 43 |
s/^.*\(\[jobs-poll err\]\).*$/\1/p; |
| 44 |
s/^.*\(Connection refused\).*$/\1/p; |
| 45 |
s/^.*\(INFO - \[1/t1\] status=running: (polled)started\).*$/\1/p' \ |
| 46 |
"${WORKFLOW_RUN_DIR}/log/scheduler/log" >'sed-log.out' |
| 47 |
contains_ok 'sed-log.out' <<'__LOG__' |
| 48 |
[jobs-poll err] |
| 49 |
Connection refused |
| 50 |
__LOG__ |
| 51 |
contains_ok 'sed-log.out' <<'__LOG__' |
| 52 |
INFO - [1/t1] status=running: (polled)started |
| 53 |
__LOG__ |
| 54 |
|
| 55 |
purge |
| 56 |
exit |