teuthology-describe-tests -h
teuthology-describe-tests [options] [--] <suite_dir>
-Describe the contents of a qa suite by reading 'description' elements
-from yaml files in the suite.
+Describe the contents of a qa suite by reading 'meta' elements from
+yaml files in the suite.
-The 'description' element should contain a list with a dictionary
+The 'meta' element should contain a list with a dictionary
of key/value pairs for entries, i.e.:
-description:
+meta:
- field1: value1
field2: value2
field3: value3
Assumes fields are set in a format of:
- {'description': [{'field' : value, 'field2' : value2}]
+ {'meta': [{'field' : value, 'field2' : value2}]
or in yaml:
- description:
+ meta:
- field: value
field2: value2
- If description is present but not in this format, prints an error
+ If 'meta' is present but not in this format, prints an error
message and raises ParseError.
"""
empty_result = {f: '' for f in fields}
if not isinstance(parsed, dict):
return empty_result
- description = parsed.get('description', [{}])
- if not (isinstance(description, list) and
- len(description) == 1 and
- isinstance(description[0], dict)):
- print 'Error in description format in', file_name
- print 'Description must be a list containing exactly one dict.'
- print 'Description is:', description
+ meta = parsed.get('meta', [{}])
+ if not (isinstance(meta, list) and
+ len(meta) == 1 and
+ isinstance(meta[0], dict)):
+ print 'Error in meta format in', file_name
+ print 'Meta must be a list containing exactly one dict.'
+ print 'Meta is:', meta
raise ParseError()
- return {field: description[0].get(field, '') for field in fields}
+ return {field: meta[0].get(field, '') for field in fields}
def path_relative_to_suites(path):
"""Attempt to trim the ceph-qa-suite root directory from the beginning
'%': None,
'base': {
'install.yaml':
- """description:
+ """meta:
- desc: install ceph
install:
"""
},
'clusters': {
'fixed-1.yaml':
- """description:
+ """meta:
- desc: single node cluster
roles:
- [osd.0, osd.1, osd.2, mon.a, mon.b, mon.c, client.0]
},
'workloads': {
'rbd_api_tests_old_format.yaml':
- """description:
+ """meta:
- desc: c/c++ librbd api tests with format 1 images
rbd_features: none
overrides:
- rbd/test_librbd.sh
""",
'rbd_api_tests.yaml':
- """description:
+ """meta:
- desc: c/c++ librbd api tests with default settings
rbd_features: default
tasks:
def test_extract_info_dir():
- simple_fs = {'a': {'b.yaml': 'description: [{foo: c}]'}}
+ simple_fs = {'a': {'b.yaml': 'meta: [{foo: c}]'}}
_, _, fake_isdir, fake_open = make_fake_fstools(simple_fs)
info = extract_info('a', [], fake_isdir, fake_open)
assert info == {}
raise Exception(str(a))
def test_extract_info_too_many_elements():
- check_parse_error({'a.yaml': 'description: [{a: b}, {b: c}]'})
+ check_parse_error({'a.yaml': 'meta: [{a: b}, {b: c}]'})
def test_extract_info_not_a_list():
- check_parse_error({'a.yaml': 'description: {a: b}'})
+ check_parse_error({'a.yaml': 'meta: {a: b}'})
def test_extract_info_not_a_dict():
- check_parse_error({'a.yaml': 'description: [[a, b]]'})
+ check_parse_error({'a.yaml': 'meta: [[a, b]]'})
def test_extract_info_empty_file():
simple_fs = {'a.yaml': ''}