issue 1838: name the kernel module's fixtures by what they show (as in the fix's own branch)

This commit is contained in:
2026-10-22 14:27:15 +02:00
parent 0f4e631cdd
commit 2cb2e27cdf
2 changed files with 6 additions and 6 deletions
@@ -1,6 +1,6 @@
package main package main
// Over a stand-in tree holding novox's own files of 2026-10-14 23:25 (read through node-reads for // Over a stand-in tree holding the files of a real machine of 2026-10-14 23:25 (read through node-reads for
// novox/hq issue 746): the mode, the per-size controls, meminfo's huge page lines, and fail2ban's and // novox/hq issue 746): the mode, the per-size controls, meminfo's huge page lines, and fail2ban's and
// journald's memory.stat and io.stat, cut to the lines the tool reads. // journald's memory.stat and io.stat, cut to the lines the tool reads.
@@ -26,7 +26,7 @@ func tree(t *testing.T, files map[string]string) *Machine {
return &Machine{Root: root} return &Machine{Root: root}
} }
func novox(t *testing.T) *Machine { func capturedMachine(t *testing.T) *Machine {
thp := "sys/kernel/mm/transparent_hugepage/" thp := "sys/kernel/mm/transparent_hugepage/"
cg := "sys/fs/cgroup/system.slice/" cg := "sys/fs/cgroup/system.slice/"
files := map[string]string{ files := map[string]string{
@@ -53,8 +53,8 @@ func novox(t *testing.T) *Machine {
return tree(t, files) return tree(t, files)
} }
func TestNovoxBeforeTheChange(t *testing.T) { func TestTheCapturedMachineBeforeTheChange(t *testing.T) {
a, err := novox(t).HugePages(10) a, err := capturedMachine(t).HugePages(10)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@@ -86,7 +86,7 @@ func TestNovoxBeforeTheChange(t *testing.T) {
} }
func TestUnitsAreBoundedAndNoneIsSaid(t *testing.T) { func TestUnitsAreBoundedAndNoneIsSaid(t *testing.T) {
a, err := novox(t).HugePages(1) a, err := capturedMachine(t).HugePages(1)
if err != nil || len(a.Units) != 1 { if err != nil || len(a.Units) != 1 {
t.Fatalf("%v %+v", err, a) t.Fatalf("%v %+v", err, a)
} }
@@ -129,7 +129,7 @@ func (b bed) file(t *testing.T, p string) string {
} }
func TestApplySetsTheModeRotatesTheJournalOnceAndRestoreGivesBackWhatWasFound(t *testing.T) { func TestApplySetsTheModeRotatesTheJournalOnceAndRestoreGivesBackWhatWasFound(t *testing.T) {
// novox's file on 2026-10-14, read through node-reads. // a real machine's file on 2026-10-14, read through node-reads.
b := newBed(t, "madvise", "[always] madvise never\n") b := newBed(t, "madvise", "[always] madvise never\n")
out, err := b.run(t, "apply") out, err := b.run(t, "apply")
if err != nil || !strings.Contains(out, "always -> madvise") { if err != nil || !strings.Contains(out, "always -> madvise") {