MCPcopy Create free account
hub / github.com/FDio/vpp / generate_remote_hosts

Method generate_remote_hosts

test/vpp_interface.py:183–206  ·  view source on GitHub ↗

Generate and add remote hosts for the interface. :param int count: Number of generated remote hosts.

(
        self,
        count=1,
        remote_host_ip4_generator=remote_host_ip4_172_16_generator,
        remote_host_ip6_generator=remote_host_ip6_fd01_generator,
    )

Source from the content-addressed store, hash-verified

181 return self._hosts_by_ip6[ip]
182
183 def generate_remote_hosts(
184 self,
185 count=1,
186 remote_host_ip4_generator=remote_host_ip4_172_16_generator,
187 remote_host_ip6_generator=remote_host_ip6_fd01_generator,
188 ):
189 """Generate and add remote hosts for the interface.
190
191 :param int count: Number of generated remote hosts.
192 """
193 self._remote_hosts = []
194 self._hosts_by_mac = {}
195 self._hosts_by_ip4 = {}
196 self._hosts_by_ip6 = {}
197 for i in range(2, count + 2): # 0: network address, 1: local vpp address
198 mac = "02:%02x:00:00:ff:%02x" % (self.sw_if_index, i)
199 ip4 = remote_host_ip4_generator(self.sw_if_index, i)
200 ip6 = remote_host_ip6_generator(self.sw_if_index, i)
201 ip6_ll = mk_ll_addr(mac)
202 host = Host(mac, ip4, ip6, ip6_ll)
203 self._remote_hosts.append(host)
204 self._hosts_by_mac[mac] = host
205 self._hosts_by_ip4[ip4] = host
206 self._hosts_by_ip6[ip6] = host
207
208 @abc.abstractmethod
209 def __init__(self, test):

Callers 15

set_sw_if_indexMethod · 0.95
setUpClassMethod · 0.80
setUpMethod · 0.80
test_mgreMethod · 0.80
test_mgre6Method · 0.80
setUpClassMethod · 0.80
setUpClassMethod · 0.80
test_tunnel_ecmpMethod · 0.80
setUpClassMethod · 0.80
test_dhcp_proxyMethod · 0.80
test_dhcp6_proxyMethod · 0.80
test_dhcp_clientMethod · 0.80

Calls 3

mk_ll_addrFunction · 0.90
HostClass · 0.90
appendMethod · 0.80

Tested by 15

setUpClassMethod · 0.64
setUpMethod · 0.64
test_mgreMethod · 0.64
test_mgre6Method · 0.64
setUpClassMethod · 0.64
setUpClassMethod · 0.64
test_tunnel_ecmpMethod · 0.64
setUpClassMethod · 0.64
test_dhcp_proxyMethod · 0.64
test_dhcp6_proxyMethod · 0.64
test_dhcp_clientMethod · 0.64
setUpClassMethod · 0.64