[node-patches] Change in ovirt-node[master]: tests: Add simple validation script

fabiand at fedoraproject.org fabiand at fedoraproject.org
Wed Sep 19 09:02:52 UTC 2012


Fabian Deutsch has uploaded a new change for review.

Change subject: tests: Add simple validation script
......................................................................

tests: Add simple validation script

'make check' is going to check the syntax of the upcoming set/suite and
plan files.

Change-Id: I4988a72929ed691bc6e77d786c6935a2ff37fa2e
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
A tests/igor/Makefile
M tests/igor/README
A tests/igor/check_yaml.py
3 files changed, 22 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/44/8044/1

diff --git a/tests/igor/Makefile b/tests/igor/Makefile
new file mode 100644
index 0000000..9aa9108
--- /dev/null
+++ b/tests/igor/Makefile
@@ -0,0 +1,9 @@
+PLANS=$(shell find . -name \*.plan)
+SUITES=$(shell find . -name \*.suite)
+SETS=$(shell find . -name \*.set)
+
+YAMLFILES=$(PLANS) $(SUITES) $(SETS)
+
+check:
+	python check_yaml.py $(YAMLFILES)
+	@echo -e "---\n Passed\n---"
diff --git a/tests/igor/README b/tests/igor/README
index b24abd3..da5e819 100644
--- a/tests/igor/README
+++ b/tests/igor/README
@@ -3,6 +3,8 @@
 Look into docs/ to learn how to write testsuites, testsets and testcases.
 Run make pdfs to create pdfs from the .rst files.
 
+Run 'make check' in this directory to do some basic validation of the test related files.
+
 The remaining folders are organized as follows:
 suites/		Contains testsuites (and testsuites reference testsets)
 sets/		Contains testsets (and testsets reference testcases and libraries)
diff --git a/tests/igor/check_yaml.py b/tests/igor/check_yaml.py
new file mode 100644
index 0000000..619caee
--- /dev/null
+++ b/tests/igor/check_yaml.py
@@ -0,0 +1,11 @@
+import sys
+import os
+import yaml
+
+files = sys.argv[1:]
+
+for f in files:
+  f = os.path.relpath(f)
+  data = open(f).read()
+  print("Checking syntax of '%s'" % f)
+  success = list(yaml.load_all(data)) != None


--
To view, visit http://gerrit.ovirt.org/8044
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4988a72929ed691bc6e77d786c6935a2ff37fa2e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list