From 0c5c6e2e6437d1944140bf5096f76db9f7b5bf1a Mon Sep 17 00:00:00 2001 From: Ashish Pant Date: Tue, 25 Jun 2019 07:30:08 +0530 Subject: [PATCH] tests: Fixing ipv6 address generation Signed-off-by: Ashish Pant --- tests/topotests/lib/common_config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py index 63fcddd836..df0b853dc5 100644 --- a/tests/topotests/lib/common_config.py +++ b/tests/topotests/lib/common_config.py @@ -513,7 +513,10 @@ def generate_ips(network, no_of_ips): count = 0 while count < no_of_ips: ipaddress_list.append("{}/{}".format(next_ip, mask)) - next_ip += step + if addr_type == "ipv6": + next_ip = ipaddr.IPv6Address(int(next_ip) + step) + else: + next_ip += step count += 1 return ipaddress_list