aboutsummaryrefslogtreecommitdiff
path: root/testsuite/gerrit-tests.sh
diff options
context:
space:
mode:
authorRob Savoye <rob.savoye@linaro.org>2014-10-14 19:18:53 -0600
committerRob Savoye <rob.savoye@linaro.org>2014-10-14 19:18:53 -0600
commit8ab63b966204e237cbe0d39256e51598669a0cee (patch)
treea57c8ac0174cfafcb498a661c42b84ed74b65f70 /testsuite/gerrit-tests.sh
parentdef75f85735c0c80bb87af9bc2d4087cf45505d8 (diff)
tests for new Gerrit REST API
Change-Id: I41da631d856155347e156a2edf001871e099d4e4
Diffstat (limited to 'testsuite/gerrit-tests.sh')
-rwxr-xr-xtestsuite/gerrit-tests.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/testsuite/gerrit-tests.sh b/testsuite/gerrit-tests.sh
new file mode 100755
index 00000000..206db1ce
--- /dev/null
+++ b/testsuite/gerrit-tests.sh
@@ -0,0 +1,51 @@
+# tests for the gerrit REST API functions
+
+echo "============= gerrit() tests ================"
+
+review="/tmp/.gitreview"
+cat <<EOF > ${review}
+[gerrit]
+ host=review.linaro.org
+ port=29418
+ project=toolchain/cbuild2
+
+[gitreview]
+ username=buildslave
+EOF
+
+srcdir="/tmp"
+
+# FIXME: Note these following test cases only PASS if you have the source
+# directories created already.
+if test -d ${srcdir}; then
+ fail_state=fail
+else
+ fail_state=untested
+fi
+
+out="`extract_gerrit_host ${srcdir}`"
+if test x"${out}" = x"review.linaro.org"; then
+ pass extract_gerrit_host""
+else
+ ${fail_state} "extract_gerrit_host"
+ fixme "extract_gerrit_host returned ${out}"
+fi
+
+out="`extract_gerrit_project ${srcdir}`"
+if test x"${out}" = x"toolchain/cbuild2"; then
+ pass extract_gerrit_project""
+else
+ ${fail_state} "extract_gerrit_project"
+ fixme "extract_gerrit_project returned ${out}"
+fi
+
+out="`extract_gerrit_username ${srcdir}`"
+if test x"${out}" = x"buildslave"; then
+ pass extract_gerrit_project""
+else
+ ${fail_state} "extract_gerrit_project"
+ fixme "extract_gerrit_project returned ${out}"
+fi
+
+rm -f ${review}
+