MCPcopy Create free account
hub / github.com/ceph/ceph / test_object_wrapper

Function test_object_wrapper

qa/workunits/dencoder/test_readable.py:98–133  ·  view source on GitHub ↗
(type, vdir, arversion, current_ver)

Source from the content-addressed store, hash-verified

96 return 0 # File passed the test
97
98def test_object_wrapper(type, vdir, arversion, current_ver):
99 _numtests = 0
100 _failed = 0
101 unrecognized = ""
102
103 if subprocess.call([CEPH_DENCODER, "type", type], stderr=subprocess.DEVNULL) == 0:
104
105 if should_skip_object(type, arversion, current_ver):
106 debug_print(f"skipping object of type {type} due to backward incompatibility")
107 return (_numtests, _failed, unrecognized)
108 if type in incompat_paths:
109 debug_print(f"skipping object of type {type} it is in incompat paths")
110 return (_numtests, _failed, unrecognized)
111
112 debug_print(f" {vdir}/objects/{type}")
113 files = list(vdir.joinpath("objects", type).glob('*'))
114 files_without_incompat = []
115
116 # Check symbolic links
117 if type in incompat_paths:
118 incompatible_files = set(incompat_paths[type])
119 files_without_incompat = [f for f in files if f.name not in incompatible_files]
120 else:
121 files_without_incompat = files
122
123 with concurrent.futures.ThreadPoolExecutor() as executor:
124 results = [executor.submit(process_type, f, type) for f in files_without_incompat]
125
126 for result in concurrent.futures.as_completed(results):
127 _numtests += 1
128 _failed += result.result()
129 else:
130 unrecognized = type
131 debug_print("skipping unrecognized type {} return {}".format(type, (_numtests, _failed, unrecognized)))
132
133 return (_numtests, _failed, unrecognized)
134
135def parse_version(version):
136 """

Callers

nothing calls this directly

Calls 8

should_skip_objectFunction · 0.85
debug_printFunction · 0.85
listFunction · 0.50
setFunction · 0.50
callMethod · 0.45
submitMethod · 0.45
resultMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected