package console import ( "context" "errors" "testing" "github.com/carlosframework/platform/internal/hostops" "github.com/carlosframework/platform/internal/provision" "github.com/carlosframework/platform/internal/release" ) func TestClaimRecoveryAndRetirementAreInert(t *testing.T) { s := &Server{cfg: Config{Releases: release.NewDirStore(t.TempDir())}} ctx := context.Background() if err := s.claimRecoveryPass(ctx); err != nil { t.Fatal(err) } s.StartClaimRecoveryPass(ctx) // Must return without a ticker or store reads. ref := provision.RetireRef{Family: "instance", Account: "bab", App: "jam", Host: "shop.bab.example.com"} if err := s.retireHostRecord(ctx, ref); err != nil { t.Fatal(err) } s.cfg.HostClaim = true if err := s.claimRecoveryPass(ctx); !errors.Is(err, hostops.ErrContract) { t.Fatal(err) } if err := s.retireHostRecord(ctx, ref); !errors.Is(err, provision.ErrClaimRetirer) { t.Fatal(err) } }