27 lines
838 B
Go
27 lines
838 B
Go
package frombustest
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"git.novox.be/novox/mesh-sdk/go/compose/frombus"
|
|
)
|
|
|
|
// ADR 0570 clause 2 (issue 1954; a3's H5): the in-memory mesh composes a plan from the bus that hands restic to the
|
|
// provisioner and names its postgres-database, provided by postgres on n1.
|
|
func TestTheProvisionedMeshHandsAPlanWithItsProvision(t *testing.T) {
|
|
b, err := Provisioned()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
plans, err := frombus.Plans(context.Background(), b, frombus.Mesh{}, frombus.Scope{Node: Node})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
restic, handed := plans["restic"]
|
|
if !handed || len(restic.Provisions) != 1 || restic.Provisions[0].Provision != "postgres-database" ||
|
|
restic.Provisions[0].Provider != Node || restic.Provisions[0].ProviderModule != "postgres" {
|
|
t.Fatalf("the plans are %+v", plans)
|
|
}
|
|
}
|