diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-03-09 14:05:08 +0200 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-03-09 14:05:08 +0200 |
commit | 2258ea303c6c3573998dea7b9d347d46873018db (patch) | |
tree | ff446df4df551ec8efce7ace69f8ea029fd0996d /scripts/automation/regression/stateless_tests/stl_examples_test.py | |
parent | bcf08b4e5715029ccfa54d22b0d5875b4c7cda78 (diff) |
regression: stl updates
Diffstat (limited to 'scripts/automation/regression/stateless_tests/stl_examples_test.py')
-rwxr-xr-x | scripts/automation/regression/stateless_tests/stl_examples_test.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/automation/regression/stateless_tests/stl_examples_test.py b/scripts/automation/regression/stateless_tests/stl_examples_test.py new file mode 100755 index 00000000..080bb3d3 --- /dev/null +++ b/scripts/automation/regression/stateless_tests/stl_examples_test.py @@ -0,0 +1,35 @@ +#!/router/bin/python +from stl_general_test import CStlGeneral_Test, CTRexScenario +import os, sys +from misc_methods import run_command + +class STLExamples_Test(CStlGeneral_Test): + """This class defines the IMIX testcase of the T-Rex traffic generator""" + + def setUp(self): + print 'STLExamples_Test setUp' + CStlGeneral_Test.setUp(self) + # examples connect by their own + if self.is_connected(): + CTRexScenario.stl_trex.disconnect() + + @classmethod + def tearDownClass(cls): + print 'STLExamples_Test tearDownClass' + # connect back at end of tests + if not cls.is_connected(): + CTRexScenario.stl_trex.connect() + + def test_stl_examples(self): + examples_dir = '../trex_control_plane/stl/examples' + examples_to_test = [ + 'stl_imix.py', + ] + + for example in examples_to_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' + |