Fix: Update lf-activate-venv
[releng/builder.git] / jjb / integration / common-functions.sh
index f16a93a0ea52f4deb90cbb5c73434de55386a045..6c967d0cb00c1d18940143b25126de8631bbcd8a 100644 (file)
@@ -279,7 +279,7 @@ function run_plan() {
         for line in $( grep -E -v '(^[[:space:]]*#|^[[:space:]]*$)' "${type}plan.txt" ); do
             printf "Executing %s...\\n" "${line}"
             # shellcheck source=${line} disable=SC1091
-            source "${line}"
+            . "${line}"
         done
     fi
     printf "Finished running %s plans\\n" "${type}"
@@ -856,7 +856,11 @@ function get_nodes_list() {
 
 function get_features() {
     if [ "${CONTROLLERSCOPE}" == 'all' ]; then
-        ACTUALFEATURES="odl-integration-compatible-with-all,${CONTROLLERFEATURES}"
+        if [ "$KARAF_PROJECT" == "integration" ]; then
+            ACTUALFEATURES="odl-integration-compatible-with-all,${CONTROLLERFEATURES}"
+        else
+            ACTUALFEATURES="odl-infrautils-ready,${CONTROLLERFEATURES}"
+        fi
         # if CONTROLLERMEM still is the default 2G and was not overridden by a
         # custom job, then we need to make sure to increase it because "all"
         # features can be heavy
@@ -910,15 +914,19 @@ if [[ "$USEFEATURESBOOT" == "True" ]]; then
     sed -ie "s/\\(featuresBoot=\\|featuresBoot =\\)/featuresBoot = ${ACTUALFEATURES},/g" ${FEATURESCONF}
 fi
 
-FEATURE_TEST_STRING="features-integration-test"
-KARAF_VERSION=${KARAF_VERSION:-karaf4}
-if [[ "$KARAF_VERSION" == "karaf4" ]]; then
-    FEATURE_TEST_STRING="features-test"
+FEATURE_TEST_STRING="features-test"
+FEATURE_TEST_VERSION="$BUNDLE_VERSION"
+if [[ "$KARAF_ARTIFACT" == "opendaylight" ]]; then
+    FEATURE_TEST_VERSION="$(sed -r "s%^([0-9]+)\.([0-9]+)\.0(.*)%0.\1.\2\3%" <<<"$BUNDLE_VERSION")"
 fi
+KARAF_VERSION=${KARAF_VERSION:-karaf4}
 
-sed -ie "s%\\(featuresRepositories=\\|featuresRepositories =\\)%featuresRepositories = mvn:org.opendaylight.integration/\${FEATURE_TEST_STRING}/${BUNDLE_VERSION}/xml/features,mvn:org.apache.karaf.decanter/apache-karaf-decanter/1.2.0/xml/features,%g" ${FEATURESCONF}
-if [[ ! -z "${REPO_URL}" ]]; then
-   sed -ie "s%featuresRepositories =%featuresRepositories = ${REPO_URL},%g" ${FEATURESCONF}
+# only manipulate feature repo in integration distro
+if [[ "$KARAF_PROJECT" == "integration" ]]; then
+       sed -ie "s%\\(featuresRepositories=\\|featuresRepositories =\\)%featuresRepositories = mvn:org.opendaylight.integration/\${FEATURE_TEST_STRING}/\${FEATURE_TEST_VERSION}/xml/features,mvn:org.apache.karaf.decanter/apache-karaf-decanter/1.2.0/xml/features,%g" ${FEATURESCONF}
+       if [[ ! -z "${REPO_URL}" ]]; then
+          sed -ie "s%featuresRepositories =%featuresRepositories = ${REPO_URL},%g" ${FEATURESCONF}
+       fi
 fi
 cat ${FEATURESCONF}
 
@@ -976,12 +984,14 @@ done
 
 # This workaround is required for Karaf decanter to work proper
 # The bundle:refresh command does not fail if the decanter bundles are not present
-echo "ssh to karaf console to do bundle refresh of decanter jmx collector"
-sshpass -p karaf ssh -o StrictHostKeyChecking=no \
-                     -o UserKnownHostsFile=/dev/null \
-                     -o LogLevel=error \
-                     -p 8101 karaf@localhost \
-                     "bundle:refresh org.apache.karaf.decanter.collector.jmx && bundle:refresh org.apache.karaf.decanter.api"
+# There seems to be impact in silicon stream so we better comment the lines below
+#
+#echo "ssh to karaf console to do bundle refresh of decanter jmx collector"
+#sshpass -p karaf ssh -o StrictHostKeyChecking=no \
+#                     -o UserKnownHostsFile=/dev/null \
+#                     -o LogLevel=error \
+#                     -p 8101 karaf@localhost \
+#                     "bundle:refresh org.apache.karaf.decanter.collector.jmx && bundle:refresh org.apache.karaf.decanter.api"
 
 if [[ "$USEFEATURESBOOT" != "True" ]]; then
 
@@ -1244,5 +1254,3 @@ function install_ovs_from_path() {
     ${SSH} "${ip}" "sudo yum -y install createrepo && createrepo --database /tmp/ovs_rpms"
     install_ovs_from_repo "${ip}" file:/tmp/ovs_rpms
 }
-
-