test/run/rpm: convert to v2 manifest

This gets rid of the old F34 manifest and migrates the to test to the
standardized V2 one based on F38.

Since the metadata format is much saner in V2, I was able to simplify the
assertion quite a lot.
This commit is contained in:
Ondřej Budai 2023-09-01 13:52:01 +02:00 committed by Brian C. Lane
parent e4933b4fd6
commit 60a1570383
7 changed files with 5048 additions and 3030 deletions

View file

@ -196,29 +196,6 @@ class TestStages(test.TestBase):
and difference1_values[1] != difference2_values[1]:
raise_assertion(f"after values are different: {difference1_values[1]}, {difference2_values[1]}")
def assertMetadata(self, metadata: Dict, result: Dict):
"""Assert all of `metadata` is found in `result`.
Metadata must be a dictionary with stage ids as keys and
the metadata as values. For each of those stage, metadata
pairs the corresponding stage is looked up in the result
and its metadata compared with the one given in metadata.
"""
for stageid, want in metadata.items():
stage = find_stage(result, stageid)
if stage is None:
js = json.dumps(result, indent=2)
self.fail(f"stage {stageid} not found in results:\n{js}\n")
have = stage["metadata"]
if have != want:
diff = difflib.ndiff(pprint.pformat(have).splitlines(),
pprint.pformat(want).splitlines())
txt = "\n".join(diff)
path = f"/tmp/osbuild.metadata.{stageid}.json"
with open(path, "w", encoding="utf8") as f:
json.dump(have, f, indent=2)
self.fail(f"metadata for {stageid} differs:\n{txt}\n{path}")
@classmethod
def setUpClass(cls):
cls.store = os.getenv("OSBUILD_TEST_STORE")
@ -262,7 +239,7 @@ class TestStages(test.TestBase):
with open(md_path, "r", encoding="utf8") as f:
metadata = json.load(f)
self.assertMetadata(metadata, res)
self.assertEqual(metadata, res["metadata"])
# cache the downloaded data for the sources by copying
# it to self.cache, which is going to be used to initialize