File: test_flow_stats_request.py

package info (click to toggle)
python-openflow 1.1.0~alpha2-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 692 kB
  • ctags: 1,027
  • sloc: python: 2,713; makefile: 207; sh: 8
file content (41 lines) | stat: -rw-r--r-- 1,327 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import unittest

from pyof.v0x01.common import flow_match
from pyof.v0x01.controller2switch.common import FlowStatsRequest


class TestFlowStatsRequest(unittest.TestCase):

    def setUp(self):
        self.message = FlowStatsRequest()
        self.message.match = flow_match.Match()
        self.message.table_id = 1
        self.message.out_port = 80
        self.message.match.in_port = 80
        self.message.match.dl_src = [1, 2, 3, 4, 5, 6]
        self.message.match.dl_dst = [1, 2, 3, 4, 5, 6]
        self.message.match.dl_vlan = 1
        self.message.match.dl_vlan_pcp = 1
        self.message.match.dl_type = 1
        self.message.match.nw_tos = 1
        self.message.match.nw_proto = 1
        self.message.match.nw_src = 10000
        self.message.match.nw_dst = 10000
        self.message.match.tp_src = 80
        self.message.match.tp_dst = 80

    def test_get_size(self):
        """[Controller2Switch/FlowStatsRequest] - size 44"""
        self.assertEqual(self.message.get_size(), 44)

    @unittest.skip('Not yet implemented')
    def test_pack(self):
        """[Controller2Switch/FlowStatsRequest] - packing"""
        # TODO
        pass

    @unittest.skip('Not yet implemented')
    def test_unpack(self):
        """[Controller2Switch/FlowStatsRequest] - unpacking"""
        # TODO
        pass