Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Commit

Permalink
t: passphrase search on remote job host
Browse files Browse the repository at this point in the history
New test to ensure that passphrase search on remote job host is correct
even if there is a non-running registered suite on the remote job with
the same name. See cylc#1763.
  • Loading branch information
matthewrmshin committed Apr 14, 2016
1 parent 951890d commit 071ec9c
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/authentication/09-remote-suite-same-name.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) 2008-2015 NIWA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
# Test Pyro communication from a remote host (non-shared file system) when it
# has a suite with the same name registered, but not running. (Obviously, it
# will be very confused if it is running under its ~/cylc-run/SUITE as well.)
. "$(dirname "$0")/test_header"

export CYLC_TEST_HOST=$( \
cylc get-global-config -i '[test battery]remote host' 2>'/dev/null')
if [[ -z "${CYLC_TEST_HOST}" ]]; then
skip_all '"[test battery]remote host": not defined'
fi
set_test_number 2

install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}"
run_ok "${TEST_NAME_BASE}-validate" cylc validate "${SUITE_NAME}"

SSH='ssh -oBatchMode=yes -oConnectTimeout=5'
HOST_WORK_DIR="$( \
${SSH} -n "${CYLC_TEST_HOST}" 'mktemp -d --tmpdir=${PWD} ctb-XXXXXXXX')"
${SSH} -n "${CYLC_TEST_HOST}" "touch '${HOST_WORK_DIR}/suite.rc'"
cylc register --host="${CYLC_TEST_HOST}" "${SUITE_NAME}" "${HOST_WORK_DIR}"

suite_run_ok "${TEST_NAME_BASE}" \
cylc run --debug --reference-test "${SUITE_NAME}"

cylc unregister --host="${CYLC_TEST_HOST}" "${SUITE_NAME}"
${SSH} -n "${CYLC_TEST_HOST}" "rm -fr '${HOST_WORK_DIR}'" >&2

purge_suite "${SUITE_NAME}"
exit
5 changes: 5 additions & 0 deletions tests/authentication/09-remote-suite-same-name/reference.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
2015-12-18T10:58:39Z INFO - Run mode: live
2015-12-18T10:58:39Z INFO - Initial point: 19700101T0000Z
2015-12-18T10:58:39Z INFO - Final point: 19700101T0000Z
2015-12-18T10:58:39Z INFO - Cold Start 19700101T0000Z
2015-12-18T10:58:39Z INFO - [t1.19700101T0000Z] -triggered off []
16 changes: 16 additions & 0 deletions tests/authentication/09-remote-suite-same-name/suite.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!jinja2
[cylc]
UTC mode=True
[[reference test]]
live mode suite timeout = PT1M
[scheduling]
initial cycle point=1970
final cycle point=1970
[[dependencies]]
[[[P1Y]]]
graph=t1
[runtime]
[[t1]]
script=true
[[[remote]]]
host = $CYLC_TEST_HOST

0 comments on commit 071ec9c

Please sign in to comment.