Merge "Addition of Suite Variable"
authorJamo Luhrsen <jluhrsen@redhat.com>
Fri, 12 Jan 2018 18:58:00 +0000 (18:58 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 12 Jan 2018 18:58:00 +0000 (18:58 +0000)
1  2 
jjb/integration/integration-deploy-controller-run-test.sh

index ed82e35d28be06622bfc6272d32b97ece8b6715d,3cfeb7e3962d153c1f4f0b2d8f369cc6dd45f2eb..7e5a6df827516ceb2fafb08c2d1f43d3cffe122c
@@@ -31,12 -31,6 +31,12 @@@ f
  # Some versions of jenkins job builder result in feature list containing spaces
  # and ending in newline. Remove all that.
  ACTUALFEATURES=`echo "${ACTUALFEATURES}" | tr -d '\n \r'`
 +echo "ACTUALFEATURES: ${ACTUALFEATURES}"
 +
 +# In the case that we want to install features via karaf shell, a space separated list of
 +# ACTUALFEATURES IS NEEDED
 +SPACE_SEPARATED_FEATURES=$(echo "${ACTUALFEATURES}" | tr ',' ' ')
 +echo "SPACE_SEPARATED_FEATURES: ${SPACE_SEPARATED_FEATURES}"
  
  if [ -f "${WORKSPACE}/test/csit/scriptplans/${TESTPLAN}" ]; then
      echo "scriptplan exists!!!"
@@@ -65,10 -59,8 +65,10 @@@ echo "Adding external repositories...
  sed -ie "s%org.ops4j.pax.url.mvn.repositories=%org.ops4j.pax.url.mvn.repositories=http://repo1.maven.org/maven2@id=central, http://repository.springsource.com/maven/bundles/release@id=spring.ebr.release, http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external, http://zodiac.springsource.com/maven/bundles/release@id=gemini, http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@noreleases, https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases%g" ${MAVENCONF}
  cat ${MAVENCONF}
  
 -echo "Configuring the startup features..."
 -sed -ie "s/\(featuresBoot=\|featuresBoot =\)/featuresBoot = ${ACTUALFEATURES},/g" ${FEATURESCONF}
 +if [[ "$USEFEATURESBOOT" == "True" ]]; then
 +    echo "Configuring the startup features..."
 +    sed -ie "s/\(featuresBoot=\|featuresBoot =\)/featuresBoot = ${ACTUALFEATURES},/g" ${FEATURESCONF}
 +fi
  
  FEATURE_INDEX_STRING="features-integration-index"
  FEATURE_TEST_STRING="features-integration-test"
@@@ -163,33 -155,6 +163,33 @@@ EO
  
  cat > ${WORKSPACE}/post-startup-script.sh <<EOF
  
 +if [[ "$USEFEATURESBOOT" != "True" ]]; then
 +
 +    # wait up to 60s for karaf port 8101 to be opened, polling every 5s
 +    loop_count=0;
 +    until [[ \$loop_count -ge 12 ]]; do
 +        netstat -na | grep 8101 && break;
 +        loop_count=\$[\$loop_count+1];
 +        sleep 5;
 +    done
 +
 +    echo "going to feature:install --no-auto-refresh ${SPACE_SEPARATED_FEATURES} one at a time"
 +    for feature in ${SPACE_SEPARATED_FEATURES}; do
 +        sshpass -p karaf ssh -o StrictHostKeyChecking=no \
 +                             -o UserKnownHostsFile=/dev/null \
 +                             -o LogLevel=error \
 +                             -p 8101 karaf@localhost \
 +                             feature:install --no-auto-refresh \$feature;
 +    done
 +
 +    echo "ssh to karaf console to list -i installed features"
 +    sshpass -p karaf ssh -o StrictHostKeyChecking=no \
 +                         -o UserKnownHostsFile=/dev/null \
 +                         -o LogLevel=error \
 +                         -p 8101 karaf@localhost \
 +                         feature:list -i
 +fi
 +
  echo "Waiting for controller to come up..."
  COUNT="0"
  while true; do
  echo "Changing the testplan path..."
  cat "${testplan_filepath}" | sed "s:integration:${WORKSPACE}:" > testplan.txt
  cat testplan.txt
- SUITES=$( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' ' )
+ # Use the testplan if specific SUITES are not defined.
+ if [ -z "${SUITES}" ]; then
+     SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '`
+ else
+     newsuites=""
+     workpath="${WORKSPACE}/test/csit/suites"
+     for suite in ${SUITES}; do
+         fullsuite="${workpath}/${suite}"
+         if [ -z "${newsuites}" ]; then
+             newsuites+=${fullsuite}
+         else
+             newsuites+=" "${fullsuite}
+         fi
+     done
+     SUITES=${newsuites}
+ fi
  
  echo "Starting Robot test suites ${SUITES} ..."
  pybot -N ${TESTPLAN} --removekeywords wuks -c critical -e exclude -e skip_if_${DISTROSTREAM} -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp \