summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-11-22 19:32:30 +0200
committerimarom <imarom@cisco.com>2016-11-22 19:32:30 +0200
commitfc35e10dc4acd5149b465b8f1959aae941ff198e (patch)
tree3568e9fb2149b56ce8bc93e3da0bfc7652517b1a /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
parent75585e213de850395b6bcd0aff0841cd9cced92c (diff)
RX features - removed 'none' and used Json::nullValue
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
index aeff64de..d225c31c 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
@@ -847,7 +847,7 @@ class Port(object):
info['src_mac'] = attr.get('src_mac', 'N/A')
info['src_ipv4'] = attr.get('src_ipv4', 'N/A')
- if info['src_ipv4'] == 'none':
+ if info['src_ipv4'] is None:
info['src_ipv4'] = 'Not Configured'
# dest
@@ -860,11 +860,11 @@ class Port(object):
info['arp'] = dest.get('arp', 'N/A')
- if info['dest'] == 'none':
+ if info['dest'] is None:
info['dest'] = 'Not Configured'
- if info['arp'] == 'none':
+ if info['arp'] is None:
info['arp'] = 'unresolved'
@@ -896,10 +896,7 @@ class Port(object):
def get_src_addr (self):
src_mac = self.__attr['src_mac']
-
src_ipv4 = self.__attr['src_ipv4']
- if src_ipv4 == 'none':
- src_ipv4 = None
return {'mac': src_mac, 'ipv4': src_ipv4}
@@ -915,8 +912,6 @@ class Port(object):
elif dest['type'] == 'ipv4':
dst_ipv4 = dest['addr']
dst_mac = dest['arp']
- if dst_mac == 'none':
- dst_mac = None
else:
assert(0)
@@ -1272,7 +1267,7 @@ class PingResolver(Resolver):
return self.port.err('Ping - port does not have an IPv4 address configured')
if dst['mac'] is None:
- return self.port.err('Ping - port is not ARP resolved')
+ return self.port.err('Ping - port has an unresolved destination, cannot determine next hop MAC address')
if self.ping_ip == src['ipv4']:
return self.port.err('Ping - cannot ping own IP')