stages/rpm: adapt to use the files source
Drop the rpm downloading and instead use the files source. This gives us caching for free, and is the last missing step before we can deprecate the dnf stage. The main benefit of the rpm over the dnf stage is that we pin the package versions rather than the repo metadata version. This will allow us to support continuously changing repositories as individual packages are much less likely to change than the repos iteself, and old packages are meant to stay around for some time, unlike the repo metadata which is instantly swapped out. Depsolving is also slow on the first run, which we were always hitting as the depsolving was always happening in a fresh container. Based on a patch by Lars Karlitski. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
be0ff68411
commit
1d588b8e86
6 changed files with 330 additions and 71 deletions
|
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import concurrent.futures
|
||||
import contextlib
|
||||
import json
|
||||
import os
|
||||
|
|
@ -9,18 +8,19 @@ import subprocess
|
|||
import sys
|
||||
import tempfile
|
||||
|
||||
STAGE_DESC = "Download, verify, and install RPM packages"
|
||||
import osbuild.sources
|
||||
|
||||
STAGE_DESC = "Verify, and install RPM packages"
|
||||
STAGE_INFO = """
|
||||
Download, verify, and install RPM packages.
|
||||
Verify, and install RPM packages.
|
||||
|
||||
`gpgkeys` should be an array of strings containing each GPG key to be used
|
||||
to verify the downloaded packages.
|
||||
to verify the packages.
|
||||
|
||||
`packages` is an array of objects; each item must have a `url` to download
|
||||
the .rpm file and a `checksum` to verify the integrity of the downloaded
|
||||
data.
|
||||
`packages` is an array of RPM checksums. Specifically, the content hash of
|
||||
the rpms, not the chucksums found in the rpm header.
|
||||
|
||||
This stage will fail if any of URLs can't be reached, or if any downloaded
|
||||
This stage will fail if any of the packages can't be found, or if any
|
||||
RPM has a signature or digest that cannot be verified.
|
||||
|
||||
NOTE: this stage currently does _not_ fail if a package is unsigned, only if
|
||||
|
|
@ -29,8 +29,6 @@ of this stage will fail on unsigned packages by default, but may support a
|
|||
flag to skip signature checks for packages that are known to be unsigned.
|
||||
|
||||
Uses the following binaries from the host:
|
||||
* `curl` to fetch RPMs
|
||||
* `sha256sum` (or `sha1sum`, `md5sum`, etc.) to check RPM checksums
|
||||
* `rpmkeys` to import keys and to verify signatures for each package
|
||||
* `sh`, `mkdir`, `mount`, `chmod` to prepare the target tree for `rpm`
|
||||
* `rpm` to install packages into the target tree
|
||||
|
|
@ -43,76 +41,30 @@ STAGE_OPTS = """
|
|||
"items": { "type": "string" }
|
||||
},
|
||||
"packages": {
|
||||
"description": "Array of package objects",
|
||||
"description": "Array of RPM content hashes",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["url", "checksum"],
|
||||
"properties": {
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": "URL to download a .rpm package file"
|
||||
},
|
||||
"checksum": {
|
||||
"type": "string",
|
||||
"description": ".rpm file checksum, prefixed with 'md5:', 'sha1:', 'sha256:', 'sha384:', or 'sha512:', indicating the algorithm used."
|
||||
}
|
||||
}
|
||||
"type": "string",
|
||||
"description": ".rpm file checksum, prefixed with 'md5:', 'sha1:', 'sha256:', 'sha384:', or 'sha512:', indicating the algorithm used."
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
RPM_CACHE_DIR = "/var/cache/org.osbuild.rpm"
|
||||
|
||||
|
||||
def download_package(pkg):
|
||||
# some mirrors are broken sometimes. retry manually, because curl doesn't on 404
|
||||
for _ in range(3):
|
||||
curl = subprocess.run([
|
||||
"curl",
|
||||
"--silent",
|
||||
"--show-error",
|
||||
"--fail",
|
||||
"--location",
|
||||
"--remote-name",
|
||||
"--write-out", "%{filename_effective}",
|
||||
pkg["url"]
|
||||
], encoding="utf-8", cwd=RPM_CACHE_DIR, stdout=subprocess.PIPE, check=False)
|
||||
|
||||
if curl.returncode == 0:
|
||||
filename = curl.stdout.strip()
|
||||
break
|
||||
else:
|
||||
raise RuntimeError(f"Error downloading {pkg['url']}")
|
||||
|
||||
algorithm, checksum = pkg["checksum"].strip().split(":", 1)
|
||||
if algorithm not in ("md5", "sha1", "sha256", "sha384", "sha512"):
|
||||
raise RuntimeError(f"Unsupported checksum algorithm: {algorithm}")
|
||||
|
||||
subprocess.run(
|
||||
[f"{algorithm}sum", "-c"],
|
||||
cwd=RPM_CACHE_DIR,
|
||||
input=f"{checksum} {filename}",
|
||||
stdout=subprocess.DEVNULL,
|
||||
encoding="utf-8",
|
||||
check=True)
|
||||
|
||||
|
||||
return filename
|
||||
|
||||
|
||||
def main(tree, options):
|
||||
def main(tree, sources, options):
|
||||
packages = options.get("packages", [])
|
||||
for key in options.get("gpgkeys", []):
|
||||
with tempfile.NamedTemporaryFile(prefix="gpgkey.") as keyfile:
|
||||
with tempfile.NamedTemporaryFile(prefix="gpgkey.", mode="w") as keyfile:
|
||||
keyfile.write(key)
|
||||
keyfile.flush()
|
||||
subprocess.run(["rpmkeys", "--import", keyfile.name], check=True)
|
||||
subprocess.run([
|
||||
"rpmkeys",
|
||||
"--root", tree,
|
||||
"--import", keyfile.name
|
||||
], check=True)
|
||||
|
||||
os.makedirs(RPM_CACHE_DIR)
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
|
||||
packages = executor.map(download_package, options["packages"])
|
||||
osbuild.sources.get("org.osbuild.files", packages)
|
||||
|
||||
script = f"""
|
||||
set -e
|
||||
|
|
@ -144,7 +96,7 @@ def main(tree, options):
|
|||
# (see /usr/lib/rpm/macros for more info)
|
||||
"--define", "_pkgverify_level all",
|
||||
"--install", manifest.name
|
||||
], cwd=RPM_CACHE_DIR, check=True)
|
||||
], cwd=f"{sources}/org.osbuild.files", check=True)
|
||||
|
||||
# remove temporary machine ID if it was created by us
|
||||
if not machine_id_set_previously:
|
||||
|
|
@ -162,5 +114,5 @@ def main(tree, options):
|
|||
|
||||
if __name__ == '__main__':
|
||||
args = json.load(sys.stdin)
|
||||
r = main(args["tree"], args["options"])
|
||||
r = main(args["tree"], args["sources"], args["options"])
|
||||
sys.exit(r)
|
||||
|
|
|
|||
|
|
@ -6,5 +6,10 @@
|
|||
"gpgkey": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBFturGcBEACv0xBo91V2n0uEC2vh69ywCiSyvUgN/AQH8EZpCVtM7NyjKgKm\nbbY4G3R0M3ir1xXmvUDvK0493/qOiFrjkplvzXFTGpPTi0ypqGgxc5d0ohRA1M75\nL+0AIlXoOgHQ358/c4uO8X0JAA1NYxCkAW1KSJgFJ3RjukrfqSHWthS1d4o8fhHy\nKJKEnirE5hHqB50dafXrBfgZdaOs3C6ppRIePFe2o4vUEapMTCHFw0woQR8Ah4/R\nn7Z9G9Ln+0Cinmy0nbIDiZJ+pgLAXCOWBfDUzcOjDGKvcpoZharA07c0q1/5ojzO\n4F0Fh4g/BUmtrASwHfcIbjHyCSr1j/3Iz883iy07gJY5Yhiuaqmp0o0f9fgHkG53\n2xCU1owmACqaIBNQMukvXRDtB2GJMuKa/asTZDP6R5re+iXs7+s9ohcRRAKGyAyc\nYKIQKcaA+6M8T7/G+TPHZX6HJWqJJiYB+EC2ERblpvq9TPlLguEWcmvjbVc31nyq\nSDoO3ncFWKFmVsbQPTbP+pKUmlLfJwtb5XqxNR5GEXSwVv4I7IqBmJz1MmRafnBZ\ng0FJUtH668GnldO20XbnSVBr820F5SISMXVwCXDXEvGwwiB8Lt8PvqzXnGIFDAu3\nDlQI5sxSqpPVWSyw08ppKT2Tpmy8adiBotLfaCFl2VTHwOae48X2dMPBvQARAQAB\ntDFGZWRvcmEgKDMwKSA8ZmVkb3JhLTMwLXByaW1hcnlAZmVkb3JhcHJvamVjdC5v\ncmc+iQI4BBMBAgAiBQJbbqxnAhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAK\nCRDvPBEfz8ZZudTnD/9170LL3nyTVUCFmBjT9wZ4gYnpwtKVPa/pKnxbbS+Bmmac\ng9TrT9pZbqOHrNJLiZ3Zx1Hp+8uxr3Lo6kbYwImLhkOEDrf4aP17HfQ6VYFbQZI8\nf79OFxWJ7si9+3gfzeh9UYFEqOQfzIjLWFyfnas0OnV/P+RMQ1Zr+vPRqO7AR2va\nN9wg+Xl7157dhXPCGYnGMNSoxCbpRs0JNlzvJMuAea5nTTznRaJZtK/xKsqLn51D\nK07k9MHVFXakOH8QtMCUglbwfTfIpO5YRq5imxlWbqsYWVQy1WGJFyW6hWC0+RcJ\nOx5zGtOfi4/dN+xJ+ibnbyvy/il7Qm+vyFhCYqIPyS5m2UVJUuao3eApE38k78/o\n8aQOTnFQZ+U1Sw+6woFTxjqRQBXlQm2+7Bt3bqGATg4sXXWPbmwdL87Ic+mxn/ml\nSMfQux/5k6iAu1kQhwkO2YJn9eII6HIPkW+2m5N1JsUyJQe4cbtZE5Yh3TRA0dm7\n+zoBRfCXkOW4krchbgww/ptVmzMMP7GINJdROrJnsGl5FVeid9qHzV7aZycWSma7\nCxBYB1J8HCbty5NjtD6XMYRrMLxXugvX6Q4NPPH+2NKjzX4SIDejS6JjgrP3KA3O\npMuo7ZHMfveBngv8yP+ZD/1sS6l+dfExvdaJdOdgFCnp4p3gPbw5+Lv70HrMjA==\n=BfZ/\n-----END PGP PUBLIC KEY BLOCK-----\n"
|
||||
}
|
||||
}
|
||||
},
|
||||
"org.osbuild.files": {
|
||||
"urls": {
|
||||
"sha256:3fbe971c4e0737df9dd0484ec48f294df693631bfe3be89cba01e147a5eec140": "http://fedora.uib.no/fedora/linux/releases/30/Everything/x86_64/os/Packages/f/fedora-gpg-keys-30-1.noarch.rpm"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
test/stages_tests/rpm/a.json
Normal file
2
test/stages_tests/rpm/a.json
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{
|
||||
}
|
||||
36
test/stages_tests/rpm/b.json
Normal file
36
test/stages_tests/rpm/b.json
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"build": {
|
||||
"pipeline": {
|
||||
"stages": [
|
||||
{
|
||||
"name": "org.osbuild.dnf",
|
||||
"options": {
|
||||
"releasever": "30",
|
||||
"basearch": "x86_64",
|
||||
"install_weak_deps": false,
|
||||
"repos": [
|
||||
"sha256:9f596e18f585bee30ac41c11fb11a83ed6b11d5b341c1cb56ca4015d7717cb97"
|
||||
],
|
||||
"packages": [
|
||||
"dnf"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"runner": "org.osbuild.fedora30"
|
||||
},
|
||||
"stages": [
|
||||
{
|
||||
"name": "org.osbuild.rpm",
|
||||
"options": {
|
||||
"gpgkeys": [
|
||||
"-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBFturGcBEACv0xBo91V2n0uEC2vh69ywCiSyvUgN/AQH8EZpCVtM7NyjKgKm\nbbY4G3R0M3ir1xXmvUDvK0493/qOiFrjkplvzXFTGpPTi0ypqGgxc5d0ohRA1M75\nL+0AIlXoOgHQ358/c4uO8X0JAA1NYxCkAW1KSJgFJ3RjukrfqSHWthS1d4o8fhHy\nKJKEnirE5hHqB50dafXrBfgZdaOs3C6ppRIePFe2o4vUEapMTCHFw0woQR8Ah4/R\nn7Z9G9Ln+0Cinmy0nbIDiZJ+pgLAXCOWBfDUzcOjDGKvcpoZharA07c0q1/5ojzO\n4F0Fh4g/BUmtrASwHfcIbjHyCSr1j/3Iz883iy07gJY5Yhiuaqmp0o0f9fgHkG53\n2xCU1owmACqaIBNQMukvXRDtB2GJMuKa/asTZDP6R5re+iXs7+s9ohcRRAKGyAyc\nYKIQKcaA+6M8T7/G+TPHZX6HJWqJJiYB+EC2ERblpvq9TPlLguEWcmvjbVc31nyq\nSDoO3ncFWKFmVsbQPTbP+pKUmlLfJwtb5XqxNR5GEXSwVv4I7IqBmJz1MmRafnBZ\ng0FJUtH668GnldO20XbnSVBr820F5SISMXVwCXDXEvGwwiB8Lt8PvqzXnGIFDAu3\nDlQI5sxSqpPVWSyw08ppKT2Tpmy8adiBotLfaCFl2VTHwOae48X2dMPBvQARAQAB\ntDFGZWRvcmEgKDMwKSA8ZmVkb3JhLTMwLXByaW1hcnlAZmVkb3JhcHJvamVjdC5v\ncmc+iQI4BBMBAgAiBQJbbqxnAhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAK\nCRDvPBEfz8ZZudTnD/9170LL3nyTVUCFmBjT9wZ4gYnpwtKVPa/pKnxbbS+Bmmac\ng9TrT9pZbqOHrNJLiZ3Zx1Hp+8uxr3Lo6kbYwImLhkOEDrf4aP17HfQ6VYFbQZI8\nf79OFxWJ7si9+3gfzeh9UYFEqOQfzIjLWFyfnas0OnV/P+RMQ1Zr+vPRqO7AR2va\nN9wg+Xl7157dhXPCGYnGMNSoxCbpRs0JNlzvJMuAea5nTTznRaJZtK/xKsqLn51D\nK07k9MHVFXakOH8QtMCUglbwfTfIpO5YRq5imxlWbqsYWVQy1WGJFyW6hWC0+RcJ\nOx5zGtOfi4/dN+xJ+ibnbyvy/il7Qm+vyFhCYqIPyS5m2UVJUuao3eApE38k78/o\n8aQOTnFQZ+U1Sw+6woFTxjqRQBXlQm2+7Bt3bqGATg4sXXWPbmwdL87Ic+mxn/ml\nSMfQux/5k6iAu1kQhwkO2YJn9eII6HIPkW+2m5N1JsUyJQe4cbtZE5Yh3TRA0dm7\n+zoBRfCXkOW4krchbgww/ptVmzMMP7GINJdROrJnsGl5FVeid9qHzV7aZycWSma7\nCxBYB1J8HCbty5NjtD6XMYRrMLxXugvX6Q4NPPH+2NKjzX4SIDejS6JjgrP3KA3O\npMuo7ZHMfveBngv8yP+ZD/1sS6l+dfExvdaJdOdgFCnp4p3gPbw5+Lv70HrMjA==\n=BfZ/\n-----END PGP PUBLIC KEY BLOCK-----\n"
|
||||
],
|
||||
"packages": [
|
||||
"sha256:3fbe971c4e0737df9dd0484ec48f294df693631bfe3be89cba01e147a5eec140"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
252
test/stages_tests/rpm/diff.json
Normal file
252
test/stages_tests/rpm/diff.json
Normal file
|
|
@ -0,0 +1,252 @@
|
|||
{
|
||||
"added_files": [
|
||||
"/var",
|
||||
"/var/lib",
|
||||
"/var/lib/rpm",
|
||||
"/var/lib/rpm/Sha1header",
|
||||
"/var/lib/rpm/.rpm.lock",
|
||||
"/var/lib/rpm/Providename",
|
||||
"/var/lib/rpm/Name",
|
||||
"/var/lib/rpm/Filetriggername",
|
||||
"/var/lib/rpm/Transfiletriggername",
|
||||
"/var/lib/rpm/Dirnames",
|
||||
"/var/lib/rpm/Packages",
|
||||
"/var/lib/rpm/Conflictname",
|
||||
"/var/lib/rpm/Triggername",
|
||||
"/var/lib/rpm/Supplementname",
|
||||
"/var/lib/rpm/Obsoletename",
|
||||
"/var/lib/rpm/Installtid",
|
||||
"/var/lib/rpm/Requirename",
|
||||
"/var/lib/rpm/.dbenv.lock",
|
||||
"/var/lib/rpm/Group",
|
||||
"/var/lib/rpm/Enhancename",
|
||||
"/var/lib/rpm/Recommendname",
|
||||
"/var/lib/rpm/Suggestname",
|
||||
"/var/lib/rpm/Sigmd5",
|
||||
"/var/lib/rpm/Basenames",
|
||||
"/sys",
|
||||
"/dev",
|
||||
"/etc",
|
||||
"/etc/machine-id",
|
||||
"/etc/pki",
|
||||
"/etc/pki/rpm-gpg",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-9-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-15-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-15-arm",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-12-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-15-s390",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-16-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-30-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-15-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-11-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-10-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-17-s390",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-13-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-9-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-18-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-17-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-27-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-16-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-15-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-10-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-30-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-27-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-27-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-27-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-15-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-30-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-primary-original",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-15-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-10-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-s390",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-17-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-7-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-18-s390",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-16-s390",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-30-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-30-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-14-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-s390",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-30-fedora",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-13-arm",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-13-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-11-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-18-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-iot-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-14-arm",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-30-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-iot-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-9-ia64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-14-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-16-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-17-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-16-arm",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-27-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-modularity",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-17-arm",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-16-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-9-primary-original",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-18-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-27-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-13-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-17-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-iot-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-13-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-18-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-16-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-7-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-30-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-17-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-31-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-iot-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-10-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-s390",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-16-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-7-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-9-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-16-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-18-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-27-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-s390",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-31-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-11-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-7-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-iot-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-9-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-iot-2019",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-15-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-15-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-13-mips",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-9-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-10-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-31-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-s390",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-12-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-12-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-17-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-27-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-13-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-31-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-14-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-31-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-31-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-14-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-12-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-s390x",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-31-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-16-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-18-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-15-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-iot-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-12-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-9-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-17-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-11-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-7-ppc",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-x86_64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-17-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-armhfp",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-ppc64le",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-primary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-secondary",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-11-ppc64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-18-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-i386",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-aarch64",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-18-arm",
|
||||
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-18-armhfp",
|
||||
"/proc"
|
||||
],
|
||||
"deleted_files": [],
|
||||
"differences": {
|
||||
"/": {
|
||||
"mode": [
|
||||
16832,
|
||||
16877
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
import json
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
from test import osbuildtest
|
||||
|
||||
|
|
@ -12,7 +13,18 @@ class TestDescriptions(osbuildtest.TestCase):
|
|||
tree_id1, _ = self.run_osbuild(pipeline1, sources="test/pipelines/sources.json")
|
||||
tree_id2, _ = self.run_osbuild(pipeline2, sources="test/pipelines/sources.json")
|
||||
|
||||
actual_diff = self.run_tree_diff(self.get_path_to_store(tree_id1), self.get_path_to_store(tree_id2))
|
||||
with tempfile.TemporaryDirectory() as empty:
|
||||
if tree_id1:
|
||||
tree1 = self.get_path_to_store(tree_id1)
|
||||
else:
|
||||
tree1 = empty
|
||||
|
||||
if tree_id2:
|
||||
tree2 = self.get_path_to_store(tree_id2)
|
||||
else:
|
||||
tree2 = empty
|
||||
|
||||
actual_diff = self.run_tree_diff(tree1, tree2)
|
||||
|
||||
with open(f"{test_dir}/diff.json") as f:
|
||||
expected_diff = json.load(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue