d2ee7161

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Decide at evaluation time everything that is known then

routeros-vmtest was a command that parsed a --chassis flag and a file
argument out of bash, and vmtestFor existed only to hand it both. Since
both are known when the derivation is built, there is now one function
that takes them and no command that parses anything: vmtest.nix is gone
and vmtestFor does the whole job.

What that buys, beyond deleting the argument parsing and the jq
dependency:

- A chassis this image cannot stand in for is an evaluation error rather
  than a message somebody reads five minutes into a boot.
- The interface list and the serial port count are constants in the script
  instead of jq reading the chassis back at runtime.
- What the two RouterOS versions are, and whether they differ, is decided
  when the script is written.
- The file the router fetches over tftp is a store directory, so the only
  thing the command still assembles is the disk image, which it has to,
  because the router writes to it.

The selftest listed its examples with a shell glob; builtins.readDir
knows them at evaluation time, so it builds one vm test per example and
reads each .expected with lib.fileContents.

The chassis parser in Haskell now takes all five fields rather than the
two it uses. A stale chassis is then an error rather than something that
parses and quietly means less than it says.

Total

8s

Created Started Finished

Time to Start Worker time Duration Time to finish Idle
Config 5s 1s 1s 6s 5s
Eval 6s 6s 6s 13s 0s
Build 12s 0s 0s 12s 0s
Suite 5s 8s 8s 13s 5s

Timeline

Config Eval Build Compressed gap
0s10s