Debian Codegraph @

tests/f/reload/23-cycle-point-time-zone.t

raw
1 #!/bin/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 saving and loading of cycle point time zone to/from database on a run
19 # followed by a reload. Important for reloading a workflow after a system
20 # time zone change.
21
22 . "$(dirname "$0")/test_header"
23
24 set_test_number 5
25
26 init_workflow "${TEST_NAME_BASE}" << '__FLOW__'
27 [scheduler]
28 cycle point time zone = +0100
29 allow implicit tasks = True
30 [scheduling]
31 initial cycle point = now
32 [[graph]]
33 R1 = foo
34 __FLOW__
35
36 run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"
37
38 # Set time zone to +01:00
39 export TZ=BST-1
40
41 workflow_run_ok "${TEST_NAME_BASE}-run" cylc play "${WORKFLOW_NAME}" --pause
42 poll_grep_workflow_log "Paused on start up"
43
44 # Simulate DST change
45 export TZ=UTC
46
47 run_ok "${TEST_NAME_BASE}-reload" cylc reload "${WORKFLOW_NAME}"
48 poll_grep_workflow_log "Reload completed"
49
50 cylc stop --now --now "${WORKFLOW_NAME}"
51
52 log_scan "${TEST_NAME_BASE}-log-scan" "${WORKFLOW_RUN_DIR}/log/scheduler/log" 1 0 \
53 'LOADING saved workflow parameters' \
54 '+ cycle point time zone = +0100'
55
56 purge