From aee7705a5fff5067fd64f7d2d8b675a8353d4ce0 Mon Sep 17 00:00:00 2001 From: Renaud Gaubert Date: Mon, 30 Oct 2017 23:23:43 +0100 Subject: [PATCH] Added NodeGenericResource config tests Signed-off-by: Renaud Gaubert Upstream-commit: 734346a37e0cd5d2576f759d302beed5033ff14e Component: engine --- .../engine/daemon/config/config_test.go | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/components/engine/daemon/config/config_test.go b/components/engine/daemon/config/config_test.go index 30a93126d3..bdd046bcdc 100644 --- a/components/engine/daemon/config/config_test.go +++ b/components/engine/daemon/config/config_test.go @@ -259,6 +259,20 @@ func TestValidateConfigurationErrors(t *testing.T) { }, }, }, + { + config: &Config{ + CommonConfig: CommonConfig{ + NodeGenericResources: []string{"foo"}, + }, + }, + }, + { + config: &Config{ + CommonConfig: CommonConfig{ + NodeGenericResources: []string{"foo=bar", "foo=1"}, + }, + }, + }, } for _, tc := range testCases { err := Validate(tc.config) @@ -316,6 +330,20 @@ func TestValidateConfiguration(t *testing.T) { }, }, }, + { + config: &Config{ + CommonConfig: CommonConfig{ + NodeGenericResources: []string{"foo=bar", "foo=baz"}, + }, + }, + }, + { + config: &Config{ + CommonConfig: CommonConfig{ + NodeGenericResources: []string{"foo=1"}, + }, + }, + }, } for _, tc := range testCases { err := Validate(tc.config)