From 2634ebeccf7e9ce7623eb27bd4bf9c0d3980d1f6 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Wed, 18 Nov 2026 12:35:45 +0000 Subject: [PATCH] test(common): skip the layered-RPM check on Utah, which has no rpm-ostree Utah is RPM-based but updates with bootc and ships no rpm-ostree on purpose, like Dakota. Since #1249 the "No RPM packages are layered" scenario skips only on Dakota, so every Utah post-testing E2E run fails common-a with "sudo: rpm-ostree: command not found". Let the @requires_rpm_ostree skip apply to Utah images too. Every other image still runs the check, so a missing rpm-ostree there still fails. Refs projectbluefin/utah#1329 Co-Authored-By: Claude Opus 5.5 Signed-off-by: James Reilly --- docs/skills/test-authoring/suite-map/SKILL.md | 1 + .../common/features/common_immutable.feature | 3 ++- tests/common/features/environment.py | 20 ++++++++++++------- tests/unit/test_common_steps.py | 20 +++++++++++++++++-- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/docs/skills/test-authoring/suite-map/SKILL.md b/docs/skills/test-authoring/suite-map/SKILL.md index a19bd9fa8..5a437a2d0 100644 --- a/docs/skills/test-authoring/suite-map/SKILL.md +++ b/docs/skills/test-authoring/suite-map/SKILL.md @@ -155,6 +155,7 @@ Set `image` (e.g. `ghcr.io/projectbluefin/dakota:latest`), `suites: lifecycle`, | `@regression` | Anchors a known incident regression guard; must remain active indefinitely | | `@kde_smoke` | KDE Plasma smoke-suite identifier; used by `e2e.yml` suite registration (#645) | | `@informational` | Bake-period tier; scenario runs and reports results but does not gate promotion until promoted to `@critical` | +| `@requires_rpm_ostree` | Common scenario needs `rpm-ostree` on the device under test. It skips only on Dakota (not RPM-based) and Utah (bootc-only by design, utah#1329) when the binary is absent; on every other image a missing `rpm-ostree` is a defect and the scenario runs and fails | | `@requires_cached_image` | Scenario needs the OCI image named in its own steps to be pre-pulled on the DUT; `tests/shared/image_cache.py` probes `podman image exists` from `before_scenario` and skips while it is absent. A **runtime capability gate** like `@requires_brew`, not a non-runnable tag — never pair it with `@pending`/`@future`, which mask it (#501) | ## Quarantine citations diff --git a/tests/common/features/common_immutable.feature b/tests/common/features/common_immutable.feature index 7eab9ae9f..fe19687c5 100644 --- a/tests/common/features/common_immutable.feature +++ b/tests/common/features/common_immutable.feature @@ -10,7 +10,8 @@ Feature: Immutable OS integrity # The SSH user (bluefin-test) is not root, so status queries use sudo like the # lifecycle suite does, and stderr is kept so a failure shows its cause. - # Skips on images without rpm-ostree (Dakota is not RPM-based). + # Skips on Dakota and Utah when rpm-ostree is absent: Dakota is not + # RPM-based, and Utah updates with bootc only. @requires_rpm_ostree Scenario: No RPM packages are layered on the base image * Run SSH command: "sudo rpm-ostree status --json | python3 -c $'import sys,json; d=json.load(sys.stdin); layers=[p for dep in d.get(\"deployments\",[]) for p in dep.get(\"requested-packages\",[])]; print(len(layers)); sys.exit(0 if not layers else 1)'" diff --git a/tests/common/features/environment.py b/tests/common/features/environment.py index c4e1acf16..2eb283926 100644 --- a/tests/common/features/environment.py +++ b/tests/common/features/environment.py @@ -66,9 +66,11 @@ def _has_rpm_ostree(context) -> bool: """Return True when the image ships the ``rpm-ostree`` binary. Dakota is not RPM-based and has no rpm-ostree, so a "no layered RPM - packages" check cannot run there (projectbluefin/common#1688). Scenarios - tagged ``@requires_rpm_ostree`` skip on Dakota images that lack it. Every - other image runs the check unchanged, so a missing rpm-ostree there fails. + packages" check cannot run there (projectbluefin/common#1688). Utah is + RPM-based but updates with bootc and ships no rpm-ostree on purpose + (projectbluefin/utah#1329). Scenarios tagged ``@requires_rpm_ostree`` skip + on Dakota and Utah images that lack it. Every other image runs the check + unchanged, so a missing rpm-ostree there fails. """ cached = getattr(context, "has_rpm_ostree", None) if cached is not None: @@ -236,14 +238,18 @@ def before_scenario(context, scenario): if "requires_brew" in scenario_tags and not _has_brew(context): scenario.skip("Homebrew not present on this image") return - # Only Dakota may skip: on the RPM-based images a failed probe is a defect - # the "no layered packages" check must report, not a gap to skip. + # Only Dakota and Utah may skip: they ship no rpm-ostree by design. On + # the other images a failed probe is a defect the "no layered packages" + # check must report, not a gap to skip. if ( "requires_rpm_ostree" in scenario_tags - and getattr(context, "is_dakota_image", False) + and ( + getattr(context, "is_dakota_image", False) + or getattr(context, "is_utah_image", False) + ) and not _has_rpm_ostree(context) ): - scenario.skip("rpm-ostree not present on this image (not RPM-based)") + scenario.skip("rpm-ostree not present on this image (no rpm-ostree by design)") return if "requires_toggle_action" in scenario_tags and not _has_toggle_action(context): scenario.skip("ujust toggle-updates ACTION support not present on this image") diff --git a/tests/unit/test_common_steps.py b/tests/unit/test_common_steps.py index 528b541fa..31d042229 100644 --- a/tests/unit/test_common_steps.py +++ b/tests/unit/test_common_steps.py @@ -277,7 +277,7 @@ def test_skips_when_rpm_ostree_is_absent(self): m.before_scenario(context, scenario) - assert scenario.skip_message == "rpm-ostree not present on this image (not RPM-based)" + assert scenario.skip_message == "rpm-ostree not present on this image (no rpm-ostree by design)" assert context.has_rpm_ostree is False def test_runs_when_rpm_ostree_is_present(self): @@ -290,13 +290,29 @@ def test_runs_when_rpm_ostree_is_present(self): assert scenario.skip_message is None assert context.has_rpm_ostree is True + def test_skips_on_utah_when_rpm_ostree_is_absent(self): + # Utah updates with bootc and ships no rpm-ostree (utah#1329). + m = _import_common_environment(run_ssh_returncode=1) + context = _ctx( + is_bluefin_image=True, is_dakota_image=False, is_utah_image=True, + has_brew=True, has_rpm_ostree=None, + ) + scenario = _Scenario(["requires_rpm_ostree"]) + + m.before_scenario(context, scenario) + + assert scenario.skip_message == "rpm-ostree not present on this image (no rpm-ostree by design)" + def test_non_dakota_image_never_skips_even_when_probe_fails(self): # A Fedora-based image with no rpm-ostree is broken; the integrity # check must run and fail rather than be skipped. m = _import_common_environment(run_ssh_returncode=1) calls = [] m.run_ssh = lambda context, cmd, **kw: (calls.append(cmd), ("", 1))[1] - context = _ctx(is_bluefin_image=True, is_dakota_image=False, has_brew=True, has_rpm_ostree=None) + context = _ctx( + is_bluefin_image=True, is_dakota_image=False, is_utah_image=False, + has_brew=True, has_rpm_ostree=None, + ) scenario = _Scenario(["requires_rpm_ostree"]) m.before_scenario(context, scenario)