carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package hostclaim
2
3import (
4 "strings"
5 "testing"
6)
7
8func TestPlan12RetiredLocationWriteGate(t *testing.T) {
9 for _, enabled := range []string{"", "1"} {
10 t.Setenv("CARLOS_HOST_CLAIM_RETIRED_LOCATIONS", enabled)
11 inc := strings.Repeat("a", 64)
12 c := &Claim{Host: "shop.example", Holder: &Holder{Incarnation: inc, Location: "instances/shop.example"}}
13 retire(c, inc)
14 if (c.RetiredLocations[inc] != "") != (enabled == "1") {
15 t.Fatal(enabled, c.RetiredLocations)
16 }
17 }
18}
19