| new file mode 100644 |
| index 000000000..d6bbe337a |
| --- /dev/null |
| +++ b/internal/provision/cert_import_1429_census_test.go |
| @@ -0,0 +1,45 @@ |
| +package provision |
| + |
| +// Record-write census entries for cert-import-1429 (imported TLS |
| +// certificates), layered on dpaAcceptanceWriteCensusInventory (the inventory |
| +// TestPlan9B8RecordWriteCensus used before this branch). Two new sites, both |
| +// "nonrecord": neither writes a provision record, a sidecar or an app |
| +// record key. |
| +// - domains.WriteImport (internal/domains/certimport_invariant.go) puts |
| +// control/certs/<host>+import, the imported TLS certificate entry, in |
| +// the same certificate area as the certsync.go putCAS row. It builds no |
| +// record key. |
| +// - certMirror.reconcileLocalImport (internal/edge/certimport.go) writes |
| +// the edge's local autocert cache file for an imported certificate, the |
| +// way certMirror.reconcileLocal does for an issued one. The Put it |
| +// calls is the cache's, not a store record write. |
| +// |
| +// Two key-site tables are re-pinned, class and kinds unchanged: var |
| +// routeDecls (routedecls.go) and var linkedPolicies (linkedpolicy.go) gained |
| +// the certificate import routes and their policy rows. The instances and |
| +// sidecars literals are the same; no record key is built or written. |
| +func certImport1429WriteCensusInventory() []censusEntry { |
| + entries := append([]censusEntry(nil), dpaAcceptanceWriteCensusInventory()...) |
| + repins := []censusEntry{ |
| + {"internal/console/routedecls.go", "var routeDecls", "key-site", "lit:instances,lit:sidecars", "ab0e68b6178465afad159e26147aeceebe9a7c07d3e293cd0177b8490a11a9ee"}, |
| + {"internal/console/linkedpolicy.go", "var linkedPolicies", "key-site", "lit:instances,lit:sidecars", "2e185fc69d8984d7b04b5baf88fa0b4406ff7b2a139dd4f065187ac85917f28d"}, |
| + } |
| + for _, r := range repins { |
| + found := false |
| + for i, e := range entries { |
| + if e.File == r.File && e.Unit == r.Unit { |
| + if e.Class != r.Class || e.Kinds != r.Kinds { |
| + panic("cert-import-1429 re-pin changes the class or kinds of " + r.File + ":" + r.Unit) |
| + } |
| + entries[i], found = r, true |
| + } |
| + } |
| + if !found { |
| + panic("cert-import-1429 re-pin of an unlisted unit " + r.File + ":" + r.Unit) |
| + } |
| + } |
| + return append(entries, |
| + censusEntry{"internal/domains/certimport_invariant.go", "WriteImport", "nonrecord", "sel:Put", "7504f93cc5c8c1c265cf268a384509edd8e1abe6d9b3b370131a914b0b754648"}, |
| + censusEntry{"internal/edge/certimport.go", "certMirror.reconcileLocalImport", "nonrecord", "sel:Put", "75389fc8111a3d299a0b87861136af4f0284fb5b43edcdaf05548f1a768e9f3e"}, |
| + ) |
| +} |