Debian Codegraph @

tests/functional/cylc-reinstall/03-external-files.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 "cylc reinstall" handling of external (non source) files in the run dir.
20
21 . "$(dirname "$0")/test_header"
22 set_test_number 6
23
24 make_rnd_workflow
25 pushd "${RND_WORKFLOW_SOURCE}" || exit 1
26
27 # 1. Should delete an external file.
28
29 # Install source files.
30 run_ok "install-normal" cylc install
31
32 # Install an "external" file.
33 EXT_FILE=$HOME/cylc-run/${RND_WORKFLOW_NAME}/run1/external
34 touch "${EXT_FILE}"
35
36 run_ok "reinstall-normal" cylc reinstall "${RND_WORKFLOW_NAME}"
37
38 exists_fail "${EXT_FILE}"
39
40 # 2. Unless it is listed in .cylcignore.
41 basename "${EXT_FILE}" > .cylcignore
42 run_ok "install-cylcignore" cylc install
43
44 EXT_FILE=$HOME/cylc-run/${RND_WORKFLOW_NAME}/run2/external
45 touch "${EXT_FILE}"
46
47 run_ok "reinstall-cylcignore" cylc reinstall "${RND_WORKFLOW_NAME}"
48 exists_ok "${EXT_FILE}"
49
50 purge_rnd_workflow