The manifest validator refuses a delivery module's state, log or objects entry with no cap; the catalog reads them from the old sections and the requires entries alike, so the validator judges one list. Builds: design 47 H2 §814, §812
28 lines
1.2 KiB
Go
28 lines
1.2 KiB
Go
package catalogue
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
// Design 47 H2 §812, §814: the validator reads every state, log and objects entry of a manifest that names no cap, in
|
|
// the old sections and in requires alike; a capped entry, and an entry of another template, is none of them.
|
|
func TestAManifestSaysEachKeptStoreThatNamesNoCap(t *testing.T) {
|
|
m, err := decodeForTest([]byte(`{"module":"x","version":"1",
|
|
"state":["seen",{"name":"held","max-mib":8}],
|
|
"logs":[{"name":"acts"},{"name":"kept","max-mib":64}],
|
|
"objects":[{"name":"outputs","max-mib":256}],
|
|
"requires":[{"name":"performed","storage":"key-value","template":"state","options":{"history":1}},
|
|
{"name":"taken","storage":"key-value","template":"state","options":{"max-mib":8,"key-ttl":true}},
|
|
{"name":"archives","storage":"object-store","template":"objects"},
|
|
{"name":"finding-events","storage":"stream","template":"events"}]}`))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
want := []Uncapped{{Name: "seen", Kind: "state", OldSection: true}, {Name: "acts", Kind: "log", OldSection: true},
|
|
{Name: "performed", Kind: "state"}, {Name: "archives", Kind: "objects"}}
|
|
if got := m.UncappedStores(); !reflect.DeepEqual(got, want) {
|
|
t.Fatalf("the uncapped stores are %+v, want %+v", got, want)
|
|
}
|
|
}
|