Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/skills/test-authoring/suite-map/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/common/features/common_immutable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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)'"
Expand Down
20 changes: 13 additions & 7 deletions tests/common/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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")
Expand Down
20 changes: 18 additions & 2 deletions tests/unit/test_common_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down
Loading