test/run/stages: convert test_selinux to a v2 manifest
Let's not depend on f34-base.json anymore, but instead of a separate, standardized manifest for it. The test was modified so it supports v2 manifests. Also, the new manifest installs just a very minimal system. There's no need to install the whole @core.
This commit is contained in:
parent
c8d252f2fd
commit
5adbecba43
3 changed files with 1088 additions and 8 deletions
1054
test/data/stages/selinux/manifest.json
Normal file
1054
test/data/stages/selinux/manifest.json
Normal file
File diff suppressed because it is too large
Load diff
30
test/data/stages/selinux/manifest.mpp.yaml
Normal file
30
test/data/stages/selinux/manifest.mpp.yaml
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
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:
|
||||||
|
type: org.osbuild.files
|
||||||
|
origin: org.osbuild.source
|
||||||
|
mpp-depsolve:
|
||||||
|
architecture: $arch
|
||||||
|
module-platform-id: $module_platform_id
|
||||||
|
repos:
|
||||||
|
mpp-eval: repos
|
||||||
|
packages:
|
||||||
|
- systemd
|
||||||
|
- selinux-policy-targeted
|
||||||
|
options:
|
||||||
|
gpgkeys:
|
||||||
|
mpp-eval: gpgkeys
|
||||||
|
exclude:
|
||||||
|
docs: true
|
||||||
|
|
@ -277,19 +277,15 @@ class TestStages(test.TestBase):
|
||||||
datadir = self.locate_test_data()
|
datadir = self.locate_test_data()
|
||||||
testdir = os.path.join(datadir, "stages", "selinux")
|
testdir = os.path.join(datadir, "stages", "selinux")
|
||||||
|
|
||||||
def load_manifest(manifest_name):
|
|
||||||
with open(os.path.join(datadir, f"manifests/{manifest_name}"), encoding="utf8") as f:
|
|
||||||
manifest = json.load(f)
|
|
||||||
return manifest
|
|
||||||
|
|
||||||
with self.osbuild as osb, tempfile.TemporaryDirectory(dir="/var/tmp") as outdir:
|
with self.osbuild as osb, tempfile.TemporaryDirectory(dir="/var/tmp") as outdir:
|
||||||
|
|
||||||
for t in glob.glob(f"{testdir}/test_*.json"):
|
for t in glob.glob(f"{testdir}/test_*.json"):
|
||||||
manifest = load_manifest("f34-base.json")
|
with open(os.path.join(testdir, "manifest.json"), encoding="utf8") as f:
|
||||||
|
manifest = json.load(f)
|
||||||
with open(t, encoding="utf8") as f:
|
with open(t, encoding="utf8") as f:
|
||||||
check = json.load(f)
|
check = json.load(f)
|
||||||
manifest["pipeline"]["stages"].append({
|
manifest["pipelines"][1]["stages"].append({
|
||||||
"name": "org.osbuild.selinux",
|
"type": "org.osbuild.selinux",
|
||||||
"options": check["options"]
|
"options": check["options"]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue