예제 #1
0
    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'
예제 #2
0
 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))
예제 #3
0
 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))
예제 #4
0
 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))
예제 #5
0
    def test_construction(self, mocks):
        subject = DnsSshCommands(self.mock_ip_fn)

        assert subject.get_ip() == '1.2.3.4'