mirror of
https://github.com/openglow-org/forgefirm.git
synced 2026-10-17 10:01:41 -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:
@@ -29,6 +29,18 @@
|
||||
# mdns no mDNS responder: no /etc/avahi, no avahi-daemon, no
|
||||
# libnss_mdns, and the hosts line of nsswitch.conf names no
|
||||
# mdns source.
|
||||
# init-order runlevel 5 starts forgectrl before forgeext, and runlevel 6
|
||||
# stops grblhal before forgectrl and forgeext before
|
||||
# forgectrl: the links sort in that order.
|
||||
# logging a ForgeFIRM logging init script is on the image
|
||||
# (forgefirm-logging or forgefirm-logrotate).
|
||||
# watchdog no userspace watchdog init script (/etc/init.d/watchdog):
|
||||
# the kernel feeds the hardware watchdog.
|
||||
# read-only /etc/default/rcS sets ROOTFS_READ_ONLY=yes.
|
||||
# dhcpv6 no DHCPv6 client (udhcpc6, dhcp6c, odhcp6c) in a bin
|
||||
# directory, and no /usr/share/udhcpc/default6.script.
|
||||
# factory on a release image, no /etc/fstab line mounts anything
|
||||
# under /factory/ (the dev image mounts the factory slots).
|
||||
|
||||
root=${1:?rootfs}
|
||||
kind=${2:?release or dev}
|
||||
@@ -141,4 +153,52 @@ if active "$root/etc/nsswitch.conf" | grep -E '^[[:space:]]*hosts:' | grep -q 'm
|
||||
fail mdns "nsswitch.conf resolves hosts through mdns"
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------ init-order
|
||||
# link <runlevel dir> <S|K> <name>: the first link of that kind whose name
|
||||
# ends in name, or nothing
|
||||
link() {
|
||||
for l in "$root/etc/$1"/"$2"*"$3"; do
|
||||
[ -L "$l" ] || [ -e "$l" ] || continue
|
||||
echo "${l##*/}"
|
||||
return
|
||||
done
|
||||
}
|
||||
# before <what> <a> <b>: a and b are both there and a sorts first
|
||||
before() {
|
||||
if [ -z "$2" ] || [ -z "$3" ]; then
|
||||
fail init-order "$1: a link is missing (${2:-none}, ${3:-none})"
|
||||
elif [ "$(printf '%s\n%s\n' "$2" "$3" | LC_ALL=C sort | head -n 1)" != "$2" ] || [ "$2" = "$3" ]; then
|
||||
fail init-order "$1: $2 does not sort before $3"
|
||||
fi
|
||||
}
|
||||
before "rc5.d starts forgectrl before forgeext" "$(link rc5.d S forgectrl)" "$(link rc5.d S forgeext)"
|
||||
before "rc6.d stops grblhal before forgectrl" "$(link rc6.d K grblhal)" "$(link rc6.d K forgectrl)"
|
||||
before "rc6.d stops forgeext before forgectrl" "$(link rc6.d K forgeext)" "$(link rc6.d K forgectrl)"
|
||||
|
||||
# --------------------------------------------------------------- logging
|
||||
[ -e "$root/etc/init.d/forgefirm-logging" ] || [ -e "$root/etc/init.d/forgefirm-logrotate" ] \
|
||||
|| fail logging "no ForgeFIRM logging init script (forgefirm-logging, forgefirm-logrotate)"
|
||||
|
||||
# -------------------------------------------------------------- watchdog
|
||||
[ -e "$root/etc/init.d/watchdog" ] && fail watchdog "/etc/init.d/watchdog is on the image"
|
||||
|
||||
# ------------------------------------------------------------- read-only
|
||||
grep -qx 'ROOTFS_READ_ONLY=yes' "$root/etc/default/rcS" 2>/dev/null \
|
||||
|| fail read-only "/etc/default/rcS does not set ROOTFS_READ_ONLY=yes"
|
||||
|
||||
# ---------------------------------------------------------------- dhcpv6
|
||||
for d in bin sbin usr/bin usr/sbin; do
|
||||
for p in udhcpc6 dhcp6c odhcp6c; do
|
||||
if [ -e "$root/$d/$p" ] || [ -L "$root/$d/$p" ]; then
|
||||
fail dhcpv6 "/$d/$p is on the image"
|
||||
fi
|
||||
done
|
||||
done
|
||||
[ -e "$root/usr/share/udhcpc/default6.script" ] && fail dhcpv6 "/usr/share/udhcpc/default6.script is on the image"
|
||||
|
||||
# --------------------------------------------------------------- factory
|
||||
if [ "$kind" = release ] && active "$root/etc/fstab" | awk '$2 ~ /^\/factory\// { f = 1 } END { exit !f }'; then
|
||||
fail factory "/etc/fstab mounts a factory slot under /factory/ on a release image"
|
||||
fi
|
||||
|
||||
exit $failed
|
||||
|
||||
Reference in New Issue
Block a user