Exemplo n.º 1
0
 def preform_start_action(self):
     bring_up_vnet_interfaces(self.config, sniffer=self.sniffer)
     change_machine_status(self.config,
                           machines=self._machines,
                           status="start")
Exemplo n.º 2
0
 def test_bring_up_vnet_interfaces_calls_ensure_vnet_veth_interfaces(self):
     bring_up_vnet_interfaces(self.config)
     self.ensure_vnet_veth_interfaces.assert_called_once_with(self.config)
Exemplo n.º 3
0
 def test_bring_up_vnet_interfaces_does_not_calls_ensure_vnet_veth_interface_if_no_veth_interfaces_present_in_config(self):
     del self.config["veths"]
     bring_up_vnet_interfaces(self.config)
     self.assertFalse(self.ensure_vnet_veth_interfaces.called)
Exemplo n.º 4
0
 def test_bring_up_vnet_interfaces_calls_check_if_sniffer_exists(self):
     bring_up_vnet_interfaces(self.config, sniffer=True)
     self.check_if_sniffer_exists.assert_has_calls(self.expected_vnet_interface_calls)
Exemplo n.º 5
0
 def test_bring_up_vnet_interfaces_does_not_call_start_sniffer_when_the_sniffer_already_exists(self):
     self.check_if_sniffer_exists.return_value = True
     bring_up_vnet_interfaces(self.config, sniffer=True)
     self.assertFalse(self.start_tcpdump_on_interface.called)
Exemplo n.º 6
0
 def test_bring_up_vnet_interfaces_does_not_create_sniffer_by_default(self):
     bring_up_vnet_interfaces(self.config)
     self.assertFalse(self.start_tcpdump_on_interface.called)
Exemplo n.º 7
0
 def test_bring_up_vnet_interfaces_calls_sniffer_when_sniffer_argument_passed(self):
     bring_up_vnet_interfaces(self.config, sniffer=True)
     self.start_tcpdump_on_interface.assert_has_calls(self.expected_vnet_interface_calls)
Exemplo n.º 8
0
 def test_bring_up_vnet_interfaces_calls_create_vnet_interface_iptables_rules(self):
     bring_up_vnet_interfaces(self.config)
     self.create_vnet_interface_block_rules.assert_has_calls(self.expected_vnet_interface_calls)
Exemplo n.º 9
0
 def test_bring_up_vnet_interfaces_calls_ip_link_to_bring_up_interfaces(self):
     calls = [call("set", ifname=i, state="up") for i in self.get_vnet_interface_names.return_value]
     bring_up_vnet_interfaces(self.config)
     self.iproute_obj.link.assert_has_calls(calls)
Exemplo n.º 10
0
 def test_bring_up_vnet_interfaces_does_not_call_create_interface_if_the_interface_already_exists(self):
     self.check_if_interface_exists.return_value = True
     bring_up_vnet_interfaces(self.config)
     self.assertFalse(self.create_vnet_interface.called)
Exemplo n.º 11
0
 def test_bring_up_vnet_interfaces_calls_create_vnet_interface_with_interface_names(self):
     bring_up_vnet_interfaces(self.config)
     self.create_vnet_interface.assert_has_calls(self.expected_vnet_interface_calls)
Exemplo n.º 12
0
 def test_bring_up_vnet_interfaces_calls_check_if_interface_exists_with_interface_names(self):
     bring_up_vnet_interfaces(self.config)
     self.check_if_interface_exists.assert_has_calls(self.expected_vnet_interface_calls)
Exemplo n.º 13
0
 def test_bring_up_vnet_interfaces_calls_get_vnet_interface_names_from_config(self):
     bring_up_vnet_interfaces(self.config)
     self.get_vnet_interface_names.assert_called_once_with(self.config)
Exemplo n.º 14
0
 def test_bring_up_vnet_interfaces_calls_ip_route(self):
     bring_up_vnet_interfaces(self.config)
     self.iproute.assert_called_once_with()