package host import ( "context" "database/sql" "github.com/carlosframework/platform/internal/hostbox" "github.com/carlosframework/platform/internal/release" "github.com/carlosframework/platform/internal/rootparticipation" "testing" ) func openLegacyInventory(t *testing.T, path string) (*hostbox.StopInventoryDB, error) { t.Helper() j, err := hostbox.OpenLaunchJournal(path) if err != nil { return nil, err } t.Cleanup(func() { j.Close() }) service, err := hostbox.NewJournalService(j) if err != nil { return nil, err } db, err := sql.Open("sqlite", path) if err != nil { return nil, err } defer db.Close() for _, name := range []string{"launches", "journal_requests", "journal_receipt_retention"} { if _, err := db.Exec("DROP TABLE " + name); err != nil { return nil, err } } return service.Inventory, nil } func legacyActivationReady(ctx context.Context) error { l, err := rootparticipation.Open() if err != nil { return err } defer l.State.Close() return l.ActivationReady(ctx) } func publishHistoryFixture(ctx context.Context, store release.Store, signer release.Signer, key string, grant any) error { raw, err := release.SignRootEnvelope(signer, grant) if err != nil { return err } _, err = store.Put(ctx, key, raw, "") return err }