Beispiel #1
0
def test_unexpandable_symlink_env_var_returns_failed(mocked_expandvars,
                                                     capsys):
    """Test unexpandable symlinks return REMOTE INIT FAILED"""
    mocked_expandvars.side_effect = ['some/rund/path', '$blah']

    remote_init('test_install_target', 'some_rund', 'run=$blah')
    assert capsys.readouterr().out == (
        "REMOTE INIT FAILED\nError occurred when symlinking."
        " $blah contains an invalid environment variable.\n")
Beispiel #2
0
def test_existing_key_raises_error(tmp_path: Path, capsys: CaptureFixture):
    """Test .service directory that contains existing incorrect key,
    results in REMOTE INIT FAILED"""
    rundir = tmp_path / 'some_rund'
    srvdir = rundir / SuiteFiles.Service.DIRNAME
    srvdir.mkdir(parents=True)
    (srvdir / 'client_wrong.key').touch()

    remote_init('test_install_target', str(rundir))
    assert capsys.readouterr().out == (
        "REMOTE INIT FAILED\nUnexpected authentication key"
        " \"client_wrong.key\" exists. Check global.cylc install target is"
        " configured correctly for this platform.\n")
Beispiel #3
0
def test_existing_client_key_dir_raises_error(tmp_path: Path,
                                              capsys: CaptureFixture):
    """Test .service directory that contains existing incorrect key,
       results in REMOTE INIT FAILED
    """
    rundir = tmp_path / 'some_rund'
    keydir = rundir / SuiteFiles.Service.DIRNAME / "client_public_keys"
    keydir.mkdir(parents=True)

    remote_init('test_install_target', rundir)
    assert capsys.readouterr().out == (
        f"REMOTE INIT FAILED\nUnexpected key directory exists: {keydir}"
        " Check global.cylc install target is configured correctly for this"
        " platform.\n")
Beispiel #4
0
def main():
    from cylc.flow.option_parsers import CylcOptionParser as COP
    from cylc.flow.task_remote_cmd import remote_init

    parser = COP(
        __doc__,
        argdoc=[
            ("INSTALL_TARGET", "Target to be initialised"),
            ("RUND", "The run directory of the suite"),
        ],
    )
    parser.add_option(
        "--indirect-comm",
        metavar="METHOD",
        type="choice",
        choices=["ssh"],
        help="specify use of indirect communication via e.g. ssh",
        action="store",
        dest="indirect_comm",
        default=None,
    )
    options, (install_target, rund) = parser.parse_args()
    remote_init(install_target, rund, indirect_comm=options.indirect_comm)
Beispiel #5
0
def main():
    if not remrun():
        from cylc.flow.option_parsers import CylcOptionParser as COP
        from cylc.flow.task_remote_cmd import remote_init

        parser = COP(
            __doc__,
            argdoc=[
                ("UUID", "UUID of current suite server process"),
                ("RUND", "The run directory of the suite"),
            ],
        )
        parser.add_option(
            "--indirect-comm",
            metavar="METHOD",
            type="choice",
            choices=["ssh"],
            help="specify use of indirect communication via e.g. ssh",
            action="store",
            dest="indirect_comm",
            default=None,
        )
        options, (uuid_str, rund) = parser.parse_args()
        remote_init(uuid_str, rund, indirect_comm=options.indirect_comm)
Beispiel #6
0
def main(parser, options, install_target, rund):
    remote_init(install_target, rund, indirect_comm=options.indirect_comm)
Beispiel #7
0
def main(parser, options, install_target, rund, *dirs_to_be_symlinked):

    remote_init(install_target, rund, *dirs_to_be_symlinked)