Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/common/fixtures/advanced_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,12 @@ def __buildTestbedData(self):
self.rebootData['dut_username'] = secrets[invetory]['sonicadmin_user']
self.rebootData['dut_password'] = secrets[invetory]['sonicadmin_password']

# Change network of the dest IP addresses (used by VM servers) to be different from Vlan network
prefixLen = self.mgFacts['minigraph_vlan_interfaces'][0]['prefixlen'] - 3
testNetwork = ipaddress.ip_address(self.mgFacts['minigraph_vlan_interfaces'][0]['addr']) + (1 << (32 - prefixLen))
Copy link
Contributor

Choose a reason for hiding this comment

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

is there an example? I probably do not fully understand this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

those are packets originated from servers. The advanced-reboot.py generate random dest IP in the default_ip_range network. The network is the same as the vlan network and so collision could happen. We are changing the network here to be different from the vlan network in order to prevent collision with dut vlan as reported and fixed here. In the case of default vlan network: 192.168.0.1/21, the default_ip_range will have prefixlen 18 and adds 1 in the 14th position and so network would be: 192.168.64.0/18

self.rebootData['default_ip_range'] = str(
ipaddress.ip_interface(self.mgFacts['minigraph_vlan_interfaces'][0]['addr'] + '/18').network
ipaddress.ip_interface(unicode(str(testNetwork) + '/{0}'.format(prefixLen))).network
)

for intf in self.mgFacts['minigraph_lo_interfaces']:
if ipaddress.ip_interface(intf['addr']).ip.version == 6:
self.rebootData['lo_v6_prefix'] = str(ipaddress.ip_interface(intf['addr'] + '/64').network)
Expand Down