aboutsummaryrefslogtreecommitdiffstats
path: root/src/collectd/collectd_sample_configs/exec.conf
blob: 0a291bdbfa20c2b9a43e59f811c8d29ea8692ba2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright 2017 OPNFV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
LoadPlugin exec

<Plugin exec>
     # For OVS PMD stats plugin
     Exec "collectd_exec" "/opt/collectd/etc/collectd.conf.d/ovs_pmd_stats.sh"
     NotificationExec "collectd_exec" "/opt/collectd/etc/collectd.conf.d/write_notification.sh"
</Plugin>
"c1"># which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 # import yaml import tier_handler as th class TierBuilder: def __init__(self, ci_installer, ci_scenario, testcases_file): self.ci_installer = ci_installer self.ci_scenario = ci_scenario self.testcases_file = testcases_file self.dic_tier_array = None self.tier_objects = [] self.testcases_yaml = None self.generate_tiers() def read_test_yaml(self): with open(self.testcases_file) as f: self.testcases_yaml = yaml.safe_load(f) self.dic_tier_array = [] for tier in self.testcases_yaml.get("tiers"): self.dic_tier_array.append(tier) def generate_tiers(self): if self.dic_tier_array is None: self.read_test_yaml() del self.tier_objects[:] for dic_tier in self.dic_tier_array: tier = th.Tier(name=dic_tier['name'], order=dic_tier['order'], ci_loop=dic_tier['ci_loop'], description=dic_tier['description']) for dic_testcase in dic_tier['testcases']: installer = dic_testcase['dependencies']['installer'] scenario = dic_testcase['dependencies']['scenario'] dep = th.Dependency(installer, scenario) testcase = th.TestCase(name=dic_testcase['name'], dependency=dep, criteria=dic_testcase['criteria'], description=dic_testcase['description']) if testcase.is_compatible(self.ci_installer, self.ci_scenario): tier.add_test(testcase) self.tier_objects.append(tier) def get_tiers(self): return self.tier_objects def get_tier_names(self): tier_names = [] for tier in self.tier_objects: tier_names.append(tier.get_name()) return tier_names def get_tier(self, tier_name): for i in range(0, len(self.tier_objects)): if self.tier_objects[i].get_name() == tier_name: return self.tier_objects[i] return None def get_test(self, test_name): for i in range(0, len(self.tier_objects)): if self.tier_objects[i].is_test(test_name): return self.tier_objects[i].get_test(test_name) return None def get_tests(self, tier_name): for i in range(0, len(self.tier_objects)): if self.tier_objects[i].get_name() == tier_name: return self.tier_objects[i].get_tests() return None def __str__(self): output = "" for i in range(0, len(self.tier_objects)): output += str(self.tier_objects[i]) + "\n" return output