regulators: Validate config files during CI
Let the validate-regulators-config.py tool run during CI on all the
files in the config_files directory to make sure they are valid.
Tested:
* Test interaction between this script and CI:
* Verify an exit code of 0 causes CI to pass
* Verify a non-zero exit code causes CI to fail
* Test with one config file:
* Test where valid; exit code should be 0
* Test where invalid; exit code should be non-zero
* Test with multiple config files:
* Test where all valid; exit code should be 0
* Test where first file checked is invalid; exit code should be
non-zero
* Test where last file checked is invalid; exit code should be
non-zero
Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: I4babd409170e3eb6fcc36c8fdd5a34be41d55edb
diff --git a/phosphor-regulators/test/run-ci.sh b/phosphor-regulators/test/run-ci.sh
new file mode 100755
index 0000000..9aaa9f5
--- /dev/null
+++ b/phosphor-regulators/test/run-ci.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+rc=0
+for file in phosphor-regulators/config_files/*.json
+do
+ phosphor-regulators/tools/validate-regulators-config.py \
+ -s phosphor-regulators/schema/config_schema.json \
+ -c "$file" || rc=1
+done
+exit $rc