debian-forge-cli/test/containerbuild.py
Michael Vogt e7d8a39fcf 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.
2024-12-19 08:49:26 +00:00

23 lines
519 B
Python

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