From d81da8c0b5094de6635ad9575a2a2bb6f44070dc Mon Sep 17 00:00:00 2001 From: Eyal Bari Date: Wed, 11 Jan 2017 13:39:54 +0200 Subject: vxlan unit test - minor fixes moved ip4_range and ip4n_range to util added n_ucast_tunnels Change-Id: I9140c4e54a0636d90a97db03da842f5183319af5 Signed-off-by: Eyal Bari --- test/template_bd.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'test/template_bd.py') diff --git a/test/template_bd.py b/test/template_bd.py index 6c384922..91d5dd71 100644 --- a/test/template_bd.py +++ b/test/template_bd.py @@ -5,6 +5,8 @@ from abc import abstractmethod, ABCMeta from scapy.layers.l2 import Ether, Raw from scapy.layers.inet import IP, UDP +from util import ip4_range + class BridgeDomain(object): """ Bridge domain abstraction """ @@ -110,7 +112,7 @@ class BridgeDomain(object): self.pg_start() # Get packet from each tunnel and assert it's corectly encapsulated. - out = self.pg0.get_capture(10) + out = self.pg0.get_capture(self.n_ucast_tunnels) for pkt in out: self.check_encapsulation(pkt, self.ucast_flood_bd, True) payload = self.decapsulate(pkt) @@ -135,10 +137,6 @@ class BridgeDomain(object): payload = self.decapsulate(pkt) self.assert_eq_pkts(payload, self.frame_reply) - @staticmethod - def ipn_to_ip(ipn): - return '.'.join(str(i) for i in bytearray(ipn)) - def test_mcast_rcv(self): """ Multicast receive test Send 20 encapsulated frames from pg0 only 10 match unicast tunnels @@ -148,10 +146,9 @@ class BridgeDomain(object): ip_range_start = 10 ip_range_end = 30 mcast_stream = [ - self.encap_mcast(self.frame_request, self.ipn_to_ip(ip), mac, - self.mcast_flood_bd) - for ip in self.ip4_range(self.pg0.remote_ip4n, - ip_range_start, ip_range_end)] + self.encap_mcast(self.frame_request, ip, mac, self.mcast_flood_bd) + for ip in ip4_range(self.pg0.remote_ip4, + ip_range_start, ip_range_end)] self.pg0.add_stream(mcast_stream) self.pg2.enable_capture() self.pg_start() -- cgit 1.2.3-korg