On all four machines and owned by none. The module declares the package and the daemon. It leaves nsswitch.conf and nss-mdns as found — the hosts: line is one list every name source shares, and the host writes blocks, not line members — and opens nothing: the mesh's filter drops inbound UDP 5353 on every machine and `listens` has no local-link scope. avahi_status, _browse, _resolve and _services report both (to-be 42 Phase 1).
27 lines
834 B
Go
27 lines
834 B
Go
package main
|
|
|
|
// The module's shape (novox/hq to-be 42 Phase 1, research 027): the package and the daemon, and
|
|
// nothing written into the name service switch or opened in the packet filter — avahi.go says why
|
|
// neither can be declared safely today, and the tools report both instead.
|
|
|
|
import "testing"
|
|
|
|
func TestItDeclaresThePackageAndTheDaemonOnly(t *testing.T) {
|
|
m := manifest(t)
|
|
if p := m.resource(t, "package"); p["package"] != "avahi" {
|
|
t.Fatalf("%v", p)
|
|
}
|
|
d := m.resource(t, "daemon")
|
|
if d["unit"] != Daemon || d["state"] != "running" || d["boot"] != "enabled" {
|
|
t.Fatalf("%v", d)
|
|
}
|
|
for _, r := range m.Resources {
|
|
if r["path"] == NSSwitch || r["package"] == "nss-mdns" {
|
|
t.Fatalf("%v: the name service switch is left as found", r["id"])
|
|
}
|
|
}
|
|
if len(m.Resources) != 2 {
|
|
t.Fatalf("%v", m.Resources)
|
|
}
|
|
}
|