Skip to content
3 changes: 2 additions & 1 deletion ansible/roles/test/files/ptftests/arista.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import paramiko
import pickle
import ast
import six

from operator import itemgetter
from collections import defaultdict
Expand Down Expand Up @@ -104,7 +105,7 @@ def do_cmd(self, cmd, prompt=None):
continue

try:
input_buffer += self.shell.recv(16384)
input_buffer += six.ensure_str(self.shell.recv(16384))
except Exception as err:
msg = 'Receive ssh command result error: cmd={} msg={} type={}'.format(
cmd, err, type(err))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def __init__(self):
self.check_param('lo_v6_prefix', 'fc00:1::/64', required=False)
self.check_param('arista_vms', [], required=True)
self.check_param('min_bgp_gr_timeout', 15, required=False)
self.check_param('warm_up_timeout_secs', 300, required=False)
self.check_param('warm_up_timeout_secs', 600, required=False)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of old commit. Final version didn't have this change.

self.check_param('dut_stabilize_secs', 30, required=False)
self.check_param('preboot_files', None, required=False)
# preboot sad path to inject before warm-reboot
Expand Down Expand Up @@ -679,7 +679,7 @@ def setUp(self):

self.random_vlan = random.choice(self.vlan_ports)
self.from_server_src_port = self.random_vlan
self.from_server_src_addr = random.choice(self.vlan_host_map[self.random_vlan].keys())
self.from_server_src_addr = random.choice(list(self.vlan_host_map[self.random_vlan].keys()))
self.from_server_src_mac = self.hex_to_mac(self.vlan_host_map[self.random_vlan][self.from_server_src_addr])
self.from_server_dst_addr = self.random_ip(self.test_params['default_ip_range'])
self.from_server_dst_ports = self.dualtor_portchannel_ports if self.is_dualtor else self.portchannel_ports
Expand Down Expand Up @@ -849,7 +849,7 @@ def generate_ping_dut_lo(self):
dut_lo_ipv4 = self.lo_prefix.split('/')[0]

for src_port in self.active_port_indices if self.is_dualtor else self.vlan_host_ping_map:
src_addr = random.choice(self.vlan_host_ping_map[src_port].keys())
src_addr = random.choice(list(self.vlan_host_ping_map[src_port].keys()))
src_mac = self.hex_to_mac(
self.vlan_host_ping_map[src_port][src_addr])
packet = simple_icmp_packet(eth_src=src_mac,
Expand All @@ -876,7 +876,7 @@ def generate_arp_ping_packet(self):
vlan = next(k for k, v in self.ports_per_vlan.items() if v)
vlan_ip_range = self.vlan_ip_range[vlan]

vlan_port_canadiates = range(len(self.ports_per_vlan[vlan]))
vlan_port_canadiates = list(range(len(self.ports_per_vlan[vlan])))
vlan_port_canadiates.remove(0) # subnet prefix
vlan_port_canadiates.remove(1) # subnet IP on dut
src_idx = random.choice(vlan_port_canadiates)
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/test/files/ptftests/py3/arista.py
1 change: 1 addition & 0 deletions ansible/roles/test/files/ptftests/py3/host_device.py
1 change: 1 addition & 0 deletions ansible/roles/test/files/ptftests/py3/sad_path.py
3 changes: 2 additions & 1 deletion tests/common/fixtures/advanced_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,8 @@ def __runPtfRunner(self, rebootOper=None):
params=params,
log_file='/tmp/advanced-reboot.ReloadTest.log',
module_ignore_errors=self.moduleIgnoreErrors,
timeout=REBOOT_CASE_TIMEOUT
timeout=REBOOT_CASE_TIMEOUT,
is_python3=True
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this is_python3 argument being used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In ptf_runner.py, if is_python3==true, Python3 is used to run the PTF script.

)

return result
Expand Down