Debian Codegraph @

tests/f/intelligent-host-selection/07-cylc7-badhost.t

raw
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 task does not run on localhost if Cylc 7 syntax
19 # [runtime][<task>][remote]host is unreachable -
20 # https://github.com/cylc/cylc-flow/issues/4569
21
22 . "$(dirname "$0")/test_header"
23 set_test_number 4
24
25 # Host name picked for unlikelihood of matching any real host
26 BAD_HOST="f65b965bb914"
27
28 create_test_global_config "" "
29 [platforms]
30 [[badhostplatform]]
31 hosts = ${BAD_HOST}
32 "
33
34 init_workflow "${TEST_NAME_BASE}" << __FLOW__
35 [scheduler]
36 [[events]]
37 stall timeout = PT0M
38 abort on stall timeout = True
39 [scheduling]
40 cycling mode = integer
41 [[graph]]
42 R1 = sattler
43 [runtime]
44 [[sattler]]
45 [[[remote]]]
46 host = ${BAD_HOST}
47 __FLOW__
48
49 run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"
50
51 workflow_run_fail "${TEST_NAME_BASE}-run" \
52 cylc play --no-detach "${WORKFLOW_NAME}"
53
54 grep_workflow_log_ok "${TEST_NAME_BASE}-grep-1" \
55 "platform: badhostplatform - initialisation did not complete"
56
57 grep_workflow_log_ok "${TEST_NAME_BASE}-grep-2" "CRITICAL - Workflow stalled"
58
59 purge