@@ -157,7 +157,7 @@ func TestSwapPlugin(t *testing.T) {
157157 lpe := newListenToPluginEvent ()
158158 c .eventManager .RegisterHandler ("Control.PluginsSwapped" , lpe )
159159
160- _ , e := load (c , fixtures .PluginPath )
160+ _ , e := load (c , fixtures .PluginPathMock2 )
161161 Convey ("Loading first plugin" , t , func () {
162162 Convey ("Should not error" , func () {
163163 So (e , ShouldBeNil )
@@ -177,8 +177,7 @@ func TestSwapPlugin(t *testing.T) {
177177 So (c .PluginCatalog ()[0 ].Name (), ShouldEqual , "mock" )
178178 })
179179 })
180- mock1Path := strings .Replace (fixtures .PluginPath , "snap-plugin-collector-mock2" , "snap-plugin-collector-mock1" , 1 )
181- mockRP , mErr := core .NewRequestedPlugin (mock1Path )
180+ mockRP , mErr := core .NewRequestedPlugin (fixtures .PluginPathMock1 )
182181 Convey ("Loading a plugin should not error" , t , func () {
183182 So (mErr , ShouldBeNil )
184183 })
@@ -224,7 +223,7 @@ func TestSwapPlugin(t *testing.T) {
224223 })
225224 })
226225
227- filePath := strings .Replace (fixtures .PluginPath , "snap-plugin-collector-mock2" , "snap-plugin-publisher-mock-file" , 1 )
226+ filePath := strings .Replace (fixtures .PluginPathMock2 , "snap-plugin-collector-mock2" , "snap-plugin-publisher-mock-file" , 1 )
228227 fileRP , pErr := core .NewRequestedPlugin (filePath )
229228 Convey ("Loading a plugin should not error" , t , func () {
230229 So (pErr , ShouldBeNil )
@@ -248,7 +247,7 @@ func TestSwapPlugin(t *testing.T) {
248247 pm .ExistingPlugin = lp
249248 c .pluginManager = pm
250249
251- mockRP , mErr := core .NewRequestedPlugin (mock1Path )
250+ mockRP , mErr := core .NewRequestedPlugin (fixtures . PluginPathMock1 )
252251 So (mErr , ShouldBeNil )
253252 err := c .SwapPlugins (mockRP , lp )
254253 Convey ("So err should be received if rollback fails" , func () {
@@ -357,7 +356,7 @@ func TestLoad(t *testing.T) {
357356
358357 // Testing trying to load before starting pluginControl
359358 Convey ("pluginControl before being started" , t , func () {
360- _ , err := load (c , fixtures .PluginPath )
359+ _ , err := load (c , fixtures .PluginPathMock2 )
361360 Convey ("should return an error when loading a plugin" , func () {
362361 So (err , ShouldNotBeNil )
363362 })
@@ -371,7 +370,7 @@ func TestLoad(t *testing.T) {
371370 time .Sleep (100 * time .Millisecond )
372371 lpe := newListenToPluginEvent ()
373372 c .eventManager .RegisterHandler ("Control.PluginLoaded" , lpe )
374- _ , err := load (c , fixtures .PluginPath )
373+ _ , err := load (c , fixtures .PluginPathMock2 )
375374 Convey ("pluginControl.Load on successful load" , t , func () {
376375 Convey ("Should not return an error" , func () {
377376 So (err , ShouldBeNil )
@@ -400,7 +399,7 @@ func TestLoad(t *testing.T) {
400399 c .Stop ()
401400 time .Sleep (100 * time .Millisecond )
402401 } else {
403- fmt .Printf ("SNAP_PATH not set. Cannot test %s plugin.\n " , fixtures .PluginName )
402+ fmt .Printf ("SNAP_PATH not set. Cannot test %s plugin.\n " , fixtures .PluginNameMock2 )
404403 }
405404}
406405
@@ -414,7 +413,7 @@ func TestLoadWithSignedPlugins(t *testing.T) {
414413 c .eventManager .RegisterHandler ("Control.PluginLoaded" , lpe )
415414 c .Start ()
416415 time .Sleep (100 * time .Millisecond )
417- _ , err := load (c , fixtures .PluginPath , "mock.asc" )
416+ _ , err := load (c , fixtures .PluginPathMock2 , "mock.asc" )
418417 Convey ("so error on loading a signed plugin should be nil" , func () {
419418 So (err , ShouldBeNil )
420419 })
@@ -430,7 +429,7 @@ func TestLoadWithSignedPlugins(t *testing.T) {
430429 c .eventManager .RegisterHandler ("Control.PluginLoaded" , lpe )
431430 c .Start ()
432431 time .Sleep (100 * time .Millisecond )
433- _ , err := load (c , fixtures .PluginPath )
432+ _ , err := load (c , fixtures .PluginPathMock2 )
434433 Convey ("so error on loading an unsigned plugin should be nil" , func () {
435434 So (err , ShouldBeNil )
436435 })
@@ -443,14 +442,14 @@ func TestLoadWithSignedPlugins(t *testing.T) {
443442 c .signingManager = & mocksigningManager {signed : false }
444443 c .Start ()
445444 time .Sleep (100 * time .Millisecond )
446- _ , err := load (c , fixtures .PluginPath )
445+ _ , err := load (c , fixtures .PluginPathMock2 )
447446 Convey ("so error should not be nil when loading an unsigned plugin with trust enabled" , func () {
448447 So (err , ShouldNotBeNil )
449448 })
450449 c .Stop ()
451450 })
452451 } else {
453- fmt .Printf ("SNAP_PATH not set. Cannot test %s plugin.\n " , fixtures .PluginName )
452+ fmt .Printf ("SNAP_PATH not set. Cannot test %s plugin.\n " , fixtures .PluginNameMock2 )
454453 }
455454}
456455
@@ -464,7 +463,7 @@ func TestUnload(t *testing.T) {
464463 c .eventManager .RegisterHandler ("TestUnload" , lpe )
465464 c .Start ()
466465 time .Sleep (100 * time .Millisecond )
467- _ , e := load (c , fixtures .PluginPath )
466+ _ , e := load (c , fixtures .PluginPathMock2 )
468467 Convey ("Loading a plugin to test unload" , t , func () {
469468 Convey ("Should not error" , func () {
470469 So (e , ShouldBeNil )
@@ -516,7 +515,7 @@ func TestUnload(t *testing.T) {
516515 c .Stop ()
517516 time .Sleep (100 * time .Millisecond )
518517 } else {
519- fmt .Printf ("SNAP_PATH not set. Cannot test %s plugin.\n " , fixtures .PluginName )
518+ fmt .Printf ("SNAP_PATH not set. Cannot test %s plugin.\n " , fixtures .PluginNameMock2 )
520519 }
521520}
522521
@@ -770,7 +769,7 @@ func TestMetricConfig(t *testing.T) {
770769 c .Start ()
771770 lpe := newListenToPluginEvent ()
772771 c .eventManager .RegisterHandler ("Control.PluginLoaded" , lpe )
773- _ , err := load (c , fixtures .JSONRPCPluginPath )
772+ _ , err := load (c , fixtures .PluginPathMock1 )
774773 So (err , ShouldBeNil )
775774 <- lpe .done
776775
@@ -805,7 +804,7 @@ func TestMetricConfig(t *testing.T) {
805804 c .Start ()
806805 lpe := newListenToPluginEvent ()
807806 c .eventManager .RegisterHandler ("Control.PluginLoaded" , lpe )
808- _ , err := load (c , fixtures .JSONRPCPluginPath )
807+ _ , err := load (c , fixtures .PluginPathMock1 )
809808 So (err , ShouldBeNil )
810809 <- lpe .done
811810 m1 := fixtures.MockMetricType {
@@ -829,7 +828,7 @@ func TestMetricConfig(t *testing.T) {
829828 c .Start ()
830829 lpe := newListenToPluginEvent ()
831830 c .eventManager .RegisterHandler ("Control.PluginLoaded" , lpe )
832- _ , err := load (c , fixtures .JSONRPCPluginPath )
831+ _ , err := load (c , fixtures .PluginPathMock1 )
833832 So (err , ShouldBeNil )
834833 <- lpe .done
835834
@@ -854,7 +853,7 @@ func TestMetricConfig(t *testing.T) {
854853 c .Start ()
855854 lpe := newListenToPluginEvent ()
856855 c .eventManager .RegisterHandler ("Control.PluginLoaded" , lpe )
857- _ , err := load (c , fixtures .JSONRPCPluginPath )
856+ _ , err := load (c , fixtures .PluginPathMock1 )
858857 So (err , ShouldBeNil )
859858 <- lpe .done
860859 m1 := fixtures.MockMetricType {
@@ -878,7 +877,7 @@ func TestRoutingCachingStrategy(t *testing.T) {
878877 c .Start ()
879878 lpe := newListenToPluginEvent ()
880879 c .eventManager .RegisterHandler ("Control.PluginLoaded" , lpe )
881- _ , e := load (c , fixtures .PluginPath )
880+ _ , e := load (c , fixtures .PluginPathMock2 )
882881 So (e , ShouldBeNil )
883882 if e != nil {
884883 t .FailNow ()
@@ -948,7 +947,7 @@ func TestRoutingCachingStrategy(t *testing.T) {
948947 )
949948 lpe := newListenToPluginEvent ()
950949 c .eventManager .RegisterHandler ("Control.PluginLoaded" , lpe )
951- _ , e := load (c , fixtures .JSONRPCPluginPath )
950+ _ , e := load (c , fixtures .PluginPathMock1 )
952951 So (e , ShouldBeNil )
953952 if e != nil {
954953 t .FailNow ()
@@ -1028,8 +1027,8 @@ func TestCollectDynamicMetrics(t *testing.T) {
10281027 So (strategy .GlobalCacheExpiration , ShouldResemble , time .Second * 1 )
10291028 lpe := newListenToPluginEvent ()
10301029 c .eventManager .RegisterHandler ("Control.PluginLoaded" , lpe )
1031- _ , e := load (c , fixtures .PluginPath )
1032- Convey ("Loading native client plugin" , func () {
1030+ _ , e := load (c , fixtures .PluginPathMock2 )
1031+ Convey ("Loading the first native client plugin" , func () {
10331032 Convey ("Should not error" , func () {
10341033 So (e , ShouldBeNil )
10351034 })
@@ -1038,8 +1037,9 @@ func TestCollectDynamicMetrics(t *testing.T) {
10381037 t .FailNow ()
10391038 }
10401039 <- lpe .done
1041- _ , e = load (c , fixtures .JSONRPCPluginPath )
1042- Convey ("Loading JSONRPC client plugin" , func () {
1040+
1041+ _ , e = load (c , fixtures .PluginPathMock1 )
1042+ Convey ("Loading the second native client plugin" , func () {
10431043 Convey ("Should not error" , func () {
10441044 So (e , ShouldBeNil )
10451045 })
@@ -1126,7 +1126,7 @@ func TestFailedPlugin(t *testing.T) {
11261126 c .Config .Plugins .All .AddItem ("password" , ctypes.ConfigValueStr {Value : "testval" })
11271127
11281128 // Load plugin
1129- _ , e := load (c , fixtures .PluginPath )
1129+ _ , e := load (c , fixtures .PluginPathMock2 )
11301130 So (e , ShouldBeNil )
11311131 <- lpe .done
11321132 _ , err := c .MetricCatalog ()
@@ -1210,7 +1210,7 @@ func TestCollectMetrics(t *testing.T) {
12101210 c .Config .Plugins .Collector .Plugins ["mock" ] = newPluginConfigItem (optAddPluginConfigItem ("test" , ctypes.ConfigValueBool {Value : true }))
12111211
12121212 // Load plugin
1213- _ , e := load (c , fixtures .JSONRPCPluginPath )
1213+ _ , e := load (c , fixtures .PluginPathMock1 )
12141214 So (e , ShouldBeNil )
12151215 <- lpe .done
12161216 mts , err := c .MetricCatalog ()
@@ -1304,7 +1304,7 @@ func TestCollectNonSpecifiedDynamicMetrics(t *testing.T) {
13041304 c .Config .Plugins .Collector .Plugins ["mock" ] = newPluginConfigItem (optAddPluginConfigItem ("test" , ctypes.ConfigValueBool {Value : true }))
13051305
13061306 // Load plugin
1307- _ , e := load (c , fixtures .JSONRPCPluginPath )
1307+ _ , e := load (c , fixtures .PluginPathMock1 )
13081308 So (e , ShouldBeNil )
13091309 <- lpe .done
13101310 mts , err := c .MetricCatalog ()
@@ -1387,7 +1387,7 @@ func TestCollectSpecifiedDynamicMetrics(t *testing.T) {
13871387 c .Start ()
13881388
13891389 // Load plugin
1390- _ , e := load (c , fixtures .JSONRPCPluginPath )
1390+ _ , e := load (c , fixtures .PluginPathMock1 )
13911391 So (e , ShouldBeNil )
13921392
13931393 mts , err := c .MetricCatalog ()
0 commit comments