Skip to content

Commit

Permalink
VxlanMulticastRecipe: Use functools.combinations for ping endpoints
Browse files Browse the repository at this point in the history
`functools.permutations` generate even reversed endpoints (both AB and
BA). This should be controlled by `BaseEnrtRecipe`'s `ping_bidirect`.
  • Loading branch information
Kuba314 committed Oct 17, 2023
1 parent b1d3c5b commit 776eee7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lnst/Recipes/ENRT/VxlanMulticastRecipe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections.abc import Iterator
from itertools import permutations
from itertools import combinations
from socket import AF_INET
from lnst.Common.IpAddress import ipaddress, interface_addresses
from lnst.Common.Parameters import IpParam, IPv4NetworkParam
Expand Down Expand Up @@ -100,7 +100,7 @@ def generate_test_wide_description(self, config: EnrtConfiguration):
def generate_ping_endpoints(self, config: EnrtConfiguration) -> Iterator[PingEndpointPair]:
host1, host2, guest1 = (self.matched.host1, self.matched.host2, self.matched.guest1)
devs = [host1.vxlan0, host2.vxlan0, guest1.vxlan0]
for dev1, dev2 in permutations(devs, 2):
for dev1, dev2 in combinations(devs, 2):
yield from ping_endpoint_pairs(config, (dev1, dev2))

def generate_perf_endpoints(self, config: EnrtConfiguration) -> Iterator[list[EndpointPair[IPEndpoint]]]:
Expand Down

0 comments on commit 776eee7

Please sign in to comment.