# Path: teuthology/orchestra/cluster.py
# class Cluster(object):
#     def __init__(self, remotes=None):
#     def __repr__(self):
#     def __str__(self):
#     def add(self, remote, roles):
#     def run(self, wait=True, parallel=False, **kwargs):
#     def sh(self, script, **kwargs):
#     def write_file(self, file_name, content, sudo=False, perms=None, owner=None):
#     def only(self, *roles):
#     def exclude(self, *roles):
#     def filter(self, func):
# 
# Path: teuthology/orchestra/remote.py
# class RemoteShell(object):
# class Remote(RemoteShell):
#     def remove(self, path):
#     def mkdtemp(self, suffix=None, parentdir=None):
#     def mktemp(self, suffix=None, parentdir=None, data=None):
#     def sh(self, script, **kwargs):
#     def sh_file(self, script, label="script", sudo=False, **kwargs):
#     def chmod(self, file_path, permissions):
#     def chcon(self, file_path, context):
#     def copy_file(self, src, dst, sudo=False, mode=None, owner=None,
#                                               mkdir=False, append=False):
#     def move_file(self, src, dst, sudo=False, mode=None, owner=None,
#                                               mkdir=False):
#     def read_file(self, path, sudo=False, stdout=None,
#                               offset=0, length=0):
#     def write_file(self, path, data, sudo=False, mode=None, owner=None,
#                                      mkdir=False, append=False):
#     def sudo_write_file(self, path, data, **kwargs):
#     def os(self):
#     def arch(self):
#     def __init__(self, name, ssh=None, shortname=None, console=None,
#                  host_key=None, keep_alive=True):
#     def connect(self, timeout=None, create_key=None, context='connect'):
#     def reconnect(self, timeout=None, socket_timeout=None, sleep_time=30):
#     def _reconnect(self, timeout=None):
#     def ip_address(self):
#     def interface(self):
#     def cidr(self):
#     def _set_iface_and_cidr(self):
#     def hostname(self):
#     def machine_type(self):
#     def is_reimageable(self):
#     def shortname(self):
#     def is_online(self):
#     def ensure_online(self):
#     def system_type(self):
#     def __str__(self):
#     def __repr__(self):
#     def run(self, **kwargs):
#     def _sftp_put_file(self, local_path, remote_path):
#     def _sftp_get_file(self, remote_path, local_path):
#     def _sftp_open_file(self, remote_path):
#     def _sftp_get_size(self, remote_path):
#     def _format_size(file_size):
#     def put_file(self, path, dest_path, sudo=False):
#     def get_file(self, path, sudo=False, dest_dir='/tmp'):
#     def get_tar(self, path, to_path, sudo=False):
#     def get_tar_stream(self, path, sudo=False):
#     def host_key(self):
#     def inventory_info(self):
#     def console(self):
#     def is_vm(self):
#     def is_container(self):
#     def init_system(self):
#     def __del__(self):
# def getRemoteConsole(name, ipmiuser=None, ipmipass=None, ipmidomain=None,
#                      logfile=None, timeout=60):


import pytest
from mock import patch, Mock
from teuthology.orchestra import cluster, remote, run
        r1 = Mock()
        r2 = Mock()
        c = cluster.Cluster(
            remotes=[
                (r1, ['foo', 'bar']),
                (r2, ['baz']),
                ],
            )
        r3 = Mock()
        c.add(r3, ['xyzzy', 'thud', 'foo'])
        assert c.remotes == {
            r1: ['foo', 'bar'],
            r2: ['baz'],
            r3: ['xyzzy', 'thud', 'foo'],
        }

    def test_repr(self):
        r1 = remote.Remote('r1', ssh=Mock())
        r2 = remote.Remote('r2', ssh=Mock())
        c = cluster.Cluster(
            remotes=[
                (r1, ['foo', 'bar']),
                (r2, ['baz']),
                ],
            )
        assert repr(c) == \
            "Cluster(remotes=[[Remote(name='r1'), ['foo', 'bar']], " \
            "[Remote(name='r2'), ['baz']]])"

    def test_str(self):

