2 ACTUALFEATURES="odl-integration-all"
4 echo "Kill any controller running"
5 ps axf | grep karaf | grep -v grep | awk '{print "kill -9 " $1}' | sh
10 echo "Downloading the distribution..."
11 wget --no-verbose ${ACTUALBUNDLEURL}
13 echo "Extracting the new controller..."
16 echo "Configuring the startup features..."
17 FEATURESCONF=${WORKSPACE}/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg
18 sed -ie "s/featuresBoot=.*/featuresBoot=config,standard,region,package,kar,ssh,management,${ACTUALFEATURES}/g" ${FEATURESCONF}
19 sed -ie "s%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features,mvn:org.opendaylight.integration/features-integration-test/${BUNDLEVERSION}/xml/features%g" ${FEATURESCONF}
22 echo "Configuring the log..."
23 LOGCONF=${WORKSPACE}/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg
24 sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=20MB/g' ${LOGCONF}
27 echo "Configure max memory..."
28 MEMCONF=${WORKSPACE}/${BUNDLEFOLDER}/bin/setenv
29 sed -ie "s/2048m/${CONTROLLERMEM}/g" ${MEMCONF}
32 echo "Listing all open ports on controller system"
35 echo "redirected karaf console output to karaf_console.log"
36 export KARAF_REDIRECT=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf_console.log
38 if [ ${JDKVERSION} == 'openjdk8' ]; then
39 echo "Setting the JRE Version to 8"
40 # dynamic_verify does not allow sudo, JAVA_HOME should be enough for karaf start.
41 # sudo /usr/sbin/alternatives --set java /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-2.b27.el7_1.x86_64/jre/bin/java
42 export JAVA_HOME=/usr/lib/jvm/java-1.8.0
43 elif [ ${JDKVERSION} == 'openjdk7' ]; then
44 echo "Setting the JRE Version to 7"
45 # dynamic_verify does not allow sudo, JAVA_HOME should be enough for karaf start.
46 # sudo /usr/sbin/alternatives --set java /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85-2.6.1.2.el7_1.x86_64/jre/bin/java
47 export JAVA_HOME=/usr/lib/jvm/java-1.7.0
49 readlink -e "${JAVA_HOME}/bin/java"
50 echo "Default JDK Version, JAVA_HOME should override"
53 echo "Starting controller..."
54 ${WORKSPACE}/${BUNDLEFOLDER}/bin/start
56 echo "Waiting for controller to come up..."
59 RESP="$( curl --user admin:admin -sL -w "%{http_code} %{url_effective}\\n" http://localhost:8181/restconf/modules -o /dev/null || true )"
61 if [[ ${RESP} == *"200"* ]]; then
64 elif (( ${COUNT} > 600 )); then
65 echo Timeout Controller DOWN
66 echo "Dumping Karaf log..."
67 cat ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
68 echo "Listing all open ports on controller system"
72 COUNT=$(( ${COUNT} + 5 ))
74 echo waiting ${COUNT} secs...
78 echo "loading many features at once. Need to allow time for problems to show up in logs. cool down for 5 min ..."
81 echo "Checking OSGi bundles..."
82 sshpass -p karaf ${WORKSPACE}/${BUNDLEFOLDER}/bin/client -u karaf 'bundle:list'
84 echo "Listing all open ports on controller system"
87 function exit_on_log_file_message {
88 echo "looking for \"$1\" in karaf.log file"
89 if grep --quiet "$1" ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log; then
90 echo ABORTING: found "$1"
91 echo "Dumping first 500K bytes of karaf log..."
92 head --bytes=500K ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
93 echo "Dumping last 500K bytes of karaf log..."
94 tail --bytes=500K ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
95 cp ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log .
96 cp ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf_console.log .
100 echo "looking for \"$1\" in karaf_console.log file"
101 if grep --quiet "$1" ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf_console.log; then
102 echo ABORTING: found "$1"
103 echo "Dumping first 500K bytes of karaf log..."
104 head --bytes=500K ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf_console.log
105 echo "Dumping last 500K bytes of karaf log..."
106 tail --bytes=500K ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf_console.log
107 cp ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log .
108 cp ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf_console.log .
113 exit_on_log_file_message 'BindException: Address already in use'
114 exit_on_log_file_message 'server is unhealthy'
116 echo "Fetching Karaf logs"
117 cp ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log .
118 cp ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf_console.log .
120 echo "Kill controller"
121 ps axf | grep karaf | grep -v grep | awk '{print "kill -9 " $1}' | sh
123 echo "Detecting misplaced config files"
124 pushd "${WORKSPACE}/${BUNDLEFOLDER}"
125 XMLS_FOUND=`echo *.xml`
127 if [ "$XMLS_FOUND" != "*.xml" ]; then
128 echo "Bug 4628 confirmed."
129 ## TODO: Uncomment the following when ODL is fixed, to guard against regression.
132 echo "Bug 4628 not detected."
135 # vim: ts=4 sw=4 sts=4 et ft=sh :