aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/n3xx_bist
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-07-27 15:36:06 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:04:00 -0800
commit8b4bc49764bc791aa431b7cc5c2bfc34afd5449b (patch)
tree9eb45b6c202d6f330f56f17eb405e362f319b486 /mpm/python/n3xx_bist
parentef6382c6ab869d19fd29191768d5a748343c2b69 (diff)
downloaduhd-8b4bc49764bc791aa431b7cc5c2bfc34afd5449b.tar.gz
uhd-8b4bc49764bc791aa431b7cc5c2bfc34afd5449b.tar.bz2
uhd-8b4bc49764bc791aa431b7cc5c2bfc34afd5449b.zip
n3xx bist: Added --verbose and --debug options
Diffstat (limited to 'mpm/python/n3xx_bist')
-rwxr-xr-xmpm/python/n3xx_bist21
1 files changed, 16 insertions, 5 deletions
diff --git a/mpm/python/n3xx_bist b/mpm/python/n3xx_bist
index e7a7d41e6..a05a08b3c 100755
--- a/mpm/python/n3xx_bist
+++ b/mpm/python/n3xx_bist
@@ -114,8 +114,16 @@ class N310BIST(object):
)
parser.add_argument(
'-n', '--dry-run', action='store_true',
- help="Fake out the tests. All tests will return a valid response," \
- " but will not actually interact with hardware.",
+ help="Fake out the tests. All tests will return a valid" \
+ " response, but will not actually interact with hardware.",
+ )
+ parser.add_argument(
+ '-v', '--verbose', action='store_true',
+ help="Crank up verbosity level",
+ )
+ parser.add_argument(
+ '--debug', action='store_true',
+ help="For debugging this tool.",
)
parser.add_argument(
'tests',
@@ -136,6 +144,9 @@ class N310BIST(object):
try:
# Keep this import here so we can do dry-runs without any MPM code
from usrp_mpm import get_main_logger
+ if not self.args.verbose:
+ from usrp_mpm.mpmlog import WARNING
+ get_main_logger().setLevel(WARNING)
self.log = get_main_logger().getChild('main')
except ImportError:
pass
@@ -177,18 +188,18 @@ class N310BIST(object):
sys.stderr.write("Test not defined: {}\n".format(testname))
return False, {}
except Exception as ex:
- raise
sys.stderr.write(
"Test {} failed to execute: {}\n".format(testname, str(ex))
)
+ if self.args.debug:
+ raise
return False, {'error_msg': str(ex)}
tests_successful = True
result = {}
for test in self.tests_to_run:
status, result_data = execute_test(test)
tests_successful = tests_successful and status
- if tests_successful:
- result[test] = result_data
+ result[test] = result_data
post_results(result)
return tests_successful