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

@ -1,10 +1,18 @@
{
"sources": {},
"pipeline": {
"stages": [
{
"name": "org.osbuild.noop"
}
]
"version": "2",
"pipelines": [
{
"name": "tree",
"stages": [
{
"type": "org.osbuild.noop"
}
]
}
],
"sources": {
"org.osbuild.curl": {
"items": {}
}
}
}

View file

@ -0,0 +1,5 @@
version: '2'
pipelines:
- name: tree
stages:
- type: org.osbuild.noop

File diff suppressed because it is too large Load diff

View file

@ -1,19 +1,32 @@
pipeline:
build:
mpp-import-pipeline:
path: ../manifests/f34-build.json
runner: org.osbuild.fedora34
stages:
- name: org.osbuild.rpm
options:
gpgkeys:
- "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBF1RVqsBEADWMBqYv/G1r4PwyiPQCfg5fXFGXV1FCZ32qMi9gLUTv1CX7rYy\nH4Inj93oic+lt1kQ0kQCkINOwQczOkm6XDkEekmMrHknJpFLwrTK4AS28bYF2RjL\nM+QJ/dGXDMPYsP0tkLvoxaHr9WTRq89A+AmONcUAQIMJg3JxXAAafBi2UszUUEPI\nU35MyufFt2ePd1k/6hVAO8S2VT72TxXSY7Ha4X2J0pGzbqQ6Dq3AVzogsnoIi09A\n7fYutYZPVVAEGRUqavl0th8LyuZShASZ38CdAHBMvWV4bVZghd/wDV5ev3LXUE0o\nitLAqNSeiDJ3grKWN6v0qdU0l3Ya60sugABd3xaE+ROe8kDCy3WmAaO51Q880ZA2\niXOTJFObqkBTP9j9+ZeQ+KNE8SBoiH1EybKtBU8HmygZvu8ZC1TKUyL5gwGUJt8v\nergy5Bw3Q7av520sNGD3cIWr4fBAVYwdBoZT8RcsnU1PP67NmOGFcwSFJ/LpiO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EY BLOCK-----\n"
mpp-depsolve:
architecture: x86_64
module-platform-id: f34
baseurl: https://rpmrepo.osbuild.org/v2/mirror/public/f34/f34-x86_64-fedora-20210512/
repos:
- id: default
baseurl: https://rpmrepo.osbuild.org/v2/mirror/public/f34/f34-x86_64-fedora-20210512/
# Generate metadata.json with:
# sudo osbuild --export tree --output-directory /tmp/devnull test/data/stages/rpm/b.json --json | jq .metadata >test/data/stages/rpm/metadata.json
version: '2'
pipelines:
- mpp-import-pipelines:
path: ../manifests/fedora-vars.ipp.yaml
- mpp-import-pipeline:
path: ../manifests/fedora-build-v2.ipp.yaml
id: build
runner:
mpp-format-string: org.osbuild.fedora{release}
- name: tree
build: name:build
stages:
- type: org.osbuild.rpm
inputs:
packages:
- fedora-gpg-keys
type: org.osbuild.files
origin: org.osbuild.source
mpp-depsolve:
architecture: $arch
module-platform-id: $module_platform_id
repos:
mpp-eval: repos
packages:
- fedora-gpg-keys
options:
gpgkeys:
mpp-eval: gpgkeys
exclude:
docs: true

View file

@ -1,19 +1,11 @@
{
"added_files": [
"/var",
"/var/lib",
"/var/lib/rpm",
"/var/lib/rpm/.rpm.lock",
"/var/lib/rpm/rpmdb.sqlite",
"/var/lib/rpm/rpmdb.sqlite-shm",
"/var/lib/rpm/rpmdb.sqlite-wal",
"/sys",
"/dev",
"/etc",
"/etc/machine-id",
"/etc/pki",
"/etc/pki/rpm-gpg",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-34-fedora",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-38-fedora",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-10-i386",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-10-ppc",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-10-ppc64",
@ -227,6 +219,27 @@
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-36-primary",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-36-s390x",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-36-x86_64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-37-aarch64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-37-armhfp",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-37-ppc64le",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-37-primary",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-37-s390x",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-37-x86_64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-38-aarch64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-38-ppc64le",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-38-primary",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-38-s390x",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-38-x86_64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-39-aarch64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-39-ppc64le",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-39-primary",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-39-s390x",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-39-x86_64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-40-aarch64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-40-ppc64le",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-40-primary",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-40-s390x",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-40-x86_64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-7-i386",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-7-ppc",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-7-ppc64",
@ -247,7 +260,6 @@
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-9-secondary",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-9-x86_64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-eln-aarch64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-eln-armhfp",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-eln-ppc64le",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-eln-primary",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-eln-s390x",
@ -261,12 +273,20 @@
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-iot-x86_64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-modularity",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-rawhide-aarch64",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-rawhide-armhfp",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-rawhide-ppc64le",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-rawhide-primary",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-rawhide-s390x",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-rawhide-x86_64",
"/proc"
"/proc",
"/sys",
"/usr",
"/usr/lib",
"/usr/lib/sysimage",
"/usr/lib/sysimage/rpm",
"/usr/lib/sysimage/rpm/.rpm.lock",
"/usr/lib/sysimage/rpm/rpmdb.sqlite",
"/usr/lib/sysimage/rpm/rpmdb.sqlite-shm",
"/usr/lib/sysimage/rpm/rpmdb.sqlite-wal"
],
"deleted_files": [],
"differences": {}

File diff suppressed because it is too large Load diff

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