def test_dns_utility(self, mocks): subject = DnsSshCommands(self.mock_ip_fn) result = subject.dns_utility('revert') self.mock_executor.return_value.execute_sync_with_output.assert_called_with( [ 'ssh', '-oStrictHostKeyChecking=no', '[email protected]', 'sudo ./dns_utility revert; ./dns_utility status' ]) assert result == 'reverted'
def __init__(self, machine_name): self.client = boto3.client('ec2', EC2_CONFIG['region']) self.ip = "" self._machine_name = machine_name self.node = Node(machine_name, NodeSshCommands(self.get_external_ip)) self.dns = Dns(machine_name, DnsSshCommands(self.get_external_ip)) self.traffic = TrafficHandler(machine_name, TrafficSshCommands(self.get_external_ip))
def __init__(self, name): self.ip_pattern = re.compile(r".*value: (.+), time.*") self.command = "VBoxManage" self.ip = "" self.name = name self.node = Node(name, NodeSshCommands(self.get_external_ip)) self.dns = Dns(name, DnsSshCommands(self.get_external_ip)) self.traffic = TrafficHandler(name, TrafficSshCommands(self.get_external_ip))
def __init__(self, machine_name, project=COMPUTE_CONFIG['project'], zone=COMPUTE_CONFIG['zone']): self.compute = googleapiclient.discovery.build('compute', 'v1') self.project = project self.zone = zone self.ip = "" self._machine_name = machine_name self.node = Node(machine_name, NodeSshCommands(self.get_external_ip)) self.dns = Dns(machine_name, DnsSshCommands(self.get_external_ip)) self.traffic = TrafficHandler(machine_name, TrafficSshCommands(self.get_external_ip))
def test_construction(self, mocks): subject = DnsSshCommands(self.mock_ip_fn) assert subject.get_ip() == '1.2.3.4'