Example #1
0
 def test_prohibit_existing_route(self, execute_command):
     execute_command.return_value = self.ip_route_list_output
     route = Route('1.2.3.4/30', None)
     with self.assertRaises(ObjectAlreadyExistsException):
         route.prohibit()
         execute_command.assert_called_with('ip route del 1.2.3.4', namespace=None)
Example #2
0
def step_impl(context, destination, device):
    route = Route(destination, device)
    try:
        route.prohibit()
    except Exception as e:
        context.exception = e
Example #3
0
 def test_prohibit_non_existing_route(self, execute_command):
     execute_command.return_value = self.ip_route_list_output
     route = Route('10.10.10.10/24', 'wlo1')
     route.prohibit()
     execute_command.assert_called_with('ip route add prohibit 10.10.10.10/24', namespace=None)