summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2015-12-09 16:52:17 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-12-15 11:34:54 +0000
commitff83a8987cae6aba71e4b912d6f3dd7a390fc1c3 (patch)
treeae423ee6c6c7750f44fa9a6a38b13b7d57eca083
parent0ce1059bf31f9a4b37de5424d8bde4543976353b (diff)
downloadlorry-controller-ff83a8987cae6aba71e4b912d6f3dd7a390fc1c3.tar.gz
Add tests for 'ignore' and 'globs' validation
* Does not explicitely test 'globs' validation. * Also verifies a missing 'ignore' field does not result in error. Change-Id: I8140185a485cccdf7086533d3afcc6b7fc5f121b
-rw-r--r--yarns.webapp/060-validation.yarn24
1 files changed, 24 insertions, 0 deletions
diff --git a/yarns.webapp/060-validation.yarn b/yarns.webapp/060-validation.yarn
index 040f6cd..076879b 100644
--- a/yarns.webapp/060-validation.yarn
+++ b/yarns.webapp/060-validation.yarn
@@ -97,6 +97,30 @@ not have a reasonable way to get the Trove ID of the local Trove, so
we're skipping implementing that test for now. (FIXME: fix this lack
of testing.)
+The `ignore` field in a `trove` section and the `globs` field in a
+`lorry` section are expected to be lists of strings, test a non-list
+value.
+
+ GIVEN an empty lorry-controller.conf in CONFGIT
+ AND lorry-controller.conf in CONFGIT adds trove example-trove
+ AND lorry-controller.conf in CONFGIT sets ignore to "foo" for trove example-trove
+ WHEN admin makes request POST /1.0/read-configuration
+ THEN response matches "ERROR"
+ AND STATEDB is empty
+
+And a non-string list.
+
+ GIVEN lorry-controller.conf in CONFGIT sets ignore to "[1, 2]" for trove example-trove
+ WHEN admin makes request POST /1.0/read-configuration
+ THEN response matches "ERROR"
+ AND STATEDB is empty
+
+`ignore` is is not a mandatory option, verify this is the case.
+
+ GIVEN lorry-controller.conf in CONFGIT removes field ignore from trove example-trove
+ WHEN admin makes request POST /1.0/read-configuration
+ THEN response matches "Configuration has been updated"
+
Clean up at the end.
FINALLY WEBAPP terminates