| Total Complexity | 3 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """Test for QueueGetConfigReply message.""" |
||
| 2 | from pyof.v0x01.common.phy_port import Port |
||
| 3 | from pyof.v0x01.common.queue import ( |
||
| 4 | PacketQueue, QueueProperties, QueuePropHeader) |
||
| 5 | from pyof.v0x01.controller2switch import queue_get_config_reply |
||
| 6 | from tests.unit.test_struct import TestStruct |
||
| 7 | |||
| 8 | |||
| 9 | class TestQueueGetConfigReply(TestStruct): |
||
| 10 | """Test for QueueGetConfigReply message.""" |
||
| 11 | |||
| 12 | @classmethod |
||
| 13 | def setUpClass(cls): |
||
| 14 | """[Controller2Switch/QueueGetConfigReply] - size 16.""" |
||
| 15 | super().setUpClass() |
||
| 16 | super().set_raw_dump_file('v0x01', 'ofpt_queue_get_config_reply') |
||
| 17 | super().set_raw_dump_object(queue_get_config_reply.QueueGetConfigReply, |
||
| 18 | xid=1, port=Port.OFPP_ALL, |
||
| 19 | queues=_get_packet_queue()) |
||
| 20 | super().set_minimum_size(16) |
||
| 21 | |||
| 22 | |||
| 23 | def _get_packet_queue(): |
||
| 24 | """Function used to return a PacketQueue instance.""" |
||
| 25 | packets = [] |
||
| 26 | packets.append(PacketQueue(queue_id=1, length=8, |
||
| 27 | properties=_get_queue_properties())) |
||
| 28 | return packets |
||
| 29 | |||
| 30 | |||
| 31 | def _get_queue_properties(): |
||
| 32 | """Function used to return a list of queue properties.""" |
||
| 33 | properties = [] |
||
| 34 | properties.append(QueuePropHeader( |
||
| 35 | queue_property=QueueProperties.OFPQT_MIN_RATE, length=12)) |
||
| 36 | return properties |
||
| 37 |