Test Failed
Pull Request — master (#404)
by
unknown
01:46
created

_get_ports()   B

Complexity

Conditions 1

Size

Total Lines 29

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 29
c 0
b 0
f 0
rs 8.8571
cc 1
1
"""Echo request message tests."""
2
from pyof.foundation.basic_types import DPID, HWAddress
3
from pyof.v0x01.common.phy_port import PhyPort, PortConfig, PortState
4
from pyof.v0x01.controller2switch.features_reply import FeaturesReply
5
from tests.test_struct import TestMsgDumpFile
6
7
8
class TestFeaturesReply(TestMsgDumpFile):
9
    """Feature reply message tests (also those in :class:`.TestDump`)."""
10
11
    dumpfile = 'v0x01/ofpt_features_reply.dat'
12
13
    ports = [
14
        PhyPort(port_no=65534,
15
                hw_addr=HWAddress('0e:d3:98:a5:30:47'),
16
                name='s1',
17
                config=PortConfig.OFPPC_PORT_DOWN,
18
                state=PortState.OFPPS_LINK_DOWN,
19
                curr=0,
20
                advertised=0,
21
                supported=0,
22
                peer=0),
23
        PhyPort(port_no=1,
24
                hw_addr=HWAddress('0a:54:cf:fc:4e:6d'),
25
                name='s1-eth1',
26
                config=0,
27
                state=PortState.OFPPS_STP_LISTEN,
28
                curr=0x000000c0,
29
                advertised=0,
30
                supported=0,
31
                peer=0),
32
        PhyPort(port_no=2,
33
                hw_addr=HWAddress('f6:b6:ab:cc:f8:4f'),
34
                name='s1-eth2',
35
                config=0,
36
                state=PortState.OFPPS_STP_LISTEN,
37
                curr=0x000000c0,
38
                advertised=0,
39
                supported=0,
40
                peer=0)]
41
42
    obj = FeaturesReply(xid=2,
43
                        datapath_id=DPID('00:00:00:00:00:00:00:01'),
44
                        n_buffers=256, n_tables=254,
45
                        capabilities=0x000000c7,
46
                        actions=4095, ports=ports)
47
    min_size = 32
48