Ejemplo n.º 1
0
 def test_handle_meter_mod_request_role_master(self):
     generic_obj = self.gen_generic_obj()
     device = self.gen_device()
     of_proto_handler = OpenFlowProtocolHandler(device.datapath_id,
                                                device.id, generic_obj,
                                                generic_obj, generic_obj)
     of_proto_handler.role = ofp.OFPCR_ROLE_MASTER
     of_proto_handler.handle_meter_mod_request(generic_obj)
 def test_handle_flow_mod_request_role_salve(self):
     generic_obj = self.gen_generic_obj()
     device = self.gen_device()
     of_proto_handler = OpenFlowProtocolHandler(device.datapath_id, device.id, generic_obj, generic_obj, generic_obj)
     of_proto_handler.role = ofp.OFPCR_ROLE_SLAVE
     with self.assertRaises(Exception) as context:
         of_proto_handler.handle_flow_mod_request(generic_obj)
     print context.exception
     self.assertTrue('\'function\' object has no attribute \'send\'' in str(context.exception))
Ejemplo n.º 3
0
 def test_handle_flow_mod_request_role_salve(self):
     generic_obj = self.gen_generic_obj()
     device = self.gen_device()
     of_proto_handler = OpenFlowProtocolHandler(device.datapath_id, device.id, generic_obj, generic_obj, generic_obj)
     of_proto_handler.role = ofp.OFPCR_ROLE_SLAVE
     with self.assertRaises(Exception) as context:
         of_proto_handler.handle_flow_mod_request(generic_obj)
     print context.exception
     self.assertTrue('\'function\' object has no attribute \'send\'' in context.exception)
 def test_forward_packet_in_role_master(self):
     packet_in = self.gen_packet_in()
     generic_obj = self.gen_generic_obj()
     device = self.gen_device()
     of_proto_handler = OpenFlowProtocolHandler(device.datapath_id, device.id, generic_obj, generic_obj, generic_obj)
     of_proto_handler.role = ofp.OFPCR_ROLE_MASTER
     with self.assertRaises(Exception) as context:
         of_proto_handler.forward_packet_in(packet_in)
     print context.exception
     self.assertTrue('\'function\' object has no attribute \'send\'' in str(context.exception))
Ejemplo n.º 5
0
 def test_forward_packet_in_role_master(self):
     packet_in = self.gen_packet_in()
     generic_obj = self.gen_generic_obj()
     device = self.gen_device()
     of_proto_handler = OpenFlowProtocolHandler(device.datapath_id, device.id, generic_obj, generic_obj, generic_obj)
     of_proto_handler.role = ofp.OFPCR_ROLE_MASTER
     with self.assertRaises(Exception) as context:
         of_proto_handler.forward_packet_in(packet_in)
     print context.exception
     self.assertTrue('\'function\' object has no attribute \'send\'' in context.exception)
Ejemplo n.º 6
0
 def test_handle_meter_features_request_in_role_master(self):
     generic_obj = self.gen_generic_obj()
     device = self.gen_device()
     of_proto_handler = OpenFlowProtocolHandler(device.datapath_id,
                                                device.id, generic_obj,
                                                generic_obj, generic_obj)
     of_proto_handler.role = ofp.OFPCR_ROLE_MASTER
     with self.assertRaises(Exception) as context:
         of_proto_handler.handle_meter_features_request(generic_obj)
     print context.exception
     self.assertTrue('\'function\' object has no attribute \'send\'' in str(
         context.exception))
 def test_handle_flow_mod_request_role_master(self):
     generic_obj = self.gen_generic_obj()
     device = self.gen_device()
     of_proto_handler = OpenFlowProtocolHandler(device.datapath_id, device.id, generic_obj, generic_obj, generic_obj)
     of_proto_handler.role = ofp.OFPCR_ROLE_MASTER
     of_proto_handler.handle_flow_mod_request(generic_obj)