summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>2013-08-26 14:34:39 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-08-26 15:04:46 +0900
commit780381963d619d08b5aa1523dafaa56f2db51b51 (patch)
treeec2f4acbd8433290c77a148513ca35ab74dfc1cd
parent9e698c74832b4e019a8418aae7853b56181260ab (diff)
of10: update tests
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/tests/unit/ofproto/json/of10/1-6-ofp_switch_features.packet.json4
-rw-r--r--ryu/tests/unit/ofproto/test_parser_v10.py15
2 files changed, 10 insertions, 9 deletions
diff --git a/ryu/tests/unit/ofproto/json/of10/1-6-ofp_switch_features.packet.json b/ryu/tests/unit/ofproto/json/of10/1-6-ofp_switch_features.packet.json
index 4084ba5e..aa8180e1 100644
--- a/ryu/tests/unit/ofproto/json/of10/1-6-ofp_switch_features.packet.json
+++ b/ryu/tests/unit/ofproto/json/of10/1-6-ofp_switch_features.packet.json
@@ -11,7 +11,7 @@
"advertised": 640,
"config": 0,
"curr": 648,
- "hw_addr": "8gukffjq",
+ "hw_addr": "f2:0b:a4:7d:f8:ea",
"name": "UG9ydAYAAAAAAAAAAAAAAA==",
"peer": 648,
"port_no": 6,
@@ -24,7 +24,7 @@
"advertised": 640,
"config": 0,
"curr": 648,
- "hw_addr": "8guk0D9w",
+ "hw_addr": "f2:0b:a4:d0:3f:70",
"name": "UG9ydAcAAAAAAAAAAAAAAA==",
"peer": 648,
"port_no": 7,
diff --git a/ryu/tests/unit/ofproto/test_parser_v10.py b/ryu/tests/unit/ofproto/test_parser_v10.py
index 29e7d283..81b96deb 100644
--- a/ryu/tests/unit/ofproto/test_parser_v10.py
+++ b/ryu/tests/unit/ofproto/test_parser_v10.py
@@ -20,6 +20,7 @@ import logging
from nose.tools import *
from ryu.ofproto.ofproto_v1_0_parser import *
from ryu.ofproto import ofproto_v1_0_parser
+from ryu.lib import addrconv
LOG = logging.getLogger('test_ofproto_v10')
@@ -33,7 +34,7 @@ class TestOFPPhyPort(unittest.TestCase):
# '!H6s16sIIIIII'... port_no, hw_addr, name, config, state
# curr, advertised, supported, peer
port_no = {'buf': '\xe7\x6b', 'val': 59243}
- hw_addr = '\x52\x54\x54\x10\x20\x99'
+ hw_addr = '52:54:54:10:20:99'
name = 'name'.ljust(16)
config = {'buf': '\x84\xb6\x8c\x53', 'val': 2226555987}
state = {'buf': '\x64\x07\xfb\xc9', 'val': 1678244809}
@@ -43,7 +44,7 @@ class TestOFPPhyPort(unittest.TestCase):
peer = {'buf': '\xa4\x5b\x8b\xed', 'val': 2757463021}
buf = port_no['buf'] \
- + hw_addr \
+ + addrconv.mac.text_to_bin(hw_addr) \
+ name \
+ config['buf'] \
+ state['buf'] \
@@ -3384,7 +3385,7 @@ class TestOFPSwitchFeatures(unittest.TestCase):
# '!H6s16sIIIIII'... port_no, hw_addr, name, config, state
# curr, advertised, supported, peer
port_no = {'buf': '\xe7\x6b', 'val': 59243}
- hw_addr = '\x3c\xd1\x2b\x8d\x3f\xd6'
+ hw_addr = '3c:d1:2b:8d:3f:d6'
name = 'name'.ljust(16)
config = {'buf': '\x84\xb6\x8c\x53', 'val': 2226555987}
state = {'buf': '\x64\x07\xfb\xc9', 'val': 1678244809}
@@ -3404,7 +3405,7 @@ class TestOFPSwitchFeatures(unittest.TestCase):
+ capabilities['buf'] \
+ actions['buf'] \
+ port_no['buf'] \
- + hw_addr \
+ + addrconv.mac.text_to_bin(hw_addr) \
+ name \
+ config['buf'] \
+ state['buf'] \
@@ -3433,7 +3434,7 @@ class TestOFPSwitchFeatures(unittest.TestCase):
# port
port = res.ports[port_no['val']]
eq_(port_no['val'], port.port_no)
- eq_(hw_addr, port.hw_addr)
+ eq_(hw_addr, hw_addr)
eq_(name, port.name)
eq_(config['val'], port.config)
eq_(state['val'], port.state)
@@ -3480,7 +3481,7 @@ class TestOFPPortStatus(unittest.TestCase):
reason = {'buf': '\x71', 'val': 113}
zfill = '\x00' * 7
port_no = {'buf': '\x48\xd8', 'val': 18648}
- hw_addr = '\x41\xf7\xa3\x52\x8f\x6b'
+ hw_addr = '41:f7:a3:52:8f:6b'
name = 'name'.ljust(16)
config = {'buf': '\xae\x73\x90\xec', 'val': 2926809324}
state = {'buf': '\x41\x37\x32\x1d', 'val': 1094136349}
@@ -3496,7 +3497,7 @@ class TestOFPPortStatus(unittest.TestCase):
+ reason['buf'] \
+ zfill \
+ port_no['buf'] \
- + hw_addr \
+ + addrconv.mac.text_to_bin(hw_addr) \
+ name \
+ config['buf'] \
+ state['buf'] \