Debian Codegraph @

tests/f/cylc-install/07-no-recursive-installations.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 #------------------------------------------------------------------------------
19 # Test workflow installation
20 . "$(dirname "$0")/test_header"
21 set_test_number 9
22
23 cat > flow.cylc <<__HEREDOC__
24 [scheduler]
25 allow implicit tasks = true
26 [scheduling]
27 [[graph]]
28 R1 = foo
29 __HEREDOC__
30
31 run_ok "$TEST_NAME_BASE" cylc validate "$PWD"
32
33 TEST_FOLDERS=()
34 MSG="Nested install directories not allowed"
35
36
37 TEST_FOLDER=cylctb-$(uuidgen)
38 TEST_FOLDERS+=("$TEST_FOLDER")
39 cylc install "$PWD" --workflow-name "${TEST_FOLDER}/"
40
41 TEST_NAME="${TEST_NAME_BASE}-child"
42 run_fail "$TEST_NAME" cylc install "$PWD" --workflow-name "${TEST_FOLDER}/child/grandchild"
43 grep_ok "$MSG" "${TEST_NAME}.stderr"
44
45 TEST_NAME="${TEST_NAME_BASE}-child-no-run-name"
46 run_fail "$TEST_NAME" cylc install "$PWD" --workflow-name "${TEST_FOLDER}/child/grandchild" --no-run-name
47 grep_ok "$MSG" "${TEST_NAME}.stderr"
48
49
50 TEST_FOLDER=cylctb-$(uuidgen)
51 TEST_FOLDERS+=("$TEST_FOLDER")
52 cylc install "$PWD" --workflow-name "${TEST_FOLDER}/child/grandchild"
53
54 TEST_NAME="${TEST_NAME_BASE}-parent"
55 run_fail "$TEST_NAME" cylc install "$PWD" --workflow-name "${TEST_FOLDER}/"
56 grep_ok "$MSG" "${TEST_NAME}.stderr"
57
58 TEST_NAME="${TEST_NAME_BASE}-parent-no-run-name"
59 run_fail "$TEST_NAME" cylc install "$PWD" --workflow-name "${TEST_FOLDER}/" --no-run-name
60 grep_ok "$MSG" "${TEST_NAME}.stderr"
61
62 # Cleanup all the test folders added to the array.
63 # shellcheck disable=SC2048
64 for TEST_FOLDER in ${TEST_FOLDERS[*]}; do
65 rm -fr "${RUN_DIR}/${TEST_FOLDER:-}"
66 done
67
68 exit