Verify every copy to a lab VM against the local sha256

vm_scp trusted the copy's exit status, so a file that arrived short went on to run. A real run wrote 1015808 of 1075200 bytes with exit 0.

vm_scp now hashes the file on the VM after each send and compares it with the local sha256. A mismatch sends the file once more. A second mismatch fails, naming the file and both sizes. The transport is unchanged.

flowchart LR
  A[send] --> B{VM sha256 = local?}
  B -- yes --> C[done]
  B -- no, first --> A
  B -- no, second --> D[fail: file, both sizes]

Test: new engine selftest cases stub a truncating transport. They fail on the old code (3 red) and pass now; one case also checks a truncate-once copy is sent again and lands whole.

Live proof on an omnibus rig: the cause did not reproduce on the old code in 25 copies per path (scp and ssh stdin, 64 KiB to 64 MiB) or in 24 concurrent 8 MiB copies per path under CPU load, so this is a net. On this head, 25 vm_scp copies gave 0 mismatches and 0 retries.

Closes #73

Merge request reports

Loading
Loading