ssh -t $CORE_ROUTER "cd /opt ; git clone git://git/ri/autotest.git"
ssh -t $CORE_ROUTER "cd /opt/autotest ; git checkout master"
+#
+# Generate TestLink Build
+#
+./liveboot_testlink_create_build.sh \
+ "liveboot-${LIVEBOOT_BUILD_NUMBER}" \
+ "Auto-generated by Jenkins on $(date --rfc-3339=seconds)"
+
#
# run autotests
#
#ssh -t -A $CORE_ROUTER "cd /opt/autotest ; ./run-compile.sh --config config-jenkins.xml"
-ssh -t -A $CORE_ROUTER "cd /opt/autotest ; ./run-compile.sh"
+
+# call autotest suite w/ testlink connector info
+ssh -t -A $CORE_ROUTER "cd /opt/autotest ; \
+ ./run-compile.sh \
+ --testlink='Profitbricks','R&I Liveboot Approval Autotest','liveboot-${LIVEBOOT_BUILD_NUMBER}'"
+
+# no testlink support in vcb tests yet
ssh -t -A $CORE_ROUTER "cd /opt/autotest ; ./run-compile.sh --vcb=true --tracepjds"
#
--- /dev/null
+#!/bin/bash
+
+#
+# Create a TestLink build by means of xmlrpc.
+#
+# This helper script creates a new TestLink build in the "Profitbricks"
+# project, test plan "R&I Liveboot Approval Autotest".
+#
+# Example Usage:
+#
+# liveboot_testlink_create_build.sh \
+# "liveboot-923" \
+# "auto-generated build at $(date)."
+#
+
+testlink_url='http://testlink/lib/api/xmlrpc.php'
+ dev_key='6805a288081cf7480d391533b354cb7c'
+
+test_project="Profitbricks"
+ test_plan="R&I Liveboot Approval Autotest"
+
+
+# ---------------------
+
+
+xmlrpc() {
+ local method="tl.$1" ; shift
+ local params="
+ <member> <name>devKey</name> <value>$dev_key</value> </member>$@
+ "
+
+ curl -s \
+ --header 'content-type: text/xml' \
+ --header 'Cache-Control: no-cache' \
+ --header 'Pragma: no-cache' \
+ --data-binary \
+"
+<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<methodCall>
+ <methodName>$method</methodName>
+ <params>
+ <param>
+ <value>
+ <struct> $params </struct>
+ </value>
+ </param>
+ </params>
+</methodCall>" \
+ $testlink_url
+
+ echo ""
+}
+# ----
+
+get_testplan_by_name() {
+ local project="$1" ; shift
+ local plan="$@"
+ xmlrpc "getTestPlanByName" "
+ <member> <name>testprojectname</name> <value>$project</value> </member>
+ <member> <name>testplanname</name> <value>$plan</value> </member>" \
+ | grep '<member><name>id</name>' \
+ | sed 's:.*<value><string>\([0-9]*\)</string></value>.*:\1:'
+}
+# ----
+
+createBuild() {
+ local name="$1" ; shift
+ local notes="$@"
+
+ local id=`get_testplan_by_name "$test_project" "$test_plan"`
+
+ xmlrpc "createBuild" "
+ <member> <name>testplanid</name> <value>$id</value> </member> \
+ <member> <name>buildname</name> <value>$name</value> </member> \
+ <member> <name>buildnotes</name> <value>$notes</value> </member>"
+}
+# ----
+
+
+if [ "testlink_create_build.sh" = `basename $0` ]; then
+
+ [ $# -lt 2 ] && {
+ echo
+ echo "USAGE: $0 '<TestLink build name>' '<comment>'"
+ echo
+ exit
+ }
+
+ name="$1" ; shift
+ createBuild "$name" $@
+ exit
+fi