@@ -20,8 +20,9 @@ func TestStartWarnsOnPlaceholderCatalogPubkey(t *testing.T) {
2020 t .Run ("placeholder (all-zeros) → warns" , func (t * testing.T ) {
2121 var buf strings.Builder
2222 s := NewService (Config {
23- InstallRoot : t .TempDir (),
24- Logger : log .New (& buf , "" , 0 ),
23+ CataloguePublisher : testCatPub ,
24+ InstallRoot : t .TempDir (),
25+ Logger : log .New (& buf , "" , 0 ),
2526 })
2627 ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Second )
2728 defer cancel ()
@@ -38,9 +39,10 @@ func TestStartWarnsOnPlaceholderCatalogPubkey(t *testing.T) {
3839 realKey := make ([]byte , 32 )
3940 realKey [0 ] = 0x01 // any non-zero byte qualifies
4041 s := NewService (Config {
41- InstallRoot : t .TempDir (),
42- CatalogPubkey : realKey ,
43- Logger : log .New (& buf , "" , 0 ),
42+ CataloguePublisher : testCatPub ,
43+ InstallRoot : t .TempDir (),
44+ CatalogPubkey : realKey ,
45+ Logger : log .New (& buf , "" , 0 ),
4446 })
4547 ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Second )
4648 defer cancel ()
@@ -72,7 +74,7 @@ func TestNewServiceDefaults(t *testing.T) {
7274
7375func TestStartStopEmptyInstallRoot (t * testing.T ) {
7476 dir := t .TempDir ()
75- s := NewService (Config {InstallRoot : dir })
77+ s := NewService (Config {InstallRoot : dir , CataloguePublisher : testCatPub })
7678
7779 ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Second )
7880 defer cancel ()
@@ -87,7 +89,7 @@ func TestStartStopEmptyInstallRoot(t *testing.T) {
8789
8890func TestStartCreatesInstallRoot (t * testing.T ) {
8991 dir := filepath .Join (t .TempDir (), "nested" , "apps" )
90- s := NewService (Config {InstallRoot : dir })
92+ s := NewService (Config {InstallRoot : dir , CataloguePublisher : testCatPub })
9193
9294 ctx , cancel := context .WithTimeout (context .Background (), 2 * time .Second )
9395 defer cancel ()
@@ -111,8 +113,9 @@ func TestRescanDiscoversAppInstalledMidRun(t *testing.T) {
111113 writeValidAppDir (t , root , "io.app1" )
112114
113115 svc := NewService (Config {
114- InstallRoot : root ,
115- RescanInterval : 30 * time .Millisecond , // fast for tests
116+ CataloguePublisher : testCatPub ,
117+ InstallRoot : root ,
118+ RescanInterval : 30 * time .Millisecond , // fast for tests
116119 })
117120 ctx , cancel := context .WithTimeout (context .Background (), 3 * time .Second )
118121 defer cancel ()
@@ -152,8 +155,9 @@ func TestRescanDetectsUninstall(t *testing.T) {
152155 writeValidAppDir (t , root , "io.app2" )
153156
154157 svc := NewService (Config {
155- InstallRoot : root ,
156- RescanInterval : 30 * time .Millisecond ,
158+ CataloguePublisher : testCatPub ,
159+ InstallRoot : root ,
160+ RescanInterval : 30 * time .Millisecond ,
157161 })
158162 ctx , cancel := context .WithTimeout (context .Background (), 3 * time .Second )
159163 defer cancel ()
@@ -195,7 +199,7 @@ func TestRescanResumeClearsSuspendedMarker(t *testing.T) {
195199 root := t .TempDir ()
196200 appDir := writeValidAppDir (t , root , "io.suspended.app" )
197201
198- sup := newSupervisor (Config {InstallRoot : root }, Deps {}, newQuietLogger (t ))
202+ sup := newSupervisor (Config {InstallRoot : root , CataloguePublisher : testCatPub }, Deps {}, newQuietLogger (t ))
199203 sup .mu .Lock ()
200204 sup .installed ["io.suspended.app" ] = & installedApp {
201205 Dir : appDir ,
@@ -241,8 +245,9 @@ func TestRescanResumesAppOnMarker(t *testing.T) {
241245 // exceeding the crash-loop cap; we don't need the live goroutine
242246 // for the resume signal to be testable).
243247 sup := newSupervisor (Config {
244- InstallRoot : root ,
245- RescanInterval : 20 * time .Millisecond ,
248+ CataloguePublisher : testCatPub ,
249+ InstallRoot : root ,
250+ RescanInterval : 20 * time .Millisecond ,
246251 }, Deps {}, newQuietLogger (t ))
247252 sup .mu .Lock ()
248253 sup .installed ["io.suspended.app" ] = & installedApp {
@@ -285,7 +290,7 @@ func TestScanIgnoresInvalidManifest(t *testing.T) {
285290 empty := filepath .Join (root , "io.empty.app" )
286291 _ = os .MkdirAll (empty , 0o755 )
287292
288- sup := newSupervisor (Config {InstallRoot : root }, Deps {}, newQuietLogger (t ))
293+ sup := newSupervisor (Config {InstallRoot : root , CataloguePublisher : testCatPub }, Deps {}, newQuietLogger (t ))
289294 apps , err := sup .scanInstalled ()
290295 if err != nil {
291296 t .Fatalf ("scan: %v" , err )
0 commit comments