From c6b5d98699cd332b063c4e3e6aeb2496487603df Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 15 Jul 2016 18:02:15 +0200 Subject: [PATCH] Test the case when a plugin reports more than one plugin --- probe/plugins/registry_internal_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/probe/plugins/registry_internal_test.go b/probe/plugins/registry_internal_test.go index cba906965..5b7a3bc0a 100644 --- a/probe/plugins/registry_internal_test.go +++ b/probe/plugins/registry_internal_test.go @@ -425,6 +425,11 @@ func TestRegistryRejectsErroneousPluginResponses(t *testing.T) { Name: "changedId", Handler: stringHandler(http.StatusOK, `{"Plugins":[{"id":"differentId","label":"changedId","interfaces":["reporter"]}]}`), }.file(), + mockPlugin{ + t: t, + Name: "moreThanOnePlugin", + Handler: stringHandler(http.StatusOK, `{"Plugins":[{"id":"moreThanOnePlugin","label":"moreThanOnePlugin","interfaces":["reporter"]}, {"id":"haha","label":"haha","interfaces":["reporter"]}]}`), + }.file(), ) defer restore(t) @@ -442,6 +447,11 @@ func TestRegistryRejectsErroneousPluginResponses(t *testing.T) { Label: "changedId", Status: `error: plugin must not change its id (is "differentId", should be "changedId")`, }, + { + ID: "moreThanOnePlugin", + Label: "moreThanOnePlugin", + Status: `error: report must contain exactly one plugin (found 2)`, + }, { ID: "noInterface", Label: "noInterface",