NP1: the NFS server and package manager modules' tests fold into one test per file, within 50 as the check counts

The check counts every test the integration level runs, untagged ones in: the NFS server
module held 51 and the package manager module 121, over the budget of 50. Each folded file's
tests run in order as rows of one test that keeps the first one's name and logs each case
before it runs; the root helper's test sockets are numbered per call, as one test now holds
several listeners, and the case that skips without pacman-conf runs last. Counts now 48 and 42.

Builds: design 47 H2 §819; H-A-349 DQ-14
This commit is contained in:
2026-11-22 01:18:06 +01:00
parent a6132b32f6
commit 9afbd35759
14 changed files with 382 additions and 99 deletions
@@ -21,7 +21,7 @@ func countExportfs(ran []string) int {
// and the kernel still exported the refused folder while the module said it was healthy. A failed reload
// is tried again on the next pass, and while the kernel exports anything of the module's that the file no
// longer carries, the module is unhealthy and says what.
func TestARefusalWhoseReloadFailedIsReloadedAgainAndIsUnhealthyUntilItIs(t *testing.T) {
func testARefusalWhoseReloadFailedIsReloadedAgainAndIsUnhealthyUntilItIs(t *testing.T) {
f := newFake(t)
f.mountinfo("/", "/srv/pool")
f.dir("/srv/pool")
@@ -72,7 +72,7 @@ func TestARefusalWhoseReloadFailedIsReloadedAgainAndIsUnhealthyUntilItIs(t *test
// that never happened — is reconciled: the first pass always reloads, a later pass reloads when the kernel
// exports one of the module's folders to a client the file no longer has, and the module is unhealthy
// while it cannot.
func TestAWithdrawnGrantIsTakenFromTheKernel(t *testing.T) {
func testAWithdrawnGrantIsTakenFromTheKernel(t *testing.T) {
f := newFake(t)
f.mountinfo("/", "/srv/library")
f.dir("/srv/library")
@@ -122,7 +122,7 @@ func TestAWithdrawnGrantIsTakenFromTheKernel(t *testing.T) {
// The review of #142: SIGTERM in the middle of a pass on a plain restart (the config is still there) ends
// the pass, and the exports stay: the export file is unchanged and the kernel's table keeps the share.
func TestSIGTERMDuringAPassOnARestartLeavesTheExports(t *testing.T) {
func testSIGTERMDuringAPassOnARestartLeavesTheExports(t *testing.T) {
f := newFake(t)
f.mountinfo("/", "/srv/library")
f.dir("/srv/library")
@@ -173,7 +173,7 @@ func TestSIGTERMDuringAPassOnARestartLeavesTheExports(t *testing.T) {
// unassignment then stops it with the config still there. The node-engine disables a process's unit before
// it stops it (`systemctl disable --now`), and a restart or a shutdown leaves it enabled, so a process
// whose own unit is disabled when it is stopped is being taken away, whatever the config says.
func TestAProcessWhoseUnitIsDisabledAtStopCleansUpWithTheConfigStillThere(t *testing.T) {
func testAProcessWhoseUnitIsDisabledAtStopCleansUpWithTheConfigStillThere(t *testing.T) {
f := newFake(t)
f.mountinfo("/", "/srv/library")
f.dir("/srv/library")
@@ -199,3 +199,20 @@ func TestAProcessWhoseUnitIsDisabledAtStopCleansUpWithTheConfigStillThere(t *tes
t.Errorf("the kernel still exports the library after an unassignment with the config in place: %q", f.read(Etab))
}
}
// TestARefusalWhoseReloadFailedIsReloadedAgainAndIsUnhealthyUntilItIs runs this file's cases in order as one test, each a row: the check counts every top-level test against the
// module's budget of 50 (design 47 H2 §819). A failing case is named by the line logged before it.
func TestARefusalWhoseReloadFailedIsReloadedAgainAndIsUnhealthyUntilItIs(t *testing.T) {
for _, c := range []struct {
name string
run func(*testing.T)
}{
{"TestARefusalWhoseReloadFailedIsReloadedAgainAndIsUnhealthyUntilItIs", testARefusalWhoseReloadFailedIsReloadedAgainAndIsUnhealthyUntilItIs},
{"TestAWithdrawnGrantIsTakenFromTheKernel", testAWithdrawnGrantIsTakenFromTheKernel},
{"TestSIGTERMDuringAPassOnARestartLeavesTheExports", testSIGTERMDuringAPassOnARestartLeavesTheExports},
{"TestAProcessWhoseUnitIsDisabledAtStopCleansUpWithTheConfigStillThere", testAProcessWhoseUnitIsDisabledAtStopCleansUpWithTheConfigStillThere},
} {
t.Logf("case %s", c.name)
c.run(t)
}
}