# Path: teuthology/orchestra/cluster.py
# class Cluster(object):
#     def __init__(self, remotes=None):
#     def __repr__(self):
#     def __str__(self):
#     def add(self, remote, roles):
#     def run(self, wait=True, parallel=False, **kwargs):
#     def sh(self, script, **kwargs):
#     def write_file(self, file_name, content, sudo=False, perms=None, owner=None):
#     def only(self, *roles):
#     def exclude(self, *roles):
#     def filter(self, func):
# 
# Path: teuthology/orchestra/remote.py
# class RemoteShell(object):
# class Remote(RemoteShell):
#     def remove(self, path):
#     def mkdtemp(self, suffix=None, parentdir=None):
#     def mktemp(self, suffix=None, parentdir=None, data=None):
#     def sh(self, script, **kwargs):
#     def sh_file(self, script, label="script", sudo=False, **kwargs):
#     def chmod(self, file_path, permissions):
#     def chcon(self, file_path, context):
#     def copy_file(self, src, dst, sudo=False, mode=None, owner=None,
#                                               mkdir=False, append=False):
#     def move_file(self, src, dst, sudo=False, mode=None, owner=None,
#                                               mkdir=False):
#     def read_file(self, path, sudo=False, stdout=None,
#                               offset=0, length=0):
#     def write_file(self, path, data, sudo=False, mode=None, owner=None,
#                                      mkdir=False, append=False):
#     def sudo_write_file(self, path, data, **kwargs):
#     def os(self):
#     def arch(self):
#     def __init__(self, name, ssh=None, shortname=None, console=None,
#                  host_key=None, keep_alive=True):
#     def connect(self, timeout=None, create_key=None, context='connect'):
#     def reconnect(self, timeout=None, socket_timeout=None, sleep_time=30):
#     def _reconnect(self, timeout=None):
#     def ip_address(self):
#     def interface(self):
#     def cidr(self):
#     def _set_iface_and_cidr(self):
#     def hostname(self):
#     def machine_type(self):
#     def is_reimageable(self):
#     def shortname(self):
#     def is_online(self):
#     def ensure_online(self):
#     def system_type(self):
#     def __str__(self):
#     def __repr__(self):
#     def run(self, **kwargs):
#     def _sftp_put_file(self, local_path, remote_path):
#     def _sftp_get_file(self, remote_path, local_path):
#     def _sftp_open_file(self, remote_path):
#     def _sftp_get_size(self, remote_path):
#     def _format_size(file_size):
#     def put_file(self, path, dest_path, sudo=False):
#     def get_file(self, path, sudo=False, dest_dir='/tmp'):
#     def get_tar(self, path, to_path, sudo=False):
#     def get_tar_stream(self, path, sudo=False):
#     def host_key(self):
#     def inventory_info(self):
#     def console(self):
#     def is_vm(self):
#     def is_container(self):
#     def init_system(self):
#     def __del__(self):
# def getRemoteConsole(name, ipmiuser=None, ipmipass=None, ipmidomain=None,
#                      logfile=None, timeout=60):


# Path: teuthology/orchestra/test/test_cluster.py
import pytest
from mock import patch, Mock
from teuthology.orchestra import cluster, remote, run

        r1 = Mock()
        r2 = Mock()
        c = cluster.Cluster(
            remotes=[
                (r1, ['foo', 'bar']),
                (r2, ['baz']),
                ],
            )
        r3 = Mock()
        c.add(r3, ['xyzzy', 'thud', 'foo'])
        assert c.remotes == {
            r1: ['foo', 'bar'],
            r2: ['baz'],
            r3: ['xyzzy', 'thud', 'foo'],
        }

    def test_repr(self):
        r1 = remote.Remote('r1', ssh=Mock())
        r2 = remote.Remote('r2', ssh=Mock())
        c = cluster.Cluster(
            remotes=[
                (r1, ['foo', 'bar']),
                (r2, ['baz']),
                ],
            )
        assert repr(c) == \
            "Cluster(remotes=[[Remote(name='r1'), ['foo', 'bar']], " \
            "[Remote(name='r2'), ['baz']]])"

    def test_str(self):

        r1 = remote.Remote('r1', ssh=Mock())