mirror of
https://github.com/openglow-org/forgefirm.git
synced 2026-09-28 09:11:11 -07:00
acceptance: a later FAIL blocks inheritance, ffboot is a component, the units fallback is valid
The inheritance walk skipped every record that was not a PASS on the current fingerprint, so a FAIL or ERROR recorded after a PASS on the same image was stepped over and the older PASS inherited into the next campaign. The newest record on the fingerprint now decides: a PASS is inherited, a FAIL or ERROR blocks it (reason failed-since), an ABORTED run says nothing. Unit tests for all three orders. ffboot, the tool that rewrites the boot environment on every install and slot switch, was packaged from scripts/ outside every fingerprint. It now lives in the recipe's files and the recipe inherits the manifest class; the tree manifest tool fingerprints file components the same way, and the update tests cover the component. forgectrl.settings-bounds fell back to ui_units=mm, which the whitelist refuses, so the always-required test failed on a fresh machine; the fallback is metric.
This commit is contained in:
@@ -96,16 +96,29 @@ def compute(records, tests, manifest, catalog_hash, running=None):
|
||||
elif t.always:
|
||||
reason = "always"
|
||||
else:
|
||||
# The newest record on the current fingerprint decides: a PASS
|
||||
# is inherited, a FAIL or ERROR after it blocks the inheritance
|
||||
# (the test has to be run again), an ABORTED run says nothing.
|
||||
inh = None
|
||||
blocked = None
|
||||
for r in reversed(hist):
|
||||
if r.get("result") != PASS or r.get("fingerprint") != fp:
|
||||
if r.get("fingerprint") != fp:
|
||||
continue
|
||||
if epoch and (r.get("ts") or "") <= epoch:
|
||||
continue
|
||||
inh = r
|
||||
break
|
||||
res = r.get("result")
|
||||
if res == PASS:
|
||||
inh = r
|
||||
break
|
||||
if res in (FAIL, ERROR):
|
||||
blocked = r
|
||||
break
|
||||
if inh is not None:
|
||||
status, satisfied, origin, reason = "inherited", True, inh, "inherited"
|
||||
elif blocked is not None and any(r.get("result") == PASS and r.get("fingerprint") == fp
|
||||
and (r.get("ts") or "") < (blocked.get("ts") or "")
|
||||
for r in hist):
|
||||
reason = "failed-since"
|
||||
else:
|
||||
reason = "domain-changed" if any(r.get("result") == PASS for r in hist) else "never-passed"
|
||||
if not satisfied and last_r is not None:
|
||||
|
||||
@@ -165,7 +165,7 @@ def settings_bounds(ctx):
|
||||
key = k
|
||||
break
|
||||
if key is None:
|
||||
key, val = "ui_units", "mm"
|
||||
key, val = "ui_units", "metric"
|
||||
ctx.log("no settable key is present; writing %s=%s (recorded in evidence)", key, val)
|
||||
else:
|
||||
val = before[key]
|
||||
|
||||
@@ -5,7 +5,8 @@ import tempfile
|
||||
from ..catalog import test
|
||||
from .. import hw
|
||||
|
||||
_UPDATE_COVERS = [("forgectrl", "src/update.c"), ("forgectrl", "src/update.h")]
|
||||
_UPDATE_COVERS = [("forgectrl", "src/update.c"), ("forgectrl", "src/update.h"),
|
||||
("ffboot", "**")]
|
||||
|
||||
|
||||
@test("update.slots-and-signature", title="Boot slots readable, unsigned/tampered archives refused",
|
||||
|
||||
Reference in New Issue
Block a user