Closed muthvar1 closed 5 years ago
For RestPy, use the StatViewAssistant module. Take a look at the sample script bgpNgpf.py after calling ixNetwork.StartAllProtocols(). The following line of codes will verify all configured protocols are started first. Then it will verify all configured protocols sessions are UP including IPv4 ARP being resolved. The CheckCondition default timeout is 90 seconds. Raise an exception if the condition is not met otherwise return a bool result.
protocolsSummary = StatViewAssistant(ixNetwork, 'Protocols Summary')
protocolsSummary.CheckCondition('Sessions Not Started', StatViewAssistant.EQUAL, 0)
protocolsSummary.CheckCondition('Sessions Down', StatViewAssistant.EQUAL, 0)
Hi Hubert, Is there a way to list out the ip's that are not resolved in this case?
Hi Varghese,
Yes you could get unresolved arp ip addresses. Take a look at the snapshot taken from the API browser. The list of unresolved mac addresses are aligned with the IP addresses that could not resolve the gateway mac. You have to write some code to do a .find() for the Ipv4 object handle and from there you get the attributes for address and unresolvedGatewayMac.
Hubert
Thanks Hubert. Will write some code around this then. Is this something Ixia would be providing in a some later update though? Seems like it is something most people would use. HLTAPI had this implemented, from what I remember.
Varghese
Looking for a call that verifies if arp or ns is resolved and if not lists all the unresolved ns or arp. I see that under ixNetwork there is a call for sending Ns or Arp across all interfaces, but do not see one for validation of arp resolution.
ixnetwork.py: def SendArpAll(self): """Executes the sendArpAll operation on the server.
Looking for something like we have in HLT def verify_arp(self, max_retry=3, handles=False): ''' For all the unresolved ARPs, ixia returns a string in the below format with all the IP addresses '{topology:6 Port:1/4 IP:200.140.2.3 HANDLE:::ixNet::OBJ-/topology:6/deviceGroup:2/ethernet:1/ipv4:2} \ {topology:6 Port:1/4 IP:200.140.2.4 HANDLE:::ixNet::OBJ-/topology:6/deviceGroup:2/ethernet:1/ipv4:2}' This fucntion return iplist ['200.140.2.3', '200.140.2.4'] or iplist, handle_list ''' ip_list = list() handle_list = list() cmd = 'set unresolved [VerifyArpNgpf ipv4 ' + str(max_retry) + ']' unresolved_arp = self.tcl.eval(cmd) if unresolved_arp != '0': for (ip,handle) in re.findall('IP:(.+?) HANDLE:(.+?)}', unresolved_arp): ip_list.append(ip) handle_list.append(handle) pass
remove dups in handles