[dts] [PATCH for-next v3 2/7] framework: Do not attempt ping6 on T-Rex ports

Patrick MacArthur pmacarth at iol.unh.edu
Thu Mar 29 21:16:00 CEST 2018


DTS uses ping6 to determine whether the DUT and tester node ports are
connected.  Currently the IXIA ports are excluded from this test because
they are matched explicitly with DUT ports in the ports.cfg file and the
traffic generator will not respond to pings in the usual fashion.

For the same reason, exclude T-Rex ports from ping6 matching and
connectivity testing. This avoids a traceback due to the T-Rex ports not
having enough available information to complete the ping6 check.

Tested-by: Ali Alnubani <alialnu at mellanox.com>
Signed-off-by: Patrick MacArthur <pmacarth at iol.unh.edu>
---
 framework/dut.py      |  4 ++--
 framework/tester.py   | 10 ++++++----
 framework/virt_dut.py |  2 +-
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/framework/dut.py b/framework/dut.py
index 31b3daaaebcb..5b72c7a523e3 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -980,13 +980,13 @@ class Dut(Crb):
 
     def disable_tester_ipv6(self):
         for tester_port in self.ports_map:
-            if self.tester.ports_info[tester_port]['type'] != 'ixia':
+            if self.tester.ports_info[tester_port]['type'].lower() not in ('ixia', 'trex'):
                 port = self.tester.ports_info[tester_port]['port']
                 port.disable_ipv6()
 
     def enable_tester_ipv6(self):
         for tester_port in range(len(self.tester.ports_info)):
-            if self.tester.ports_info[tester_port]['type'] != 'ixia':
+            if self.tester.ports_info[tester_port]['type'].lower() not in ('ixia', 'trex'):
                 port = self.tester.ports_info[tester_port]['port']
                 port.enable_ipv6()
 
diff --git a/framework/tester.py b/framework/tester.py
index 151200872338..be5b0e13897c 100755
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -200,7 +200,7 @@ class Tester(Crb):
         if localPort == -1:
             raise ParameterInvalidException("local port should not be -1")
 
-        if self.ports_info[localPort]['type'] == 'ixia':
+        if self.ports_info[localPort]['type'] in ('ixia', 'trex'):
             return "00:00:00:00:00:01"
         else:
             return self.ports_info[localPort]['mac']
@@ -305,7 +305,7 @@ class Tester(Crb):
             return
 
         for port_info in self.ports_info:
-            if port_info['type'] == 'ixia':
+            if port_info['type'].lower() in ('ixia', 'trex'):
                 continue
 
             addr_array = port_info['pci'].split(':')
@@ -394,7 +394,7 @@ class Tester(Crb):
         """
         Send ping6 packet from local port with destination ipv4 address.
         """
-        if self.ports_info[localPort]['type'] == 'ixia':
+        if self.ports_info[localPort]['type'].lower() in ('ixia', 'trex'):
             return "Not implemented yet"
         else:
             return self.send_expect("ping -w 5 -c 5 -A -I %s %s" % (self.ports_info[localPort]['intf'], ipv4), "# ", 10)
@@ -403,8 +403,10 @@ class Tester(Crb):
         """
         Send ping6 packet from local port with destination ipv6 address.
         """
-        if self.ports_info[localPort]['type'] == 'ixia':
+        if self.ports_info[localPort]['type'].lower() == 'ixia':
             return self.ixia_packet_gen.send_ping6(self.ports_info[localPort]['pci'], mac, ipv6)
+        elif self.ports_info[localPort]['type'].lower() == 'trex':
+            return "Not implemented yet"
         else:
             return self.send_expect("ping6 -w 5 -c 5 -A %s%%%s" % (ipv6, self.ports_info[localPort]['intf']), "# ", 10)
 
diff --git a/framework/virt_dut.py b/framework/virt_dut.py
index 62688dc83b9e..d4cd805d2a03 100644
--- a/framework/virt_dut.py
+++ b/framework/virt_dut.py
@@ -385,7 +385,7 @@ class VirtDut(DPDKdut):
                 remotepci = self.tester.ports_info[remotePort]['pci']
                 port_type = self.tester.ports_info[remotePort]['type']
                 # IXIA port should not check whether has vfs
-                if port_type != 'ixia':
+                if port_type.lower() not in ('ixia', 'trex'):
                     remoteport = self.tester.ports_info[remotePort]['port']
                     vfs = []
                     # vm_dut and tester in same dut
-- 
2.14.1



More information about the dts mailing list