diff --git a/cmd/mesh-controller/composed_served_integration_test.go b/cmd/mesh-controller/composed_served_integration_test.go index 6d0a1a1a..5361f835 100644 --- a/cmd/mesh-controller/composed_served_integration_test.go +++ b/cmd/mesh-controller/composed_served_integration_test.go @@ -171,6 +171,10 @@ func aServedMesh(t *testing.T) *servedMesh { for _, m := range storeManifests() { shelf[m.Module] = m } + // The board is given its credential in a file, as a consumer of a database is. + board := shelf["board"] + board.Secrets = map[string]string{"postgres-database": "/var/lib/board/database-password"} + shelf["board"] = board for i, module := range []string{"store", "board"} { raw, k, trunk := keyOfManifest(t, shelf[module], fpOf(byte('a'+i)), "c0ffee0123456789") keys := trunkKeys{keyBuckets: keyBuckets{keys: map[string]builderkeys.Key{module: aBuilderKey(module, trunk.FP2, k)}, @@ -363,6 +367,7 @@ func TestServedADoneKeyIsComposedAndGranted(t *testing.T) { shelf[mf.Module] = mf } next := shelf["board"] + next.Secrets = map[string]string{"postgres-database": "/var/lib/board/database-password"} next.Version = "2" fp := fpOf('c') raw, k, trunk := keyOfManifest(t, next, fp, "d00d0123456789ab") @@ -418,8 +423,8 @@ func TestServedARotationRewritesOnlyTheCompositionsThatUseIt(t *testing.T) { } boardKey, _ := sdkdelivery.ComposedKey("laptop", "board", fpOf('b')) storeKey, _ := sdkdelivery.ComposedKey("anchor", "store", fpOf('a')) - // The store's grants carry the consumer's credential: its composition moves with the rotation. - m.waitFor(t, nil, "anchor", storeKey, before["anchor"][storeKey]) + // The board's sealed credential file is new: its composition moves with the rotation. + m.waitFor(t, nil, "laptop", boardKey, before["laptop"][boardKey]) moved := map[string]bool{} for node, was := range before { for k, rev := range m.revisions(t, node) { @@ -433,8 +438,8 @@ func TestServedARotationRewritesOnlyTheCompositionsThatUseIt(t *testing.T) { t.Errorf("%s moved: only the compositions carrying the credential do", k) } } - if !moved[storeKey] { - t.Errorf("the store's composition did not move: %v", moved) + if !moved[boardKey] { + t.Errorf("the board's composition did not move: %v", moved) } if n := m.declarationsSent(t); n != 0 { t.Errorf("%d declarations were sent", n)