summaryrefslogtreecommitdiffstats
path: root/baro_tests
diff options
context:
space:
mode:
authorSharada Shiddibhavi <sharada.shiddibhavi@intel.com>2017-10-05 05:19:19 +0000
committerSharada Shiddibhavi <sharada.shiddibhavi@intel.com>2017-10-05 21:01:49 +0000
commit47b77018cde65b57a65faa1398e96918430415fb (patch)
tree900ef48e4ef3382058cd1665fe274d472d7db270 /baro_tests
parent3078905c7a7ea7a1c6c3ef868af0afafd37e8dac (diff)
Removing collectd restart process before Gnocchi test
In this patch we remove the step of restarting collectd before Gnocchi test and adding it only before CSV testing. This also has fix to functest result status at the end of test execution. Change-Id: I2113ce8c5234535ab6f8d8c524038ead39e6df38 Signed-off-by: Sharada Shiddibhavi <sharada.shiddibhavi@intel.com>
Diffstat (limited to 'baro_tests')
-rw-r--r--baro_tests/collectd.py58
1 files changed, 32 insertions, 26 deletions
diff --git a/baro_tests/collectd.py b/baro_tests/collectd.py
index 3cd55bf1..f07b4cea 100644
--- a/baro_tests/collectd.py
+++ b/baro_tests/collectd.py
@@ -11,6 +11,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+# Patch on October 05 2017
"""Executing test of plugins"""
@@ -787,7 +788,6 @@ def main(bt_logger=None):
out_plugins[node_id].append("SNMP")
if 'Gnocchi' in out_plugins[node_id]:
- logger.info("CSV will be enabled for verification")
plugins_to_enable.append('csv')
out_plugins[node_id].append("CSV")
if plugins_to_enable:
@@ -802,36 +802,40 @@ def main(bt_logger=None):
logger.info(
'Testcases on node {} will not be executed'.format(
node_id))
- else:
- if plugins_to_enable:
- collectd_restarted, collectd_warnings = \
- conf.restart_collectd(compute_node)
- sleep_time = 10
- logger.info(
- 'Sleeping for {} seconds'.format(sleep_time)
- + ' after collectd restart...')
- time.sleep(sleep_time)
- if plugins_to_enable and not collectd_restarted:
+
+ for i in out_plugins[node_id]:
+ if i == 'AODH':
+ for plugin_name in sorted(aodh_plugin_labels.keys()):
+ _exec_testcase(
+ aodh_plugin_labels, plugin_name, i,
+ controllers, compute_node, conf, results,
+ error_plugins, out_plugins[node_id])
+ elif i == 'CSV':
+ _print_label("Node {}: Executing CSV Testcases".format(
+ node_name))
+ logger.info("Restarting collectd for CSV tests")
+ collectd_restarted, collectd_warnings = \
+ conf.restart_collectd(compute_node)
+ sleep_time = 10
+ logger.info(
+ 'Sleeping for {} seconds'.format(sleep_time)
+ + ' after collectd restart...')
+ time.sleep(sleep_time)
+ if not collectd_restarted:
for warning in collectd_warnings:
logger.warning(warning)
logger.error(
'Restart of collectd on node {} failed'.format(
- node_id))
+ compute_node))
logger.info(
- 'Testcases on node {}'.format(node_id)
+ 'CSV Testcases on node {}'.format(compute_node)
+ ' will not be executed.')
- else:
- if collectd_warnings:
- for warning in collectd_warnings:
- logger.warning(warning)
-
- for i in out_plugins[node_id]:
- if i == 'AODH':
- for plugin_name in sorted(aodh_plugin_labels.keys()):
+ for plugin_name in sorted(plugin_labels.keys()):
_exec_testcase(
- aodh_plugin_labels, plugin_name, i,
+ plugin_labels, plugin_name, i,
controllers, compute_node, conf, results,
error_plugins, out_plugins[node_id])
+
else:
for plugin_name in sorted(plugin_labels.keys()):
_exec_testcase(
@@ -843,10 +847,12 @@ def main(bt_logger=None):
print_overall_summary(
compute_ids, plugin_labels, aodh_plugin_labels, results, out_plugins)
- if ((len([res for res in results if not res[2]]) > 0)
- or (len(results) < len(computes) * len(plugin_labels))):
- logger.error('Some tests have failed or have not been executed')
- return 1
+ for res in results:
+ if res[3] is 'False' or 'None':
+ logger.error('Some tests have failed or have not been executed')
+ return 1
+ else:
+ pass
return 0