systemd-resolved: the machine's socket answers routes with outside_writes too (review r2 (5))
It answered an empty outside_writes while the bus answered the kept history; the socket now reads the guard's own history (its own history file, the same the bus's tools() reads in production), so both answer the same (§5, DQ-5). Builds: design 08 sign-in-page §5, §9, DQ-5
This commit is contained in:
@@ -12,6 +12,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
noderesolver "git.novox.be/novox/mesh-networking/modules/mesh-connectivity-contracts/go/seats/noderesolver"
|
||||
)
|
||||
|
||||
const meshFile = "# Managed by the mesh\nnameserver 10.42.0.2\noptions timeout:3 attempts:2 edns0\n"
|
||||
@@ -188,6 +190,25 @@ func TestNothingIsGuardedBeforeTheFileIsRendered(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// The machine's socket answers routes with outside_writes too, the guard's own history, the same the bus
|
||||
// reads (design 08 sign-in-page §5; DQ-5, review r2 (5)).
|
||||
func TestTheSocketsRoutesAnswersOutsideWritesFromTheGuardsOwnHistory(t *testing.T) {
|
||||
g, _, _ := aGuardedMachine(t)
|
||||
write(t, g.Path, vpnFile)
|
||||
g.Tick()
|
||||
reply := g.Answer(context.Background(), Request{Verb: "routes"})
|
||||
if reply.Error != "" {
|
||||
t.Fatal(reply.Error)
|
||||
}
|
||||
answer, ok := reply.Result.(noderesolver.RoutesAnswer)
|
||||
if !ok {
|
||||
t.Fatalf("the result is %T, not a RoutesAnswer", reply.Result)
|
||||
}
|
||||
if len(answer.OutsideWrites) != 1 || answer.OutsideWrites[0].Writer != "FortiClient" {
|
||||
t.Errorf("outside_writes is %+v, want the one the guard just kept", answer.OutsideWrites)
|
||||
}
|
||||
}
|
||||
|
||||
// The socket: a module routes and takes the write standing now in one call, and the module's file is
|
||||
// back; a bad request and an unknown verb are answered, not dropped; the socket is root's alone.
|
||||
func TestTheVerbsOnTheMachine(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user