test: convert test_boot to runtime tests with F32

Move the `test_boot` suite into ./test/run closer to the other runtime
tests, and convert the used manifest over to an MPP based F32 manifest.
This commit is contained in:
David Rheinsberg 2020-05-27 17:03:32 +02:00
parent 6e8562f712
commit 9bb6123963
6 changed files with 1147 additions and 15 deletions

View file

@ -22,17 +22,6 @@ jobs:
with:
run: make test-runtime
boot_tests:
name: "Boot Tests"
runs-on: ubuntu-latest
steps:
- name: "Clone Repository"
uses: actions/checkout@v2
- name: "Run Boot Tests"
uses: osbuild/containers/ghci/actions/ghci-osbuild@ghci/v1
with:
run: python3 -m unittest -v test.test_boot
assembler_tests:
name: "Assembler Tests"
runs-on: ubuntu-latest

View file

@ -126,6 +126,7 @@ $(TEST_MANIFESTS_GEN): $(SRCDIR)/test/data/manifests/%.json: $(SRCDIR)/test/data
"--cwd=$(SRCDIR)/test/data/manifests"
$(SRCDIR)/test/data/manifests/f32-base.json: $(SRCDIR)/test/data/manifests/f32-build.json
$(SRCDIR)/test/data/manifests/fedora-boot.json: $(SRCDIR)/test/data/manifests/f32-build.json
.PHONY: test-data
test-data: $(TEST_MANIFESTS_GEN)

View file

@ -20,6 +20,9 @@ do not allow comments, this file shortly describes their purpose.
test-suite needs.
If they have `build` as part of their name, they have a very restricted
package set which includes just what is needed in a build-root for osbuild.
The `fedora` prefix is used for manifests that are kept up to date to the
newest fedora release, and thus do not expose a specific `f30`, `f32`, etc.
behavior.
The `rhel` prefix is used for Red Hat Enterprise Linux images. Since they are
not available publicly, the test-suite usually skips them.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,95 @@
{
"pipeline": {
"build": {
"mpp-import-pipeline": {
"path": "f32-build.json"
},
"runner": "org.osbuild.fedora32"
},
"stages": [
{
"name": "org.osbuild.rpm",
"options": {
"gpgkeys": [
"-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBF1RVqsBEADWMBqYv/G1r4PwyiPQCfg5fXFGXV1FCZ32qMi9gLUTv1CX7rYy\nH4Inj93oic+lt1kQ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TiCh9/0u+4g80cT/21Cxsdx\n7+DVHaewXbF87QQIcOAing0S5QE67r2uPVxmWy/56TKUqDoyP8SNsV62lT2jutsj\nLevNxUky011g5w3bc61UeaeKrrurFdRs+RwBVkXmtqm/i6g0ZTWZyWGO6gJd+HWA\nqY1NYiq4+cMvNLatmA2sOoCsRNmE9q6jM/ESVgaH8hSp8GcLuzt9/r4PZZGl5CvU\neldOiD221u8rzuHmLs4dsgwJJ9pgLT0cUAsOpbMPI0JpGIPQ2SG6yK7LmO6HFOxb\nAkz7IGUt0gy1MzPTyBvnB+WgD1I+IQXXsJbhP5+d+d3mOnqsd6oDM/grKBzrhoUe\noNadc9uzjqKlOrmrdIR3Bz38SSiWlde5fu6xPqJdmGZRNjXtcyJlbSPVDIloxw==\n=QWRO\n-----END PGP PUBLIC KEY BLOCK-----\n"
],
"mpp-depsolve": {
"architecture": "x86_64",
"module-platform-id": "f32",
"baseurl": "http://mirrors.kernel.org/fedora/releases/32/Everything/x86_64/os",
"repos": [
{
"id": "default",
"metalink": "https://mirrors.fedoraproject.org/metalink?repo=fedora-32&arch=$basearch"
}
],
"packages": [
"@cloud-server-environment",
"chrony",
"dracut-config-generic",
"grub2-pc",
"kernel-core",
"langpacks-en",
"polkit",
"selinux-policy-targeted",
"systemd-udev"
]
}
}
},
{
"name": "org.osbuild.locale",
"options": {
"language": "en_US"
}
},
{
"name": "org.osbuild.fstab",
"options": {
"filesystems": [
{
"uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"vfs_type": "ext4",
"path": "/",
"freq": 1,
"passno": 1
}
]
}
},
{
"name": "org.osbuild.grub2",
"options": {
"root_fs_uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"kernel_opts": "ro biosdevname=0 net.ifnames=0",
"legacy": "i386-pc"
}
},
{
"name": "org.osbuild.test",
"options": {
"script": "/usr/bin/systemctl is-system-running --wait"
}
},
{
"name": "org.osbuild.selinux",
"options": {
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts"
}
},
{
"name": "org.osbuild.fix-bls"
}
],
"assembler": {
"name": "org.osbuild.qemu",
"options": {
"format": "qcow2",
"filename": "fedora-boot.qcow2",
"ptuuid": "0x1cd1d44b",
"root_fs_uuid": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"size": 3221225472
}
}
}
}

View file

@ -1,13 +1,17 @@
#
# Runtime Tests for Bootable Pipelines
#
import os
import subprocess
import tempfile
import unittest
from . import test
from .. import test
class TestBoot(unittest.TestCase):
@unittest.skipUnless(test.TestBase.have_test_data(), "no test-data access")
class TestBoot(test.TestBase):
def setUp(self):
self.osbuild = test.OSBuild(self)
@ -16,9 +20,12 @@ class TestBoot(unittest.TestCase):
# Build an image and test-boot it.
#
manifest = os.path.join(self.locate_test_data(),
"manifests/fedora-boot.json")
with self.osbuild as osb:
osb.compile_file("test/pipelines/f30-boot.json")
with osb.map_output("f30-boot.qcow2") as qcow2, \
osb.compile_file(manifest)
with osb.map_output("fedora-boot.qcow2") as qcow2, \
tempfile.TemporaryDirectory() as d:
output_file = os.path.join(d, "output")