File tree Expand file tree Collapse file tree 2 files changed +12
-35
lines changed
tests/functional/platforms Expand file tree Collapse file tree 2 files changed +12
-35
lines changed Original file line number Diff line number Diff line change 1919# If a task has a platform set using a subshell this should be evaluated
2020# every time the task is run.
2121# https://github.com/cylc/cylc-flow/issues/6808
22- export REQUIRE_PLATFORM=' loc:remote fs:indep '
22+ export REQUIRE_PLATFORM=' loc:remote'
2323
2424. " $( dirname " $0 " ) /test_header"
2525
2626set_test_number 3
2727
28- create_test_global_config " " "
29- [platforms]
30- [[${CYLC_TEST_HOST} ]]
31- hosts = ${CYLC_TEST_HOST}
32- install target = ${CYLC_TEST_HOST}
33- "
34-
3528install_workflow " ${TEST_NAME_BASE} " " ${TEST_NAME_BASE} "
3629
37- cat > var_file << __HERE__
38- REMOTE_HOST="${CYLC_TEST_HOST} "
39- __HERE__
40-
4130workflow_run_ok " ${TEST_NAME_BASE} -run" \
42- cylc play " ${WORKFLOW_NAME} " --debug --no-detach --set-file var_file
31+ cylc play " ${WORKFLOW_NAME} " --debug --no-detach
4332
44- named_grep_ok " 1/remote_task submits to ${CYLC_TEST_HOST } " \
45- " \[1/remote_task/01:preparing\] submitted to ${CYLC_TEST_HOST } " \
33+ named_grep_ok " 1/remote_task submits to ${CYLC_TEST_PLATFORM } " \
34+ " \[1/remote_task/01:preparing\] submitted to ${CYLC_TEST_PLATFORM } " \
4635 " ${WORKFLOW_RUN_DIR} /log/scheduler/log"
4736
4837named_grep_ok " 2/remote_task submits to localhost" \
4938 " \[2/remote_task/01:preparing\] submitted to localhost" \
5039 " ${WORKFLOW_RUN_DIR} /log/scheduler/log"
5140
41+ purge
Original file line number Diff line number Diff line change 1616 [[toggler ]]
1717 script = """
1818 # Toggle the platform between localhost and the remote host
19- # using the content of a file, ${TEST_DIR }/pretend-hall-info.
19+ # using the content of a file, ${CYLC_WORKFLOW_RUN_DIR }/pretend-hall-info.
2020 # between localhost and the remote.
2121
22- A="localhost"
23- B="${REMOTE_HOST}"
24-
25- # Create pretend-hall-info file if it does not exist
26- if [[ ! -f ${TEST_DIR}/pretend-hall-info ]]; then
27- echo "localhost" > ${TEST_DIR}/pretend-hall-info
28- fi
29-
30- # Read the current platform from the file and toggle it
31- this=$(cat ${TEST_DIR}/pretend-hall-info)
32- echo ${TEST_DIR} $this
33- echo "content of pretent-hall-info: $(cat ${TEST_DIR}/pretend-hall-info)"
34- if [[ $this == "localhost" ]]; then
35- echo ${REMOTE_HOST} > ${TEST_DIR}/pretend-hall-info
36- cylc message -- "WARNING:changing platform to ${REMOTE_HOST}"
22+ if (( $CYLC_TASK_CYCLE_POINT % 2 == 1 )); then
23+ echo ${REMOTE_PLATFORM} > ${CYLC_WORKFLOW_RUN_DIR}/pretend-hall-info
24+ cylc message -- "changing platform to ${REMOTE_PLATFORM}"
3725 else
38- echo "localhost" > ${TEST_DIR }/pretend-hall-info
39- cylc message -- "WARNING: changing platform to localhost"
26+ echo "localhost" > ${CYLC_WORKFLOW_RUN_DIR }/pretend-hall-info
27+ cylc message -- "changing platform to localhost"
4028 fi
4129 """
4230 [[[environment ]]]
43- REMOTE_HOST = {{ CYLC_TEST_HOST }}
44- TEST_DIR = ${CYLC_WORKFLOW_RUN_DIR}
31+ REMOTE_PLATFORM = {{ CYLC_TEST_PLATFORM }}
You can’t perform that action at this time.
0 commit comments