From 0a3450ea3e63f9da7cc4eef0013fe28e48a55f36 Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Wed, 22 Sep 2021 13:30:30 +0200 Subject: [PATCH] generate-test-cases: don't leak "supported_arches" to compose request Unfortunately, after the addition of `supported_arches` item to some of the image type definitions in `format-request-map.json`, it started to leak to the `compose-request` object in the generated image test case. Ensure that the item does not leak to the generated image test case, since it is relevant only for the generator script. Signed-off-by: Tomas Hozza --- tools/test-case-generators/generate-test-cases | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/test-case-generators/generate-test-cases b/tools/test-case-generators/generate-test-cases index 85f069250..8a624396b 100755 --- a/tools/test-case-generators/generate-test-cases +++ b/tools/test-case-generators/generate-test-cases @@ -237,14 +237,18 @@ def main(distro, arch, image_types, keep_image_info, store, output, with_customi generate_test_case("customize", distro, arch, "qcow2", test_case_request, keep_image_info, store, output) return + filtered_test_case_request_items = [ + "overrides", + "supported_arches" + ] for output_format, test_case_request in format_request_dict.items(): - filtered_request = dict(filter(lambda i: i[0] != "overrides", test_case_request.items())) + filtered_request = dict(filter(lambda i: i[0] not in filtered_test_case_request_items, test_case_request.items())) if filtered_request["compose-request"]["image-type"] not in image_types: continue filtered_request["compose-request"]["distro"] = distro # if the compose-request has specified supported arches, then generate # the test case only if the requested arch is in the list - supported_arches = filtered_request.get("supported_arches") + supported_arches = test_case_request.get("supported_arches") if supported_arches is not None and arch not in supported_arches: continue filtered_request["compose-request"]["arch"] = arch