summaryrefslogtreecommitdiffstats
path: root/scripts/automation/regression/stateless_tests/stl_examples_test.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-05-23 15:30:21 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-05-23 15:30:21 +0300
commitd279c8c12f136ab15b5fefd496c296ef1585c628 (patch)
treebeca6adbe9152141453d015e041f49e8982202b9 /scripts/automation/regression/stateless_tests/stl_examples_test.py
parent131be7a0a855f2c027d28060ab6a42cbeddc69da (diff)
replace t-rex to TRex
regression: instead of checking map and reconnecting for eact STL test, do in only for those with disconnect (+revert of commit 0f8e6065f467703b1461e87c3912f8d4bd616807)
Diffstat (limited to 'scripts/automation/regression/stateless_tests/stl_examples_test.py')
-rwxr-xr-xscripts/automation/regression/stateless_tests/stl_examples_test.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/scripts/automation/regression/stateless_tests/stl_examples_test.py b/scripts/automation/regression/stateless_tests/stl_examples_test.py
index 283635a7..d8b85dfc 100755
--- a/scripts/automation/regression/stateless_tests/stl_examples_test.py
+++ b/scripts/automation/regression/stateless_tests/stl_examples_test.py
@@ -2,23 +2,22 @@
from .stl_general_test import CStlGeneral_Test, CTRexScenario
import os, sys
from misc_methods import run_command
-from time import sleep
-def setUpModule(self):
- # examples connect by their own
- if CTRexScenario.stl_trex.is_connected():
- CTRexScenario.stl_trex.disconnect()
- sleep(3)
-
-def tearDownModule():
- # connect back at end of tests
- if not CTRexScenario.stl_trex.is_connected():
- CTRexScenario.stl_trex.connect()
+class STLExamples_Test(CStlGeneral_Test):
+ """This class defines the IMIX testcase of the TRex traffic generator"""
+ def explicitSetUp(self):
+ # examples connect by their own
+ if self.is_connected():
+ self.recover_after_trex_210_issue()
+ CTRexScenario.stl_trex.disconnect()
-class STLExamples_Test(CStlGeneral_Test):
- """This class defines the IMIX testcase of the T-Rex traffic generator"""
+ def explicitTearDown(self):
+ # connect back at end of tests
+ if not self.is_connected():
+ self.stl_trex.connect()
+ self.recover_after_trex_210_issue()
def test_stl_examples(self):
examples_dir = '../trex_control_plane/stl/examples'
@@ -27,6 +26,8 @@ class STLExamples_Test(CStlGeneral_Test):
]
for example in examples_to_test:
+ self.explicitSetUp()
return_code, stdout, stderr = run_command("sh -c 'cd %s; %s %s -s %s'" % (examples_dir, sys.executable, example, CTRexScenario.configuration.trex['trex_name']))
+ self.explicitTearDown()
assert return_code == 0, 'example %s failed.\nstdout: %s\nstderr: %s' % (return_code, stdout, stderr)