Harnesses: the null-sink cases other tests prove leave

The grblHAL harnesses keep what only a running controller shows; the
cases a host unit test in grblHAL-glowforge proves, and the log and
reply wording, leave.

- laser_lifecycle_test: test_arm_waits_for_the_fans goes. laser_arm_test
  case A4 (grblHAL-glowforge) proves the fan grace stretching the arm's
  acknowledgment budget, on the same arm path. The docstring names it.
- xy_mode_test: case_x32, case_invalid and the log checks go; the
  default, x16 and the low tick stay. xy_scale_test holds each mode's
  tick and the not-a-mode parse.
- planner_blocks_test: one restart, at $398 1000; the 400 pass and the
  fresh-store probe go.
- ctlport_test: test_poll_lf and test_crlf go (the CR LF poll stays); in
  test_sender_out the network turn-away goes (serial_test holds it), and
  the busy gating, the grant and the outlives-client part stay.
  test_port_dark is whole.
- mcode_test: the timeout case runs on the host build's 5 s
  GFMCODE_WAIT_S (grblHAL-glowforge's CI configures it; the image keeps
  30 s) and still shows the hold, at 5.1 s; 5 s outlasts the 3 s
  test_dark watches the wait; test_table refuses one form per
  parser branch. test_timeout_holds and test_dark stay.
- envelope_test: test_unset and test_bounds go (lens_home_test holds the
  clamp); test_armed and the open, apply and close cases stay.
- manual_home_test: the out-of-range offset block goes, a repeat of
  gfhome_clamp_home_mm (lens_home_test); the modal-M3 FIRE check and
  every release and energize case stay.
- cool_report_test: one non-hex secret and one CR LF injection stay;
  runner-malformed and the exact header-set checks go. A bad secret is
  never sent and a good one is.
- tray_test: test_offset keeps 20 mm; test_errors keeps a bad P and a
  bad axis; the frame shift, envelope, barrier, persistence, port op,
  unreferenced lens and camera home stay.

Proof: with grblHAL-glowforge's matching commit, the eleven harnesses
its CI runs pass under Linux against the null-sink build: nine on a
build with a 1 s M-code wait, and mcode_test and tray_test, the two
that wait at an M-code, on the 5 s build CI configures
(-DGFMCODE_WAIT_S=5.0). pyflakes reports nothing in the nine changed
files.

Push this before grblHAL-glowforge's commit.

Acceptance: none; host harnesses only.
This commit is contained in:
ScottW514
2026-10-13 21:20:31 -04:00
parent 520d62ac05
commit 8e1fe5090d
9 changed files with 66 additions and 216 deletions
+8 -27
View File
@@ -9,21 +9,20 @@ Runs the native grblHAL_glowforge binary in null-sink mode, with the
scripted sender and the port client of ctlport_test.py, homing manually
(nothing moves; X and Y become homed and the envelope is set):
1. unset keys: X's and Y's far edges are the travel ($130, $131)
2. envelope_x_mm and _y set the far edges at a home, and a jog past one
is the core's error:15
3. a key below GFHOME_ENVELOPE_MIN_MM is held to it, and one past the
travel plus GFHOME_ENVELOPE_EXTRA_MM is held to that
4. the port's envelope open: refused before a home (error:homed); after
1. envelope_x_mm and _y set the far edges at a home, and a jog past one
is the core's error:15 (an unset key being the travel, and a key held
to GFHOME_ENVELOPE_MIN_MM and to the travel plus
GFHOME_ENVELOPE_EXTRA_MM, are lens_home_test.c's in grblHAL-glowforge)
2. the port's envelope open: refused before a home (error:homed); after
one, the port's jogs reach the travel plus 30 mm for X and Y, and the
port's state says the envelope is open; envelope apply puts the keys'
edges back without a home
5. an open envelope is the port's jogs' alone: a status poll and an
3. an open envelope is the port's jogs' alone: a status poll and an
empty line leave it open, and the sender's first line closes it before
the core reads the line (the line then answered ok, and the keys'
edges in force), a port jog it meets canceled
6. a soft reset and the port client going away each close it
7. envelope open is refused under an open armed window (busy:state)
4. a soft reset and the port client going away each close it
5. envelope open is refused under an open armed window (busy:state)
Usage: envelope_test.py [path/to/grblHAL_glowforge]
"""
@@ -111,14 +110,6 @@ def saw_within(s, needle, seconds=2.0):
return s.sender.saw(needle)
def test_unset(s):
conf(s)
home(s)
edge(s, "X", TRAVEL_X - 1, TRAVEL_X + 1, "unset")
edge(s, "Y", TRAVEL_Y - 1, TRAVEL_Y + 1, "unset")
print("PASS [unset]: with no key the far edges are the travel, %.0f and %.0f" % (TRAVEL_X, TRAVEL_Y))
def test_measured(s):
conf(s, envelope_x_mm=480, envelope_y_mm=284.5)
home(s)
@@ -127,14 +118,6 @@ def test_measured(s):
print("PASS [measured]: envelope_x_mm 480 and envelope_y_mm 284.5 (past the travel) are the far edges at a home")
def test_bounds(s):
conf(s, envelope_x_mm=10, envelope_y_mm=900)
home(s)
edge(s, "X", 49, 51, "bounds")
edge(s, "Y", TRAVEL_Y + EXTRA - 1, TRAVEL_Y + EXTRA + 1, "bounds")
print("PASS [bounds]: a key below 50 mm is held to 50, one past the travel plus 30 mm to that")
def test_open_apply(s):
conf(s, envelope_x_mm=480, envelope_y_mm=250)
home(s)
@@ -249,9 +232,7 @@ def main():
fail("no controller binary at %s" % ct.BIN)
s = ct.Session()
try:
test_unset(s)
test_measured(s)
test_bounds(s)
test_open_apply(s)
test_sender_closes(s)
test_reset_closes(s)