Exemplo n.º 1
0
def test_wait_all_boot(join, run_command):
    # pylint: disable=unused-argument
    """Test wait for ssh nodes to be available."""
    config_ssh = {
        'user': '******',
        'exp_id': 123,
    }

    test_command = 'test'
    groups = _nodes_grouped(_ROOT_NODES)

    # normal boot
    node_ssh = OpenLinuxSsh(config_ssh, groups, verbose=True)

    output = [HostOutput(host, 'test', 0) for host in _ROOT_NODES]
    run_command.return_value = output

    node_ssh.wait(120)
    assert run_command.call_count == 2
    run_command.assert_called_with('uptime', stop_on_errors=False)
    run_command.reset_mock()

    node_ssh.run(test_command)
    assert run_command.call_count == 2
    run_command.assert_called_with(test_command, stop_on_errors=False)
Exemplo n.º 2
0
def wait_for_boot(config_ssh, nodes, max_wait=120, verbose=False):
    """Wait for the open Linux nodes boot """

    # Configure ssh.
    groups = _nodes_grouped(nodes)
    ssh = OpenLinuxSsh(config_ssh, groups, verbose=verbose)
    # Wait for boot
    return {"wait-for-boot": ssh.wait(max_wait)}