diff options
author | 2016-03-06 13:24:25 +0200 | |
---|---|---|
committer | 2016-03-06 13:25:00 +0200 | |
commit | 7143d71c90df1f9909f6b8a4d7d91a7a22340f68 (patch) | |
tree | b28710e3f07f75117821cdcd01e837b8563c49de /scripts/automation/trex_control_plane/stl/trex_stl_lib | |
parent | b5cf4165ac6ca8e3a56a2f4f6bb4b28cfab33c98 (diff) |
1. blazing fast regression
2. API checks for Python version
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/__init__.py | 10 | ||||
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py | 11 |
2 files changed, 16 insertions, 5 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/__init__.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/__init__.py index 60bf7be8..8488a80a 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/__init__.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/__init__.py @@ -1 +1,11 @@ +import sys + +if sys.version_info < (2, 7): + print("\n**** TRex STL pacakge requires Python version >= 2.7 ***\n") + exit(-1) + +if sys.version_info >= (3, 0): + print("\n**** TRex STL pacakge does not support Python 3 (yet) ***\n") + exit(-1) + import trex_stl_ext diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py index abfdd9bc..395c5864 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py @@ -428,9 +428,9 @@ def validate_args (parser, options): parser.error("limit cannot be lower than number of DP cores") -def main (): +def main (args = None): parser = setParserOptions() - options = parser.parse_args() + options = parser.parse_args(args = args) validate_args(parser, options) @@ -466,13 +466,14 @@ def main (): except KeyboardInterrupt as e: print "\n\n*** Caught Ctrl + C... Exiting...\n\n" - exit(1) + return (-1) except STLError as e: print e - exit(1) + return (-1) + + return (0) - exit(0) if __name__ == '__main__': main() |