diff options
author | Minoru TAKAHASHI <takahashi.minoru7@gmail.com> | 2014-11-18 13:25:27 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-11-18 15:57:54 +0900 |
commit | b8d7db4076c13aa551db56d857e5e6d62f331198 (patch) | |
tree | 744974f0203b7c579eb3702970aa82ff59609f11 | |
parent | ecc57e8660682b954b7683170521b1d1628255a3 (diff) |
test_ofctl_v1_2/3: Fix some test cases
UnitTest of the following cases had not been executed successfully.
{'dl_src/dst': "aa:bb:cc:11:22:33/*"}
{'eth_src/dst': "aa:bb:cc:11:22:33/*"}
{'nw_src/dst': "192.168.0.1/*", 'eth_type': 0x0800}
{'ipv4_src/dst': "192.168.0.1/*", 'eth_type': 0x0800}
{'arp_spa/tpa': "192.168.0.22/*", 'eth_type': 0x0806}
{'arp_sha/tha': "aa:bb:cc:11:22:33/*", 'eth_type': 0x0806}
{'ipv6_src/dst': '2001::aaaa:bbbb:cccc:1111/*', 'eth_type': 0x86dd}
This patch fixes this problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/tests/unit/lib/test_ofctl.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ryu/tests/unit/lib/test_ofctl.py b/ryu/tests/unit/lib/test_ofctl.py index cbdc3e19..e005efca 100644 --- a/ryu/tests/unit/lib/test_ofctl.py +++ b/ryu/tests/unit/lib/test_ofctl.py @@ -225,6 +225,8 @@ class Test_ofctl(unittest.TestCase): elif key in ['nw_src', 'nw_dst', 'ipv4_src', 'ipv4_dst', 'arp_spa', 'arp_tpa']: ipv4, mask = _to_match_ip(value) + if mask == (1 << 32) - 1: + mask = None eq_(ipv4, field.value) eq_(mask, field.mask) return @@ -573,7 +575,8 @@ def _add_tests_actions(cls): def _add_tests_match(cls): for attr in cls.attr_list: for key, value in attr.items(): - method_name = 'test_' + str(cls.ver) + '_' + key + '_match' + method_name = 'test_' + \ + str(cls.ver) + '_' + key + '_' + str(value) + '_match' def _run(self, name, attr, cls): print ('processing %s ...' % name) |