| 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 |
# Platforms can have default directives and these are overridden as expected. |
| 19 |
export REQUIRE_PLATFORM="runner:slurm" |
| 20 |
. "$(dirname "$0")/test_header" |
| 21 |
|
| 22 |
set_test_number 5 |
| 23 |
|
| 24 |
create_test_global_config "" " |
| 25 |
[platforms] |
| 26 |
[[no_default, default_only, overridden, neither]] |
| 27 |
hosts = localhost |
| 28 |
job runner = slurm |
| 29 |
[[default_only, overridden]] |
| 30 |
[[[directives]]] |
| 31 |
--wurble=foo |
| 32 |
" |
| 33 |
|
| 34 |
init_workflow "${TEST_NAME_BASE}" <<'__FLOW_CONF__' |
| 35 |
[scheduler] |
| 36 |
[[events]] |
| 37 |
stall timeout = PT0S |
| 38 |
[scheduling] |
| 39 |
[[graph]] |
| 40 |
R1 = lewis & morse & barnaby & cadfael |
| 41 |
|
| 42 |
[runtime] |
| 43 |
[[lewis]] |
| 44 |
platform = no_default |
| 45 |
[[[directives]]] |
| 46 |
--wurble=bar |
| 47 |
[[morse]] |
| 48 |
platform = default_only |
| 49 |
[[barnaby]] |
| 50 |
platform = overridden |
| 51 |
[[[directives]]] |
| 52 |
--wurble=qux |
| 53 |
[[cadfael]] |
| 54 |
platform = neither |
| 55 |
|
| 56 |
__FLOW_CONF__ |
| 57 |
|
| 58 |
run_fail "${TEST_NAME_BASE}-play" \ |
| 59 |
cylc play "${WORKFLOW_NAME}" --no-detach |
| 60 |
|
| 61 |
LOG_DIR="${RUN_DIR}/${WORKFLOW_NAME}/log/job/1/" |
| 62 |
|
| 63 |
named_grep_ok "${TEST_NAME_BASE}-no-default" "--wurble=bar" "${LOG_DIR}/lewis/NN/job" |
| 64 |
named_grep_ok "${TEST_NAME_BASE}-default-only" "--wurble=foo" "${LOG_DIR}/morse/NN/job" |
| 65 |
named_grep_ok "${TEST_NAME_BASE}-overridden" "--wurble=qux" "${LOG_DIR}/barnaby/NN/job" |
| 66 |
grep_fail "--wurble" "${LOG_DIR}/cadfael/NN/job" |
| 67 |
|
| 68 |
purge |
| 69 |
exit 0 |
| 70 |
|