oficina / alta Public

Clone
git clone https://amadan.net/oficina/alta

Plain git — no account needed to clone.

Download

Download this file

1package altacompat
2
3import (
4 "testing"
5
6 "amadan.net/oficina/alta/homeop"
7 "amadan.net/oficina/alta/provision"
8 "amadan.net/oficina/home/internal/home/directorydata"
9)
10
11// homeop.CanonicalOrigin is Alta's copy of Home's closed registry of
12// canonical instances. It must agree with Home's at the pinned commit for
13// every app Alta knows and for names neither may admit: an app Alta adopts
14// that Home does not bind is a plan Home refuses, and the reverse is an
15// app Alta would never offer.
16func TestCanonicalOriginIsHomes(t *testing.T) {
17 // ReservedLabels holds every app-like name (each app's, the suite's
18 // and the platform's own), so a name added to either registry that
19 // the other lacks fails here.
20 names := append(provision.Slugs(), "", "Base", "base.oficina.works", "https://base.oficina.works")
21 for label := range provision.ReservedLabels {
22 names = append(names, label)
23 }
24 for _, app := range names {
25 if got, want := homeop.CanonicalOrigin(app), directorydata.CanonicalOrigin(app); got != want {
26 t.Errorf("CanonicalOrigin(%q): Alta %q, Home %q", app, got, want)
27 }
28 }
29 if homeop.CanonicalOrigin("base") != "https://base.oficina.works" {
30 t.Fatal("Base's canonical origin")
31 }
32}
33