test: add minimal test for container based building of images

This commit adds a smoke test that builds the ibcli container
and runs a fedora-41 raw-minimal build to double check that
the container based building actually works.

Thanks to Ondrej for suggesting this.
This commit is contained in:
Michael Vogt 2024-12-18 09:41:31 +01:00
parent fad02336b3
commit e7d8a39fcf
6 changed files with 62 additions and 10 deletions

23
test/containerbuild.py Normal file
View file

@ -0,0 +1,23 @@
import os
import platform
import random
import string
import subprocess
import textwrap
from contextlib import contextmanager
import pytest
# XXX: copied from bib
@pytest.fixture(name="build_container", scope="session")
def build_container_fixture():
"""Build a container from the Containerfile and returns the name"""
container_tag = "image-builder-cli-test"
subprocess.check_call([
"podman", "build",
"-f", "Containerfile",
"-t", container_tag,
])
return container_tag