e35d5ed10e65de0d46a3f8a159cd7c8714ba5a41
[releng.git] / utils / test / scripts / conf_utils.py
1 import yaml
2
3
4 with open('./testcases.yaml') as f:
5     testcases_yaml = yaml.safe_load(f)
6 f.close()
7
8
9 def get_format(project, case):
10     testcases = testcases_yaml.get(project)
11     if isinstance(testcases, list):
12         for case_dict in testcases:
13             if case_dict['name'] == case:
14                 return 'format_' + case_dict['format'].strip()
15     return None
16
17
18 if __name__ == '__main__':
19     fmt = get_format('functest', 'vping_ssh')
20     print fmt