test: start a new ostree integration test suite
Add a v2 manifest to builds an ostree commit, then builds a small container with a webserver and puts that commit into it. Start a new test suit where this manifest is built and then checked that the artifact exists. In the future the artifact should also be inspected and run by a container engine and the commit be pulled via ostree.
This commit is contained in:
parent
95811c1c0d
commit
36129c164b
4 changed files with 1608 additions and 0 deletions
1
Makefile
1
Makefile
|
|
@ -217,6 +217,7 @@ $(SRCDIR)/test/data/manifests/f32-base.json: $(SRCDIR)/test/data/manifests/f32-b
|
|||
$(SRCDIR)/test/data/manifests/fedora-boot.json: $(SRCDIR)/test/data/manifests/f32-build.json
|
||||
$(SRCDIR)/test/data/manifests/filesystem.json: $(SRCDIR)/test/data/manifests/f32-build.json
|
||||
$(SRCDIR)/test/data/manifests/fedora-container.json: $(SRCDIR)/test/data/manifests/f32-build-v2.json
|
||||
$(SRCDIR)/test/data/manifests/fedora-ostree-container.json: $(SRCDIR)/test/data/manifests/f32-build-v2.json
|
||||
|
||||
.PHONY: test-data
|
||||
test-data: $(TEST_MANIFESTS_GEN)
|
||||
|
|
|
|||
1348
test/data/manifests/fedora-ostree-container.json
Normal file
1348
test/data/manifests/fedora-ostree-container.json
Normal file
File diff suppressed because it is too large
Load diff
227
test/data/manifests/fedora-ostree-container.mpp.json
Normal file
227
test/data/manifests/fedora-ostree-container.mpp.json
Normal file
|
|
@ -0,0 +1,227 @@
|
|||
{
|
||||
"version": "2",
|
||||
"pipelines": [
|
||||
{
|
||||
"mpp-import-pipeline": {
|
||||
"path": "f32-build-v2.json",
|
||||
"id": "build"
|
||||
},
|
||||
"runner": "org.osbuild.fedora32"
|
||||
},
|
||||
{
|
||||
"name": "ostree-tree",
|
||||
"build": "name:build",
|
||||
"stages": [
|
||||
{
|
||||
"type": "org.osbuild.rpm",
|
||||
"options": {
|
||||
"gpgkeys": [
|
||||
"-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBF1RVqsBEADWMBqYv/G1r4PwyiPQCfg5fXFGXV1FCZ32qMi9gLUTv1CX7rYy\nH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3yjkLQw+idvX4pevTiCh9/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"
|
||||
]
|
||||
},
|
||||
"inputs": {
|
||||
"packages": {
|
||||
"type": "org.osbuild.files",
|
||||
"origin": "org.osbuild.source",
|
||||
"mpp-depsolve": {
|
||||
"architecture": "x86_64",
|
||||
"module-platform-id": "f32",
|
||||
"baseurl": "https://rpmrepo.osbuild.org/v1/anon/f32/f32-x86_64-fedora-20201010/",
|
||||
"repos": [
|
||||
{
|
||||
"id": "default",
|
||||
"baseurl": "https://rpmrepo.osbuild.org/v1/anon/f32/f32-x86_64-fedora-20201010/"
|
||||
}
|
||||
],
|
||||
"packages": [
|
||||
"@cloud-server-environment",
|
||||
"chrony",
|
||||
"dracut-config-generic",
|
||||
"grub2-pc",
|
||||
"kernel-core",
|
||||
"langpacks-en",
|
||||
"nss-altfiles",
|
||||
"ostree",
|
||||
"polkit",
|
||||
"rpm-ostree",
|
||||
"selinux-policy-targeted",
|
||||
"systemd-udev"
|
||||
],
|
||||
"excludes": [
|
||||
"dracut-config-rescue"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.locale",
|
||||
"options": {
|
||||
"language": "en_US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.selinux",
|
||||
"options": {
|
||||
"file_contexts": "etc/selinux/targeted/contexts/files/file_contexts"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.ostree.preptree",
|
||||
"options": {
|
||||
"etc_group_members": [
|
||||
"wheel",
|
||||
"docker"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ostree-commit",
|
||||
"build": "name:build",
|
||||
"stages": [
|
||||
{
|
||||
"type": "org.osbuild.ostree.init",
|
||||
"options": {
|
||||
"path": "/repo"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.ostree.commit",
|
||||
"inputs": {
|
||||
"tree": {
|
||||
"type": "org.osbuild.tree",
|
||||
"origin": "org.osbuild.pipeline",
|
||||
"references": [
|
||||
"name:ostree-tree"
|
||||
]
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"ref": "fedora/x86_64/osbuild",
|
||||
"os_version": "32"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "container-tree",
|
||||
"build": "name:build",
|
||||
"stages": [
|
||||
{
|
||||
"type": "org.osbuild.rpm",
|
||||
"inputs": {
|
||||
"packages": {
|
||||
"type": "org.osbuild.files",
|
||||
"origin": "org.osbuild.source",
|
||||
"mpp-depsolve": {
|
||||
"architecture": "x86_64",
|
||||
"module-platform-id": "f32",
|
||||
"baseurl": "https://rpmrepo.osbuild.org/v1/anon/f32/f32-x86_64-fedora-20201010/",
|
||||
"repos": [
|
||||
{
|
||||
"id": "default",
|
||||
"baseurl": "https://rpmrepo.osbuild.org/v1/anon/f32/f32-x86_64-fedora-20201010/"
|
||||
}
|
||||
],
|
||||
"packages": [
|
||||
"fedora-release-container",
|
||||
"bash",
|
||||
"coreutils",
|
||||
"glibc-minimal-langpack",
|
||||
"rpm",
|
||||
"shadow-utils",
|
||||
"sssd-client",
|
||||
"util-linux",
|
||||
|
||||
"microdnf",
|
||||
|
||||
"httpd"
|
||||
],
|
||||
"excludes": [
|
||||
"kernel",
|
||||
"dosfstools",
|
||||
"e2fsprogs",
|
||||
"fuse-libs",
|
||||
"gnupg2-smime",
|
||||
"libss",
|
||||
"pinentry",
|
||||
"shared-mime-info",
|
||||
"trousers",
|
||||
"xkeyboard-config",
|
||||
"grubby"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"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/LpiOMC\npZ1IBvjOC7KyKEZY2/63kjW73mB7OHOd18BHtGVkA3QAdVlcSule/z68VOAy6bih\nE6mdxP28D4INsts8w6yr4G+3aEIN8u0qRQq66Ri5mOXTyle+ONudtfGg3U9lgicg\nz6oVk17RT0jV9uL6K41sGZ1sH/6yTXQKagdAYr3w1ix2L46JgzC+/+6SSwARAQAB\ntDFGZWRvcmEgKDMyKSA8ZmVkb3JhLTMyLXByaW1hcnlAZmVkb3JhcHJvamVjdC5v\ncmc+iQI4BBMBAgAiBQJdUVarAhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAK\nCRBsEwJtEslE0LdAD/wKdAMtfzr7O2y06/sOPnrb3D39Y2DXbB8y0iEmRdBL29Bq\n5btxwmAka7JZRJVFxPsOVqZ6KARjS0/oCBmJc0jCRANFCtM4UjVHTSsxrJfuPkel\nvrlNE9tcR6OCRpuj/PZgUa39iifF/FTUfDgh4Q91xiQoLqfBxOJzravQHoK9VzrM\nNTOu6J6l4zeGzY/ocj6DpT+5fdUO/3HgGFNiNYPC6GVzeiA3AAVR0sCyGENuqqdg\nwUxV3BIht05M5Wcdvxg1U9x5I3yjkLQw+idvX4pevTiCh9/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"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.locale",
|
||||
"options": {
|
||||
"language": "en_US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.ostree.init",
|
||||
"options": {
|
||||
"path": "/var/www/html/repo"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "org.osbuild.ostree.pull",
|
||||
"options": {
|
||||
"repo": "/var/www/html/repo"
|
||||
},
|
||||
"inputs": {
|
||||
"commits": {
|
||||
"type": "org.osbuild.ostree",
|
||||
"origin": "org.osbuild.pipeline",
|
||||
"references": {
|
||||
"name:ostree-commit": {
|
||||
"ref": "fedora/x86_64/osbuild"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "container",
|
||||
"build": "name:build",
|
||||
"stages": [
|
||||
{
|
||||
"type": "org.osbuild.oci-archive",
|
||||
"inputs": {
|
||||
"base": {
|
||||
"type": "org.osbuild.tree",
|
||||
"origin": "org.osbuild.pipeline",
|
||||
"references": [
|
||||
"name:container-tree"
|
||||
]
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"architecture": "amd64",
|
||||
"filename": "fedora-container.tar",
|
||||
"config": {
|
||||
"Cmd": [
|
||||
"httpd",
|
||||
"-D", "FOREGROUND"
|
||||
],
|
||||
"ExposedPorts": [
|
||||
"80"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
32
test/run/test_ostree.py
Normal file
32
test/run/test_ostree.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#
|
||||
# Runtime / Integration Tests for ostree pipelines
|
||||
#
|
||||
|
||||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from .. import test
|
||||
|
||||
|
||||
@unittest.skipUnless(test.TestBase.have_test_data(), "no test-data access")
|
||||
@unittest.skipUnless(test.TestBase.can_bind_mount(), "root-only")
|
||||
class TestBoot(test.TestBase):
|
||||
def setUp(self):
|
||||
self.osbuild = test.OSBuild(self)
|
||||
|
||||
def test_ostree_container_updates(self):
|
||||
#
|
||||
# Build a container.
|
||||
#
|
||||
|
||||
manifest = os.path.join(self.locate_test_data(),
|
||||
"manifests/fedora-ostree-container.json")
|
||||
|
||||
with self.osbuild as osb:
|
||||
exports = ["container"]
|
||||
with tempfile.TemporaryDirectory(dir="/var/tmp") as temp_dir:
|
||||
osb.compile_file(manifest, output_dir=temp_dir, exports=exports)
|
||||
|
||||
oci_archive = os.path.join(temp_dir, "container", "fedora-container.tar")
|
||||
self.assertTrue(os.path.exists(oci_archive))
|
||||
Loading…
Add table
Add a link
Reference in a new issue