summaryrefslogtreecommitdiffstats
path: root/scripts/automation/regression/functional_unit_tests.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-01-05 15:22:22 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-01-05 15:22:22 +0200
commit823b8294539f2e55db09795a7fff03d7be6b6346 (patch)
tree149cdce761ead614409829d9ab1c2d9cdf680c4a /scripts/automation/regression/functional_unit_tests.py
parentfecdb3ea73b380e01a8877c8e88ce61e853000bc (diff)
move regression to trex-core
slight fixes of hltapi + vm in packet builder update yaml lib version from 3.01 to 3.11
Diffstat (limited to 'scripts/automation/regression/functional_unit_tests.py')
-rwxr-xr-xscripts/automation/regression/functional_unit_tests.py78
1 files changed, 78 insertions, 0 deletions
diff --git a/scripts/automation/regression/functional_unit_tests.py b/scripts/automation/regression/functional_unit_tests.py
new file mode 100755
index 00000000..30e915c4
--- /dev/null
+++ b/scripts/automation/regression/functional_unit_tests.py
@@ -0,0 +1,78 @@
+#!/router/bin/python
+
+__copyright__ = "Copyright 2014"
+
+
+
+import os
+import sys
+import outer_packages
+import nose
+from nose.plugins import Plugin
+import logging
+from rednose import RedNose
+import termstyle
+
+
+
+
+def set_report_dir (report_dir):
+ if not os.path.exists(report_dir):
+ os.mkdir(report_dir)
+
+if __name__ == "__main__":
+
+ # setting defaults. By default we run all the test suite
+ specific_tests = False
+ disableLogCapture = False
+ long_test = False
+ report_dir = "reports"
+
+ nose_argv= sys.argv + ['-s', '-v', '--exe', '--rednose', '--detailed-errors']
+
+# for arg in sys.argv:
+# if 'unit_tests/' in arg:
+# specific_tests = True
+# if 'log-path' in arg:
+# disableLogCapture = True
+# if arg=='--collect-only': # this is a user trying simply to view the available tests. removing xunit param from nose args
+# nose_argv[5:7] = []
+
+
+
+ try:
+ result = nose.run(argv = nose_argv, addplugins = [RedNose()])
+
+ if (result == True):
+ print termstyle.green("""
+ ..::''''::..
+ .;'' ``;.
+ :: :: :: ::
+ :: :: :: ::
+ :: :: :: ::
+ :: .:' :: :: `:. ::
+ :: : : ::
+ :: `:. .:' ::
+ `;..``::::''..;'
+ ``::,,,,::''
+
+ ___ ___ __________
+ / _ \/ _ | / __/ __/ /
+ / ___/ __ |_\ \_\ \/_/
+ /_/ /_/ |_/___/___(_)
+
+ """)
+ sys.exit(0)
+ else:
+ sys.exit(-1)
+
+ finally:
+ pass
+
+
+
+
+
+
+
+