summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-04-05 02:10:28 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-04-06 23:48:37 +0000
commit4b0789cbb615c29ad7a0d072ab88b5fa81099605 (patch)
tree9ad650301558b40ff23a23df727b1567df13cda2
parent6ec07384e871727c87f3960389e713be78786725 (diff)
downloadmeta-virtualization-4b0789cbb615c29ad7a0d072ab88b5fa81099605.tar.gz
vruntime, vrunner, conftest: fix multiconfig and batch import issues
vruntime.conf: - Reset all VIRTUAL-RUNTIME_container_* variables to prevent CONTAINER_PROFILE selections from leaking into vruntime multiconfigs (e.g., podman profile pulling netavark into vruntime builds) - Disable ptest for glib-2.0 — its -ptest RDEPENDS chain (python3-dbusmock -> python3-pygobject -> cairo -> fontconfig) pulls the entire graphics stack which is masked in vruntime - OE-core commit 159148f4de2 replaced DISTRO_FEATURES_BACKFILL_CONSIDERED with DISTRO_FEATURES_OPTED_OUT. The old variable no longer has any effect, which meant ptest, gobject-introspection-data, wayland, and other features were no longer being blocked in vruntime builds. This caused glib-2.0's ptest RDEPENDS to pull in the cairo → fontconfig → freetype graphics stack, which is masked by the vruntime BBMASK. - Set PREFERRED_PROVIDER_virtual/runc with strong assignment to ensure the unified runc recipe is used vrunner.sh: - Fix batch import exit code handling: wrap import chain in subshell and make the images listing best-effort. The previous '&& podman images' caused false failures when podman images couldn't initialize its network backend. Using 'exit' was also wrong as the command runs inside PID 1 init's eval — exit kills init causing kernel panic. vpdmn-rootfs-image.bb: - Switch from netavark to CNI networking — netavark's dependency chain (nmap -> libpcap -> bluez5 -> python3-pygobject -> cairo) cannot be built under the vruntime BBMASK environment - Add nsswitch.conf override (files-only backend) to prevent libnss_systemd segfaults — the vruntime VM uses busybox init with no systemd running, but libnss_systemd.so is pulled in as a dependency and segfaults on NSS resolution vdkr-rootfs-image.bb: - Document skopeo requirement for batch import conftest.py: - Add --k3s-timeout option and k3s/multinode markers for upcoming K3s test suite Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--conf/distro/vruntime.conf25
-rwxr-xr-xrecipes-containers/vcontainer/files/vrunner.sh10
-rw-r--r--recipes-containers/vcontainer/vdkr-rootfs-image.bb2
-rw-r--r--recipes-containers/vcontainer/vpdmn-rootfs-image.bb31
-rw-r--r--tests/conftest.py14
5 files changed, 66 insertions, 16 deletions
diff --git a/conf/distro/vruntime.conf b/conf/distro/vruntime.conf
index 72958b7d..0ea43e62 100644
--- a/conf/distro/vruntime.conf
+++ b/conf/distro/vruntime.conf
@@ -37,12 +37,13 @@ DISTRO_VERSION = "1.0"
37# Explicitly NOT included: x11, wayland, pulseaudio, bluetooth, wifi, nfc, 3g, pcmcia 37# Explicitly NOT included: x11, wayland, pulseaudio, bluetooth, wifi, nfc, 3g, pcmcia
38DISTRO_FEATURES = "acl ext2 ipv4 ipv6 seccomp vfat pci vcontainer vxn" 38DISTRO_FEATURES = "acl ext2 ipv4 ipv6 seccomp vfat pci vcontainer vxn"
39 39
40# Block backfill features not needed by container runtime environments. 40# Opt out of default distro features not needed by container runtime
41# OE-core's DISTRO_FEATURES_BACKFILL auto-appends these to DISTRO_FEATURES 41# environments. Without this, gobject-introspection-data enables
42# unless explicitly listed here. Without this, gobject-introspection-data 42# python3-pygobject (which DEPENDS on cairo), and wayland enables
43# enables python3-pygobject (which DEPENDS on cairo), and wayland enables
44# pygobject's cairo PACKAGECONFIG — both are masked in vruntime builds. 43# pygobject's cairo PACKAGECONFIG — both are masked in vruntime builds.
45DISTRO_FEATURES_BACKFILL_CONSIDERED = "pulseaudio gobject-introspection-data opengl ptest multiarch wayland vulkan" 44# Note: OE-core replaced DISTRO_FEATURES_BACKFILL_CONSIDERED with
45# DISTRO_FEATURES_OPTED_OUT (commit 159148f4de2).
46DISTRO_FEATURES_OPTED_OUT = "pulseaudio gobject-introspection-data opengl ptest multiarch wayland vulkan"
46 47
47# Native and nativesdk classes need full features for build tools 48# Native and nativesdk classes need full features for build tools
48DISTRO_FEATURES:class-native = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}" 49DISTRO_FEATURES:class-native = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}"
@@ -62,6 +63,11 @@ VIRTUAL-RUNTIME_login_manager = ""
62# Keep images small - no documentation or debug 63# Keep images small - no documentation or debug
63EXTRA_IMAGE_FEATURES = "" 64EXTRA_IMAGE_FEATURES = ""
64 65
66# Disable ptest for glib-2.0 — its -ptest RDEPENDS pulls
67# cairo → fontconfig → freetype (entire graphics stack) via
68# python3-dbusmock → python3-pygobject, all masked in vruntime.
69PTEST_ENABLED:pn-glib-2.0 = ""
70
65# ============================================================================= 71# =============================================================================
66# Container runtime: NOT SET 72# Container runtime: NOT SET
67# ============================================================================= 73# =============================================================================
@@ -74,3 +80,12 @@ EXTRA_IMAGE_FEATURES = ""
74# their required runtimes in IMAGE_INSTALL. 80# their required runtimes in IMAGE_INSTALL.
75# ============================================================================= 81# =============================================================================
76VIRTUAL-RUNTIME_container_runtime = "" 82VIRTUAL-RUNTIME_container_runtime = ""
83VIRTUAL-RUNTIME_container_engine = ""
84VIRTUAL-RUNTIME_container_networking = ""
85VIRTUAL-RUNTIME_container_dns = ""
86VIRTUAL-RUNTIME_container_orchestration = ""
87
88# Ensure the unified runc recipe is the provider — vdkr-rootfs-image
89# RDEPENDS on runc directly. Strong assignment to override any stale
90# cache or weak defaults.
91PREFERRED_PROVIDER_virtual/runc = "runc"
diff --git a/recipes-containers/vcontainer/files/vrunner.sh b/recipes-containers/vcontainer/files/vrunner.sh
index b6455330..f1fb4d2b 100755
--- a/recipes-containers/vcontainer/files/vrunner.sh
+++ b/recipes-containers/vcontainer/files/vrunner.sh
@@ -956,11 +956,15 @@ if [ "$BATCH_IMPORT" = "true" ]; then
956 fi 956 fi
957 done 957 done
958 958
959 # Add final images command to show what was imported 959 # Show what was imported (informational only).
960 # IMPORTANT: Must not use 'exit' — the command runs inside PID 1 init's
961 # eval, and exit kills init → kernel panic. The import chain runs in a
962 # subshell so its exit code is captured without risk. The images listing
963 # is best-effort and doesn't affect the result.
960 if [ "$RUNTIME" = "docker" ]; then 964 if [ "$RUNTIME" = "docker" ]; then
961 COMPOUND_CMD="$COMPOUND_CMD && docker images" 965 COMPOUND_CMD="( $COMPOUND_CMD ); docker images 2>/dev/null; true"
962 else 966 else
963 COMPOUND_CMD="$COMPOUND_CMD && podman images" 967 COMPOUND_CMD="( $COMPOUND_CMD ); podman images 2>/dev/null; true"
964 fi 968 fi
965 969
966 log "DEBUG" "Batch command: $COMPOUND_CMD" 970 log "DEBUG" "Batch command: $COMPOUND_CMD"
diff --git a/recipes-containers/vcontainer/vdkr-rootfs-image.bb b/recipes-containers/vcontainer/vdkr-rootfs-image.bb
index e2921ec7..64054376 100644
--- a/recipes-containers/vcontainer/vdkr-rootfs-image.bb
+++ b/recipes-containers/vcontainer/vdkr-rootfs-image.bb
@@ -47,6 +47,8 @@ inherit core-image
47# We need Docker and container tools 47# We need Docker and container tools
48# Note: runc is explicitly listed because vruntime distro sets 48# Note: runc is explicitly listed because vruntime distro sets
49# VIRTUAL-RUNTIME_container_runtime="" to avoid runc/crun conflicts. 49# VIRTUAL-RUNTIME_container_runtime="" to avoid runc/crun conflicts.
50# Note: skopeo is required inside the guest for batch import
51# (skopeo copy oci:... containers-storage:...).
50IMAGE_INSTALL = " \ 52IMAGE_INSTALL = " \
51 packagegroup-core-boot \ 53 packagegroup-core-boot \
52 docker-moby \ 54 docker-moby \
diff --git a/recipes-containers/vcontainer/vpdmn-rootfs-image.bb b/recipes-containers/vcontainer/vpdmn-rootfs-image.bb
index 8808e6b2..f061ce08 100644
--- a/recipes-containers/vcontainer/vpdmn-rootfs-image.bb
+++ b/recipes-containers/vcontainer/vpdmn-rootfs-image.bb
@@ -42,14 +42,15 @@ inherit core-image
42# Podman is daemonless - no containerd required! 42# Podman is daemonless - no containerd required!
43# Note: crun is explicitly listed because vruntime distro sets 43# Note: crun is explicitly listed because vruntime distro sets
44# VIRTUAL-RUNTIME_container_runtime="" to avoid runc/crun conflicts. 44# VIRTUAL-RUNTIME_container_runtime="" to avoid runc/crun conflicts.
45# Note: skopeo is required inside the guest for batch import
46# (skopeo copy oci:... containers-storage:...).
45IMAGE_INSTALL = " \ 47IMAGE_INSTALL = " \
46 packagegroup-core-boot \ 48 packagegroup-core-boot \
47 podman \ 49 podman \
48 crun \ 50 crun \
49 skopeo \ 51 skopeo \
50 conmon \ 52 conmon \
51 netavark \ 53 cni \
52 aardvark-dns \
53 busybox \ 54 busybox \
54 iproute2 \ 55 iproute2 \
55 iptables \ 56 iptables \
@@ -120,13 +121,27 @@ additionalimagestores = []
120EOF 121EOF
121 122
122 # Create containers.conf for podman engine settings 123 # Create containers.conf for podman engine settings
124 # Use CNI instead of netavark — netavark's dependency chain
125 # (nmap → libpcap → bluez5 → python3-pygobject → cairo) is too
126 # heavy for the vruntime BBMASK environment.
123 cat > ${IMAGE_ROOTFS}/etc/containers/containers.conf << 'EOF' 127 cat > ${IMAGE_ROOTFS}/etc/containers/containers.conf << 'EOF'
124[engine]
125# Location of helper binaries (netavark, aardvark-dns)
126helper_binaries_dir = ["/usr/libexec/podman"]
127
128[network] 128[network]
129# Use netavark as the network backend 129network_backend = "cni"
130network_backend = "netavark" 130cni_plugin_dirs = ["/opt/cni/bin", "/usr/libexec/cni"]
131EOF
132
133 # Prevent libnss_systemd segfaults — systemd is not running in the
134 # vruntime VM (busybox init), but libnss_systemd.so is installed as
135 # a dependency. Override nsswitch.conf to use only files/compat.
136 cat > ${IMAGE_ROOTFS}/etc/nsswitch.conf << 'EOF'
137passwd: files
138group: files
139shadow: files
140hosts: files dns
141networks: files
142protocols: files
143services: files
144ethers: files
145rpc: files
131EOF 146EOF
132} 147}
diff --git a/tests/conftest.py b/tests/conftest.py
index 5f54c369..56047929 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -226,6 +226,14 @@ def pytest_addoption(parser):
226 default=24.0, 226 default=24.0,
227 help="Max rootfs age in hours before warning (default: 24)", 227 help="Max rootfs age in hours before warning (default: 24)",
228 ) 228 )
229 # K3s options
230 parser.addoption(
231 "--k3s-timeout",
232 action="store",
233 type=int,
234 default=300,
235 help="Timeout in seconds for k3s readiness (default: 300)",
236 )
229 # Container registry options 237 # Container registry options
230 parser.addoption( 238 parser.addoption(
231 "--registry-url", 239 "--registry-url",
@@ -589,6 +597,12 @@ def pytest_configure(config):
589 config.addinivalue_line( 597 config.addinivalue_line(
590 "markers", "boot: marks tests that boot a QEMU image (requires built image)" 598 "markers", "boot: marks tests that boot a QEMU image (requires built image)"
591 ) 599 )
600 config.addinivalue_line(
601 "markers", "k3s: marks k3s runtime tests"
602 )
603 config.addinivalue_line(
604 "markers", "multinode: marks multi-node tests (requires two QEMU VMs)"
605 )
592 606
593 607
594@pytest.fixture 608@pytest.fixture