Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Update file plugin version to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
geauxvirtual authored and pittma committed Oct 29, 2015
1 parent da222f6 commit a4985e8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions control/control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -940,15 +940,15 @@ func TestPublishMetrics(t *testing.T) {
<-lpe.done
So(err, ShouldBeNil)
So(len(c.pluginManager.all()), ShouldEqual, 1)
lp, err2 := c.pluginManager.get("publisher:file:1")
lp, err2 := c.pluginManager.get("publisher:file:2")
So(err2, ShouldBeNil)
So(lp.Name(), ShouldResemble, "file")
So(lp.ConfigPolicy, ShouldNotBeNil)

Convey("Subscribe to file publisher with good config", func() {
n := cdata.NewNode()
config.Plugins.Publisher.Plugins[lp.Name()] = newPluginConfigItem(optAddPluginConfigItem("file", ctypes.ConfigValueStr{Value: "/tmp/pulse-TestPublishMetrics.out"}))
pool, errp := c.pluginRunner.AvailablePlugins().getOrCreatePool("publisher:file:1")
pool, errp := c.pluginRunner.AvailablePlugins().getOrCreatePool("publisher:file:2")
So(errp, ShouldBeNil)
pool.subscribe("1", unboundSubscriptionType)
err := c.pluginRunner.runPlugin(lp.Path)
Expand All @@ -963,7 +963,7 @@ func TestPublishMetrics(t *testing.T) {
enc := gob.NewEncoder(&buf)
enc.Encode(metrics)
contentType := plugin.PulseGOBContentType
errs := c.PublishMetrics(contentType, buf.Bytes(), "file", 1, n.Table())
errs := c.PublishMetrics(contentType, buf.Bytes(), "file", 2, n.Table())
So(errs, ShouldBeNil)
ap := c.AvailablePlugins()
So(ap, ShouldNotBeEmpty)
Expand Down
6 changes: 3 additions & 3 deletions mgmt/rest/client/client_func_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func TestPulseClient(t *testing.T) {
So(p3.Err, ShouldBeNil)
So(p3.LoadedPlugins, ShouldNotBeEmpty)
So(p3.LoadedPlugins[0].Name, ShouldEqual, "file")
So(p3.LoadedPlugins[0].Version, ShouldEqual, 1)
So(p3.LoadedPlugins[0].Version, ShouldEqual, 2)
So(p3.LoadedPlugins[0].LoadedTime().Unix(), ShouldBeLessThanOrEqualTo, time.Now().Unix())
})
Convey("there should be three loaded plugins", func() {
Expand Down Expand Up @@ -451,10 +451,10 @@ func TestPulseClient(t *testing.T) {
So(p2.Version, ShouldEqual, 2)
So(p2.Type, ShouldEqual, "collector")

p3 := c.UnloadPlugin("publisher", "file", 1)
p3 := c.UnloadPlugin("publisher", "file", 2)
So(p3.Err, ShouldBeNil)
So(p3.Name, ShouldEqual, "file")
So(p3.Version, ShouldEqual, 1)
So(p3.Version, ShouldEqual, 2)
So(p3.Type, ShouldEqual, "publisher")
})
Convey("unload when only one plugin loaded", func() {
Expand Down
2 changes: 1 addition & 1 deletion plugin/publisher/pulse-publisher-file/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (

const (
name = "file"
version = 1
version = 2
pluginType = plugin.PublisherPluginType
)

Expand Down
2 changes: 1 addition & 1 deletion scheduler/workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TestCollectPublishWorkflow(t *testing.T) {
w.CollectNode.AddMetric("/intel/dummy/foo", 2)
w.CollectNode.AddConfigItem("/intel/dummy/foo", "password", "secret")

pu := wmap.NewPublishNode("file", 1)
pu := wmap.NewPublishNode("file", 2)
pu.AddConfigItem("file", "/tmp/pulse-TestCollectPublishWorkflow.out")

pr := wmap.NewProcessNode("passthru", 1)
Expand Down

0 comments on commit a4985e8

Please sign in to comment.