From 4c1b6b2ea5cafcb07207ca07eb589fe34a6e5dd5 Mon Sep 17 00:00:00 2001 From: Toshiaki Takahashi Date: Wed, 25 Jul 2018 09:40:31 +0000 Subject: Fix test failure condition * Because the type of the variable res[3] is bool, we should not compare it with a string. * The expression "or 'None'" is always the same result, because 'None' is a constant value. It should be included in the comparison. Change-Id: I25defad98d612d21027218438ca2a28744292cf5 Signed-off-by: Toshiaki Takahashi --- baro_tests/collectd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baro_tests/collectd.py b/baro_tests/collectd.py index 2723d320..922403f1 100644 --- a/baro_tests/collectd.py +++ b/baro_tests/collectd.py @@ -867,7 +867,7 @@ def main(bt_logger=None): compute_ids, plugin_labels, aodh_plugin_labels, results, out_plugins) for res in results: - if res[3] is 'False' or 'None': + if not res[3]: logger.error('Some tests have failed or have not been executed') logger.error('Overall Result is Fail') return 1 -- cgit 1.2.3-korg