bastion 0.55.3
This commit is contained in:
@@ -484,7 +484,7 @@ func TestRepeatedRefusedWritesQuarantineThePairing(t *testing.T) {
|
||||
for i := 0; i < quarantineStrikes; i++ {
|
||||
driveJob(t, tAnchor, putJob(""), ctx, "")
|
||||
}
|
||||
if u := quarantinedUntil(tAnchor, time.Now()); u.IsZero() || u.Sub(time.Now()) > quarantineBase+time.Minute {
|
||||
if u := quarantinedUntil(tAnchor, time.Now()); u.IsZero() || time.Until(u) > quarantineBase+time.Minute {
|
||||
t.Fatalf("a cleared hold is forgiven — the next one is the base length again: %v", u)
|
||||
}
|
||||
// Strikes double when the hold lapses on its own.
|
||||
@@ -494,7 +494,7 @@ func TestRepeatedRefusedWritesQuarantineThePairing(t *testing.T) {
|
||||
for i := 0; i < quarantineStrikes; i++ {
|
||||
driveJob(t, tAnchor, putJob(""), ctx, "")
|
||||
}
|
||||
if u := quarantinedUntil(tAnchor, time.Now()); u.IsZero() || u.Sub(time.Now()) < 2*quarantineBase-time.Minute {
|
||||
if u := quarantinedUntil(tAnchor, time.Now()); u.IsZero() || time.Until(u) < 2*quarantineBase-time.Minute {
|
||||
t.Fatalf("a repeat hold doubles: %v", u)
|
||||
}
|
||||
}
|
||||
@@ -1010,12 +1010,15 @@ func TestAnchoredEgressRefusesLoopbackAndPrivateDestinations(t *testing.T) {
|
||||
if addr, why := egressVettedAddr(ctx, "localhost:80"); why == "" || addr != "" {
|
||||
t.Fatalf("a refused name yields no address: %q %q", addr, why)
|
||||
}
|
||||
// A local box refuses this machine too, and keeps its LAN
|
||||
// (egress_local_test.go has the rest).
|
||||
t.Setenv("XDG_CONFIG_HOME", t.TempDir())
|
||||
if why := egressInternalRefusal(ctx, "127.0.0.1:11434"); why != "" {
|
||||
t.Fatalf("a local box keeps its lane: %s", why)
|
||||
stubOwnAddrs(t, loopbackOnly, localRange())
|
||||
if why := egressInternalRefusal(ctx, "127.0.0.1:11434"); why == "" {
|
||||
t.Fatal("a local box must refuse its own ollama on the egress lane")
|
||||
}
|
||||
if addr, _ := egressVettedAddr(ctx, "example.com:443"); addr != "example.com:443" {
|
||||
t.Fatalf("a local box dials the name it was given: %q", addr)
|
||||
if addr, why := egressVettedAddr(ctx, "192.168.1.1:80"); why != "" || addr != "192.168.1.1:80" {
|
||||
t.Fatalf("a local box keeps its LAN: %q %q", addr, why)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user