| 1 | package provision |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | func TestPlan14P3OverlayPreservesLegacySeal(t *testing.T) { |
| 6 | root := censusRoot(t) |
| 7 | inv := rootReadInventory{Entries: map[string]classifiedRootRead{}, Coverage: map[string]string{}} |
| 8 | for i, name := range []string{"plan14-root-reads.tsv", "plan14-root-reads-moves.tsv", "plan14-root-reads-merge.tsv", "plan14-root-reads-fix1.tsv", "plan14-root-reads-fix2.tsv", "plan14-root-reads-merge3.tsv", "plan14-root-reads-fix4.tsv", "plan14-root-reads-fix5.tsv", "plan14-root-reads-fix6.tsv", "plan14-root-reads-zddr3.tsv", "plan14-root-reads-hotfix281.tsv", "plan14-root-reads-zddr4.tsv", "plan14-root-reads-reserved285.tsv", "plan14-root-reads-292.tsv", "plan14-root-reads-census-ruling-275.tsv", "plan14-root-reads-census-ruling-owed.tsv", "plan14-root-reads-carlos-run.tsv", "plan14-root-reads-seeded-instances.tsv", "plan14-root-reads-hostfiles-cap-236.tsv", "plan14-root-reads-moves-overcap-cut-236.tsv", "plan14-root-reads-seed.tsv", "plan14-root-reads-home-part2.tsv", "plan14-root-reads-fix-empty-app-key.tsv", "plan14-root-reads-region-ha-2a.tsv", "plan14-root-reads-e.tsv", "plan14-root-reads-p3.tsv", "plan14-root-reads-activation-tools.tsv"} { |
| 9 | if err := loadRootReadInventory(root+"/internal/provision/testdata/"+name, &inv, i > 0); err != nil { |
| 10 | t.Fatal(err) |
| 11 | } |
| 12 | if name == "plan14-root-reads-e.tsv" || name == "plan14-root-reads-p3.tsv" { |
| 13 | if errs := checkRootReadLegacy(inv, "8198674d8809ef90ecebac55324bfd75e69fb3d73bc27b942f29ca2f43e3fe8d"); len(errs) != 0 { |
| 14 | t.Fatal(errs) |
| 15 | } |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | // The conservative write scanner recognizes the local helper's name as a |
| 21 | // record-key site. These calls write root floor files, never instance records. |
| 22 | func plan14P3WriteCensusInventory() []censusEntry { |
| 23 | entries := plan14EWriteCensusInventory() |
| 24 | kept := make([]censusEntry, 0, len(entries)) |
| 25 | for _, e := range entries { |
| 26 | if e.File == "internal/hostclaim/claim.go" && e.Unit == "Claim.Validate" { |
| 27 | continue |
| 28 | } |
| 29 | if e.File == "internal/host/rootexecution_authority.go" && e.Unit == "ClaimRootHTTP.executionAuthority" { |
| 30 | continue |
| 31 | } |
| 32 | if e.File == "internal/host/claimproduction.go" && e.Unit == "productionClaimRegional.View" { |
| 33 | continue |
| 34 | } |
| 35 | if e.File == "internal/host/rootgenerations_launch.go" && e.Unit == "rootGenerationSource.resolve" { |
| 36 | continue |
| 37 | } |
| 38 | if e.File == "internal/release/roothistory_delivery.go" && (e.Unit == "PublishHistoryReconstruction" || e.Unit == "PublishHistoryRecoveryRetirement") { |
| 39 | continue |
| 40 | } |
| 41 | if (e.File == "internal/host/proofbinding.go" && e.Unit == "proofBindingSource.binding") || |
| 42 | (e.File == "internal/host/proofbinding.go" && e.Unit == "proofBindingSource.unitBinding") || |
| 43 | (e.File == "internal/host/proofnamed.go" && e.Unit == "proofBindingSource.record") || |
| 44 | (e.File == "internal/host/rootinventory.go" && e.Unit == "ClaimRootHTTP.commitRootInventoryPending") { |
| 45 | continue |
| 46 | } |
| 47 | if e.File == "internal/host/rootgeneration_inventory.go" && e.Unit == "generationReconciler.reconcile" { |
| 48 | continue |
| 49 | } |
| 50 | if e.File == "internal/host/rootgeneration_requirements.go" && (e.Unit == "generationRequiredInventory" || e.Unit == "generationLocalObligations") { |
| 51 | continue |
| 52 | } |
| 53 | kept = append(kept, e) |
| 54 | } |
| 55 | return append(kept, |
| 56 | censusEntry{"internal/layout/census.go", "VerifyInstanceCensusAlias", "reference", "lit:instances", "86ce305862058b648878f2deed2b1289c8c109b510420e61a13dc376f70300d2"}, |
| 57 | censusEntry{"internal/layout/census.go", "InstanceCensusName", "reference", "lit:instances", "f1997087a9be9630ffc0c62ac6ddcfb765b1a4bd7f8a15aa215dd0e44ca7047e"}, |
| 58 | censusEntry{"internal/host/rootinventory_sibling.go", "ClaimRootHTTP.rootSiblingPath", "key-site", "key:RecordKey,lit:instances", "43657b556a4c238a0fae72aad5f89c13d1f4168b7417644934474ea918cf0176"}, |
| 59 | censusEntry{"internal/hostclaim/claim.go", "Claim.Validate", "key-site", "lit:instances", "ffeb10f34954f5b4c8566ee1d66a89a99eb303a8611e4671696dd312c5296c29"}, |
| 60 | censusEntry{"internal/hostclaim/retainedloss.go", "validateRetainedAdmissionLosses", "reference", "lit:instances", "b32ddaed69411feaa06c45e84287fb1c09b0168498231a5386e3acd937d335e0"}, |
| 61 | censusEntry{"internal/host/rootexecution_authority.go", "ClaimRootHTTP.executionAuthority", "key-site", "key:RecordKey,lit:instances", "d4c3831803029792b9bdc5d1a98049fe31a4cbca24dc3f09aac768533cd8ffee"}, |
| 62 | censusEntry{"internal/host/claimproduction.go", "productionClaimRegional.View", "reference", "lit:instances", "bcefe9f8fd6420e795ef95a6170fbad1030e29f2261bcc2d677f76b6f6d577ce"}, |
| 63 | censusEntry{"internal/host/claimordinaryparks.go", "productionClaimRegional.ordinaryHome", "reference", "lit:instances", "fa96f75f8af5fd1e3ba3dff81e27ac0fb7c6029663472292d698bfddaec99fe8"}, |
| 64 | censusEntry{"internal/host/rootgeneration_inventory.go", "generationReconciler.reconcile", "key-site", "key:RecordKey", "da4df99dcbcec0cd62025c8c50e8f6be19e64ac990034002bcad1a6b8332bcb6"}, |
| 65 | censusEntry{"internal/host/rootgeneration_requirements.go", "generationRequiredInventory", "key-site", "key:RecordKey", "3c0eb88abc5680c67191d1e848e93ba528c66e81bcd521577098ce761fb827e0"}, |
| 66 | censusEntry{"internal/host/rootgeneration_requirements.go", "generationLocalObligations", "key-site", "key:RecordKey", "1a5c493c0a6383df880d4d6e730f6d01822559cab804b57ac445e36bb4535f3c"}, |
| 67 | censusEntry{"internal/host/proofbinding.go", "proofBindingSource.binding", "key-site", "key:RecordKey", "20ed721cbcaccb6ab813a0d317542a43fe057544811920ba43ac6431c3e73000"}, |
| 68 | censusEntry{"internal/host/proofbinding.go", "proofBindingSource.unitBinding", "key-site", "key:RecordKey", "82e214d1cf66d29d0900f5c1ce9cfe0a2f31c070da4bf1497ef3fd5273c09aad"}, |
| 69 | censusEntry{"internal/host/proofnamed.go", "proofBindingSource.record", "key-site", "key:RecordKey", "97f1501b9543e36c6a231170425c5c79c7c22489500aadf119e064abc1abde93"}, |
| 70 | censusEntry{"internal/host/rootinventory.go", "ClaimRootHTTP.commitRootInventoryPending", "key-site", "key:RecordKey", "b00707c1c5a3b1f3b51fd573fbb09a176bda8a055e64232b9044b7c78640ba51"}, |
| 71 | censusEntry{"internal/host/rootgenerations_launch.go", "rootGenerationSource.resolve", "key-site", "key:RecordKey", "3cd7c8132e9c451c983392f4d1cc676ddc14b761c90dec3e631d54ae800f9951"}, |
| 72 | censusEntry{"internal/host/rootupdates.go", "rootUpdateSource.resolve", "key-site", "key:RecordKey", "6c5c447d2abd518a941979dcd1748ee028f3b555ce077fad849c02be0c77c2fa"}, |
| 73 | censusEntry{"internal/host/rootmovesfloor.go", "rootMovesFloors.refresh", "key-site", "key:writeRecord", "cb70a1eefbb4f8f243090270f23141c9c9a773ee278af002c79a6c3ef6b7c3b7"}, |
| 74 | censusEntry{"internal/host/rootmovesfloor.go", "rootMovesFloors.persist", "key-site", "key:writeRecord", "2c1e0843c5865a31c0fab011d7d4825963bbb5a301727f37f3b1b6c3519eba5e"}, |
| 75 | censusEntry{"internal/host/rootmovesfloor.go", "rootMovesFloors.writeRecord", "key-site", "key:writeRecord", "a8a51bdd73f8ab1447edf2241d19a41ba1bcb0084ef045d370e5282aca7e9e66"}, |
| 76 | ) |
| 77 | } |
| 78 | |