mirror of
https://github.com/openglow-org/forgefirm.git
synced 2026-10-16 01:29:55 -07:00
Catalog: setup.account-login, motion.cancel-abort, forgectrl.settings-bounds and exthost.service leave; the rootfs lint takes image.health's file checks
The catalog is 43. Each test leaves for a host proof that its component's CI runs at the pins: - setup.account-login: the login rules are host_routes.sh's (forgectrl 6c2bb38); the render is test_image.py's new AccountRenderTests, which runs the layer's forgefirm-users.init with reload in a private mount namespace as root (a fresh /run, the scratch account files over /etc, the scratch data directory, root's, over /data): the data directory found 0700 is 0711 after the render, and as the account's own uid the home is entered and written while listing the data directory and reading the users record are EACCES. A control without the script's chmod go+x fails it (700 != 711). forgectrl.auth's cover widens to src/ui/login.*, since login.html had no other cover. - motion.cancel-abort: laser_lifecycle_test.py's new rule 17 on the null-sink controller: 0x85 stops a jog short of its target, Idle; ^X mid-move lands in Alarm with the position kept and no return to the job start; $X recovers to Idle and the next jog ships steps (counted in GFSINK_DUMP). It passes on the driver at its pin, badc832. motion.deadman requires motion.pacing in its place. - forgectrl.settings-bounds: host_routes.sh refuses the out-of-range and over-length values with the settings file byte for byte the same, and the lid lamp under GF_SYSFS_ROOT follows lid_lamp_idle (forgectrl 6c2bb38). - exthost.service: forgeext's host tests at the pinned bb75b23 - sandbox_test (the confinement from inside, the pulse device, the settings file and the setup record refused), run_test.py (the API, safe mode, the master switch, and the killed host under the init script's own wrapper), install_test.py and sdk_test.py. exthost.armed-freeze requires exthost.platform in its place. HOST_TESTED rows for each path the lint named once exthost.service left: forgectrl src/logs.* to logs_test.c and docs/advisories/extensions.md to host_setup.sh; forgeext src/api.*, caps.*, evfeed.*, holdkeep.*, httpreq.*, manifest.*, quota.*, sandbox.*, settings.*, state.* to their unit tests, netrules.* to netrules_test.py, call.* to sdk_test.py, install.*, pkg.* and index.* to install_test.py, and main.c, fflog.* and CMakeLists.txt to run_test.py. test_manifest's behavioral-path case is unaffected. The rootfs lint takes image.health's file checks (rules init-order, logging, watchdog, read-only, dhcpv6, and on a release image factory), each proved in RootfsLintTests by a drift that fails it. image.health keeps the live half: the rendered issue and motd against the running manifest, one host and no pool process, watchdog0, no userspace watchdog running, the mounts, the dev image's factory slots read-only, no DHCPv6 client running, the DHCP client's -b and parent, ifup, the getty, and IPv6. release.sh drops its PermitRootLogin and PermitEmptyPasswords greps, its ROOTFS_READ_ONLY check and its /factory fstab check, which the lint holds; it keeps the empty root shadow field, / mounted ro, and the three HostKey lines under /data. setup.py registers no test now: its helpers the deleted tests alone called go (tls_base, tcp_open, mode, press_status, wiz_summary, wait_settled, the login constants), and test_setup_suite.py keeps the cases of what remains. Fingerprints: image.health's moves (its text), every test in exthost.py, forgectrl.py and motion.py moves with its module text, and the layer content hash moves with rootfs-lint.sh: the next image inherits no campaign. Proof: the coverage lint over the tree manifest from the pins finds 0 uncovered paths and 0 host-tested row problems (43 tests); pyflakes on the touched files is clean; forgetest's unit suite under Linux passes (334), test_image.py's 28 among them. The lint passes image 20261015142442's release tree as release and its dev tree as dev, and refuses the dev tree as release (sshd, factory). laser_lifecycle_test.py passes whole on the null-sink build of badc832.
This commit is contained in:
@@ -64,6 +64,10 @@ reported messages:
|
||||
cancels it from the hold - reason reported, the reset banner, no
|
||||
alarm, the return to the job start - and a later press resumes
|
||||
nothing
|
||||
17. a jog cancel (0x85) stops a jog short of its target, Idle; a ^X
|
||||
mid-move lands in Alarm with the position kept and no return to the
|
||||
job start; $X recovers to Idle and the next jog ships steps
|
||||
(GFSINK_DUMP)
|
||||
|
||||
The disarm grace is shortened via a temp config (GFHOME_CONF), the
|
||||
cooling verdict is published hermetically (GF_VERDICT_FILE), the same
|
||||
@@ -214,9 +218,11 @@ class Session:
|
||||
"""One controller process with the lifecycle overrides applied."""
|
||||
|
||||
def __init__(self, name, fire_ok=True, disarm_s=2, switches=None, conf_extra="",
|
||||
armed_ack=True, ack_after_s=0.0):
|
||||
armed_ack=True, ack_after_s=0.0, dump=False):
|
||||
self.name = name
|
||||
self.workdir = tempfile.mkdtemp(prefix="laser-lifecycle-")
|
||||
# The stream the controller ships, when the case reads it.
|
||||
self.dump = os.path.join(self.workdir, "stream") if dump else None
|
||||
conf = os.path.join(self.workdir, "forgefirm.conf")
|
||||
with open(conf, "w") as f:
|
||||
# The fan grace at 0 keeps the arm's acknowledgment budget at its
|
||||
@@ -228,6 +234,9 @@ class Session:
|
||||
GF_STATE_DIR=self.workdir, FFLOG_STDERR="1")
|
||||
env.pop("GFSINK", None)
|
||||
env.pop("GF_SWITCH_FILE", None)
|
||||
env.pop("GFSINK_DUMP", None)
|
||||
if self.dump:
|
||||
env["GFSINK_DUMP"] = self.dump
|
||||
self.switch_file = None
|
||||
if switches is not None:
|
||||
self.switch_file = os.path.join(self.workdir, "switches")
|
||||
@@ -868,6 +877,64 @@ def test_pause_then_lid_cancel_returns_to_the_job_start():
|
||||
s.close()
|
||||
|
||||
|
||||
def test_cancel_and_abort():
|
||||
"""Rule 17: a jog cancel (0x85) stops a jog short of its target and
|
||||
leaves the controller Idle. A ^X mid-move is a controlled abort: Alarm,
|
||||
the position kept, and no return to the job start (that move is the lid
|
||||
policy's alone). $X recovers to Idle, the head does not move on its
|
||||
own, and the next jog ships steps."""
|
||||
s = Session("cancel-abort", disarm_s=60, dump=True)
|
||||
try:
|
||||
x0 = s.mpos_x()
|
||||
if x0 is None:
|
||||
fail("[cancel-abort] no position in the status report")
|
||||
s.send_raw("$J=G91X40F2400")
|
||||
if not s.wait_state("Jog", 3):
|
||||
fail("[cancel-abort] the jog never reported Jog (state %s)" % s.state())
|
||||
time.sleep(0.3)
|
||||
s.sock.sendall(b"\x85")
|
||||
if not s.wait_state("Idle", 5):
|
||||
fail("[cancel-abort] not Idle after the jog cancel (state %s)" % s.state())
|
||||
x1 = s.mpos_x()
|
||||
if x1 is None or not 0.5 < x1 - x0 < 39.0:
|
||||
fail("[cancel-abort] the jog cancel did not stop short of the target (X %s from %.3f)"
|
||||
% (x1, x0))
|
||||
|
||||
s.send_raw("M5")
|
||||
s.send_raw("G91")
|
||||
s.send_raw("G1 X30 F600") # 3 s
|
||||
if not s.wait_state("Run", 5):
|
||||
fail("[cancel-abort] the move never reported Run (state %s)" % s.state())
|
||||
time.sleep(0.5)
|
||||
s.sock.sendall(b"\x18")
|
||||
if not s.wait_state("Alarm", 5):
|
||||
fail("[cancel-abort] ^X mid-move did not land in Alarm (state %s)" % s.state())
|
||||
x2 = s.mpos_x()
|
||||
if x2 is None or not 0.5 < x2 - x1 < 29.5:
|
||||
fail("[cancel-abort] the abort did not keep a plausible position (X %s from %.3f)" % (x2, x1))
|
||||
send_line(s.sock, "$X", s.log)
|
||||
if not s.wait_state("Idle", 5):
|
||||
fail("[cancel-abort] $X did not recover to Idle (state %s)" % s.state())
|
||||
read_avail(s.sock, s.log, 1.0)
|
||||
if "returned to the job start" in "".join(s.log):
|
||||
fail("[cancel-abort] a sender abort triggered the return to the job start")
|
||||
x3 = s.mpos_x()
|
||||
if x3 is None or abs(x3 - x2) > 0.05:
|
||||
fail("[cancel-abort] the head moved on its own after the abort (X %s, was %.3f)" % (x3, x2))
|
||||
shipped = os.path.getsize(s.dump) if os.path.exists(s.dump) else 0
|
||||
s.send_raw("$J=G91X-5F2400")
|
||||
if not s.wait_state("Jog", 3) or not s.wait_state("Idle", 5):
|
||||
fail("[cancel-abort] the jog after $X did not run (state %s)" % s.state())
|
||||
grew = (os.path.getsize(s.dump) if os.path.exists(s.dump) else 0) - shipped
|
||||
if grew <= 0:
|
||||
fail("[cancel-abort] the jog after $X shipped no steps")
|
||||
print("PASS [cancel-abort]: 0x85 stopped the jog at %.3f mm of 40, Idle; ^X mid-move landed in "
|
||||
"Alarm at %.3f mm with no return; $X recovered to Idle and the next jog shipped %d bytes"
|
||||
% (x1 - x0, x2 - x1, grew))
|
||||
finally:
|
||||
s.close()
|
||||
|
||||
|
||||
def test_lid_cancel_from_hold():
|
||||
"""Rule 16: a job paused on the button is not resumable past a lid
|
||||
open. The lid cancels it from the hold as it does from Run - the
|
||||
@@ -1008,6 +1075,7 @@ def main():
|
||||
test_button_pause_resume()
|
||||
test_lid_cancels_and_returns()
|
||||
test_pause_then_lid_cancel_returns_to_the_job_start()
|
||||
test_cancel_and_abort()
|
||||
test_lid_cancel_from_hold()
|
||||
test_lid_policy_hold()
|
||||
test_sigterm_mid_job()
|
||||
|
||||
Reference in New Issue
Block a user