diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-04-14 17:23:04 +0300 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-04-14 17:23:04 +0300 |
commit | 501fb3b44f14e9c0d40a63bd8b47200b01e50be9 (patch) | |
tree | a45a01a5d0e724282f83df5b419916afd6784ca6 /scripts/automation/regression/stateless_tests | |
parent | e0720b15ec9dc695a8c1799e87cbe41a670cb616 (diff) |
regression: python3 support
Diffstat (limited to 'scripts/automation/regression/stateless_tests')
5 files changed, 11 insertions, 14 deletions
diff --git a/scripts/automation/regression/stateless_tests/stl_client_test.py b/scripts/automation/regression/stateless_tests/stl_client_test.py index 2611fb66..6308e203 100644 --- a/scripts/automation/regression/stateless_tests/stl_client_test.py +++ b/scripts/automation/regression/stateless_tests/stl_client_test.py @@ -1,5 +1,5 @@ #!/router/bin/python -from stl_general_test import CStlGeneral_Test, CTRexScenario +from .stl_general_test import CStlGeneral_Test, CTRexScenario from trex_stl_lib.api import * import os, sys import glob diff --git a/scripts/automation/regression/stateless_tests/stl_examples_test.py b/scripts/automation/regression/stateless_tests/stl_examples_test.py index 9e4fffc9..3f7d7b87 100755 --- a/scripts/automation/regression/stateless_tests/stl_examples_test.py +++ b/scripts/automation/regression/stateless_tests/stl_examples_test.py @@ -1,5 +1,5 @@ #!/router/bin/python -from stl_general_test import CStlGeneral_Test, CTRexScenario +from .stl_general_test import CStlGeneral_Test, CTRexScenario import os, sys from misc_methods import run_command @@ -28,6 +28,3 @@ class STLExamples_Test(CStlGeneral_Test): return_code, stdout, stderr = run_command("sh -c 'cd %s; %s %s -s %s'" % (examples_dir, sys.executable, example, CTRexScenario.configuration.trex['trex_name'])) assert return_code == 0, 'example %s failed.\nstdout: %s\nstderr: %s' % (return_code, stdout, stderr) - def test_stl_examples1(self): - print 'in test_stl_examples1' - diff --git a/scripts/automation/regression/stateless_tests/stl_general_test.py b/scripts/automation/regression/stateless_tests/stl_general_test.py index 64e93510..54388121 100644 --- a/scripts/automation/regression/stateless_tests/stl_general_test.py +++ b/scripts/automation/regression/stateless_tests/stl_general_test.py @@ -28,11 +28,11 @@ class CStlGeneral_Test(CTRexGeneral_Test): sys.stdout.write('.') sys.stdout.flush() self.stl_trex.connect() - print '' + print('') return True except: time.sleep(1) - print '' + print('') return False def map_ports(self, timeout = 5): @@ -42,10 +42,10 @@ class CStlGeneral_Test(CTRexGeneral_Test): sys.stdout.flush() CTRexScenario.stl_ports_map = stl_map_ports(self.stl_trex) if self.verify_bidirectional(CTRexScenario.stl_ports_map): - print '' + print('') return True time.sleep(1) - print '' + print('') return False # verify all the ports are bidirectional @@ -82,5 +82,5 @@ class STLBasic_Test(CStlGeneral_Test): CTRexScenario.stl_init_error = err if not self.map_ports(): self.fail(err) - print 'Got ports mapping: %s' % CTRexScenario.stl_ports_map + print('Got ports mapping: %s' % CTRexScenario.stl_ports_map) CTRexScenario.stl_init_error = None diff --git a/scripts/automation/regression/stateless_tests/stl_rx_test.py b/scripts/automation/regression/stateless_tests/stl_rx_test.py index bb682b6c..c55ee13e 100644 --- a/scripts/automation/regression/stateless_tests/stl_rx_test.py +++ b/scripts/automation/regression/stateless_tests/stl_rx_test.py @@ -1,5 +1,5 @@ #!/router/bin/python -from stl_general_test import CStlGeneral_Test, CTRexScenario +from .stl_general_test import CStlGeneral_Test, CTRexScenario from trex_stl_lib.api import * import os, sys @@ -86,7 +86,7 @@ class STLRX_Test(CStlGeneral_Test): # add both streams to ports self.c.add_streams([s1], ports = [self.tx_port]) - print "\ninjecting {0} packets on port {1}\n".format(total_pkts, self.tx_port) + print("\ninjecting {0} packets on port {1}\n".format(total_pkts, self.tx_port)) exp = {'pg_id': 5, 'total_pkts': total_pkts, 'pkt_len': self.pkt.get_pkt_len()} @@ -148,7 +148,7 @@ class STLRX_Test(CStlGeneral_Test): exp = {'pg_id': 5, 'total_pkts': total_pkts, 'pkt_len': self.pkt.get_pkt_len()} for i in range(0, 10): - print "starting iteration {0}".format(i) + print("starting iteration {0}".format(i)) self.__rx_iteration( [exp] ) diff --git a/scripts/automation/regression/stateless_tests/trex_client_pkg_test.py b/scripts/automation/regression/stateless_tests/trex_client_pkg_test.py index 6e2de230..64d5000e 100755 --- a/scripts/automation/regression/stateless_tests/trex_client_pkg_test.py +++ b/scripts/automation/regression/stateless_tests/trex_client_pkg_test.py @@ -1,5 +1,5 @@ #!/router/bin/python -from stl_general_test import CStlGeneral_Test, CTRexScenario +from .stl_general_test import CStlGeneral_Test, CTRexScenario from misc_methods import run_command from nose.plugins.attrib import attr |