Passed
Pull Request — master (#404)
by
unknown
01:53
created

TestActionVlanVid.setUpClass()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
rs 9.4285
cc 1
1
"""Testing Port structures."""
2
from pyof.v0x01.common.action import (
3
    ActionDLAddr, ActionEnqueue, ActionNWAddr, ActionNWTos, ActionOutput,
4
    ActionTPPort, ActionType, ActionVendorHeader, ActionVlanPCP, ActionVlanVid)
5
from pyof.v0x01.common.phy_port import Port
6
from tests.test_struct import TestMsgDumpFile
7
8
9
class TestActionOutput(TestMsgDumpFile):
10
    """ActionOutput message tests (also those in :class:`.TestDump`)."""
11
12
    dumpfile = 'v0x01/ofpt_action_output.dat'
13
    obj = ActionOutput(port=Port.OFPP_CONTROLLER, max_length=8)
14
    min_size = 8
15
16
17
class TestActionEnqueue(TestMsgDumpFile):
18
    """ActionEnqueue message tests (also those in :class:`.TestDump`)."""
19
20
    dumpfile = 'v0x01/ofpt_action_enqueue.dat'
21
    obj = ActionEnqueue(port=Port.OFPP_CONTROLLER, queue_id=4)
22
    min_size = 16
23
24
25
class TestActionVlanVid(TestMsgDumpFile):
26
    """ActionVlanVid message tests (also those in :class:`.TestDump`)."""
27
28
    dumpfile = 'v0x01/ofpt_action_vlan_vid.dat'
29
    obj = ActionVlanVid(vlan_id=5)
30
    min_size = 8
31
32
33
class TestActionVlanPCP(TestMsgDumpFile):
34
    """ActionVlanPCP message tests (also those in :class:`.TestDump`)."""
35
36
    dumpfile = 'v0x01/ofpt_action_vlan_pcp.dat'
37
    obj = ActionVlanPCP(vlan_pcp=2)
38
    min_size = 8
39
40
41
class TestActionDLAddr(TestMsgDumpFile):
42
    """ActionDLAddr message tests (also those in :class:`.TestDump`)."""
43
44
    dumpfile = 'v0x01/ofpt_action_dl_addr.dat'
45
    obj = ActionDLAddr(action_type=ActionType.OFPAT_SET_DL_SRC,
46
                       dl_addr=[12, 12, 12, 12, 12, 12])
47
    min_size = 16
48
49
50
class TestActionNWAddr(TestMsgDumpFile):
51
    """ActionNWAddr message tests (also those in :class:`.TestDump`)."""
52
53
    dumpfile = 'v0x01/ofpt_action_nw_addr.dat'
54
    obj = ActionNWAddr(action_type=ActionType.OFPAT_SET_NW_SRC,
55
                       nw_addr=[12, 12, 12, 12, 12, 12])
56
    min_size = 8
57
58
59
class TestActionNWTos(TestMsgDumpFile):
60
    """ActionNWTos message tests (also those in :class:`.TestDump`)."""
61
62
    dumpfile = 'v0x01/ofpt_action_nw_tos.dat'
63
    obj = ActionNWTos(action_type=ActionType.OFPAT_SET_NW_SRC,
64
                      nw_tos=123456)
65
    min_size = 8
66
67
68
class TestActionTPPort(TestMsgDumpFile):
69
    """ActionTPPort message tests (also those in :class:`.TestDump`)."""
70
71
    dumpfile = 'v0x01/ofpt_action_tp_port.dat'
72
    obj = ActionTPPort(action_type=ActionType.OFPAT_SET_TP_SRC,
73
                       tp_port=8888)
74
    min_size = 8
75
76
77
class TestActionVendorHeader(TestMsgDumpFile):
78
    """ActionVendorHeader message tests (also those in :class:`.TestDump`)."""
79
80
    dumpfile = 'v0x01/ofpt_action_vendor_header.dat'
81
    obj = ActionVendorHeader(length=16, vendor=1)
82
    min_size = 8
83