25 lines
730 B
Go
25 lines
730 B
Go
package resolution
|
|
|
|
import (
|
|
"testing"
|
|
|
|
mcat "git.novox.be/novox/mesh-sdk/go/catalogue"
|
|
)
|
|
|
|
// The core's own credentials are what a module's manifest says (core-credentials, issue 774): no module is on a list.
|
|
func TestTheCoresOwnCredentialsAreTheBusTheProvisionerAndItsClient(t *testing.T) {
|
|
for raw, core := range map[string]bool{
|
|
`{"module":"nats","version":"1","core-credentials":true}`: true,
|
|
`{"module":"nats","version":"1"}`: false,
|
|
`{"module":"postgres","version":"1"}`: false,
|
|
} {
|
|
m, err := mcat.Decode([]byte(raw))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if CarriesVaultSealed(m) != core {
|
|
t.Errorf("%s: carries the core's credentials %v", raw, !core)
|
|
}
|
|
}
|
|
}
|