Builder job for deploying Openstack for testing 80/37280/19
authorgvrangan <venkatrangang@hcl.com>
Thu, 7 Apr 2016 01:12:44 +0000 (01:12 +0000)
committerJamo Luhrsen <jluhrsen@redhat.com>
Thu, 21 Apr 2016 05:59:07 +0000 (22:59 -0700)
Change-Id: I48a8fc573042d8e55898b6817ec6880eccdb4597
Signed-off-by: gvrangan <venkatrangang@hcl.com>
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
jjb/integration/include-raw-integration-configure-clustering.sh
jjb/integration/include-raw-integration-deploy-controller-run-test.sh
jjb/integration/include-raw-integration-deploy-openstack-run-test.sh [new file with mode: 0644]
jjb/integration/include-raw-integration-get-slave-addresses.sh
jjb/integration/include-raw-integration-start-cluster-run-test.sh
jjb/integration/integration-macros.yaml
jjb/integration/integration-templates.yaml
jjb/netvirt/netvirt-csit-1node-multi-openstack.yaml [new file with mode: 0644]
jjb/netvirt/netvirt-csit-3node-multi-openstack.yaml [new file with mode: 0644]

index 0950622f247c4f18cbc0c65d209cf996c2fd418b..264f659b3e384a6cc5f828cf28a2ff210df42555 100644 (file)
@@ -65,6 +65,7 @@ unzip -q ${BUNDLE}
 
 echo "Configuring the startup features..."
 FEATURESCONF=/tmp/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg
+CUSTOMPROP=/tmp/${BUNDLEFOLDER}/etc/custom.properties
 sed -ie "s/featuresBoot=.*/featuresBoot=config,standard,region,package,kar,ssh,management,${ACTUALFEATURES}/g" \${FEATURESCONF}
 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}
 cat \${FEATURESCONF}
@@ -76,6 +77,12 @@ sed -ie 's/log4j.appender.out.maxBackupIndex=10/log4j.appender.out.maxBackupInde
 sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=100GB/g' \${LOGCONF}
 cat \${LOGCONF}
 
+if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
+  echo "Enable the l3.fwd in custom.properties.."
+  echo "ovsdb.l3.fwd.enabled=yes" >> \${CUSTOMPROP}
+  cat \${CUSTOMPROP}
+fi
+
 echo "Configure java home and max memory..."
 MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv
 sed -ie 's%^# export JAVA_HOME%export JAVA_HOME="\${JAVA_HOME:-${JAVA_HOME}}"%g' \${MEMCONF}
index 8d25ebb5547d6b290c90cef291680fbb87905a50..78bdec2fed423388c2bc16e9e6f3f43e51b043a7 100644 (file)
@@ -42,10 +42,16 @@ unzip -q ${BUNDLE}
 
 echo "Configuring the startup features..."
 FEATURESCONF=/tmp/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg
+CUSTOMPROP=/tmp/${BUNDLEFOLDER}/etc/custom.properties
 sed -ie "s/featuresBoot=.*/featuresBoot=config,standard,region,package,kar,ssh,management,${ACTUALFEATURES}/g" \${FEATURESCONF}
 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}
 cat \${FEATURESCONF}
 
+if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
+  echo "ovsdb.l3.fwd.enabled=yes" >> \${CUSTOMPROP}
+fi
+cat \${CUSTOMPROP}
+
 echo "Configuring the log..."
 LOGCONF=/tmp/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg
 sed -ie 's/log4j.appender.out.maxBackupIndex=10/log4j.appender.out.maxBackupIndex=1/g' \${LOGCONF}
@@ -127,6 +133,11 @@ EOF
 scp ${WORKSPACE}/controller-script.sh ${ODL_SYSTEM_IP}:/tmp
 ssh ${ODL_SYSTEM_IP} 'bash /tmp/controller-script.sh'
 
+if [ ${NUM_OPENSTACK_SYSTEM} -gt 0 ]; then
+   echo "Exiting without running tests to deploy openstack for testing"
+   exit
+fi
+
 echo "Locating test plan to use..."
 testplan_filepath="${WORKSPACE}/test/csit/testplans/${STREAMTESTPLAN}"
 if [ ! -f "${testplan_filepath}" ]; then
@@ -136,7 +147,6 @@ fi
 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' ' ' )
 
 echo "Starting Robot test suites ${SUITES} ..."
diff --git a/jjb/integration/include-raw-integration-deploy-openstack-run-test.sh b/jjb/integration/include-raw-integration-deploy-openstack-run-test.sh
new file mode 100644 (file)
index 0000000..66e5ea1
--- /dev/null
@@ -0,0 +1,394 @@
+#@IgnoreInspection BashAddShebang
+# Activate robotframework virtualenv
+# ${ROBOT_VENV} comes from the include-raw-integration-install-robotframework.sh
+# script.
+source ${ROBOT_VENV}/bin/activate
+
+echo "#################################################"
+echo "##         Deploy Openstack 3-node             ##"
+echo "#################################################"
+
+function create_control_node_local_conf {
+local_conf_file_name=${WORKSPACE}/local.conf_control
+cat > ${local_conf_file_name} << EOF
+[[local|localrc]]
+LOGFILE=stack.sh.log
+SCREEN_LOGDIR=/opt/stack/data/log
+LOG_COLOR=False
+RECLONE=yes
+
+disable_service swift
+disable_service cinder
+disable_service n-net
+disable_service q-vpn
+enable_service q-svc
+enable_service q-dhcp
+enable_service q-meta
+enable_service tempest
+enable_service n-novnc
+enable_service n-cauth
+
+HOST_IP=$OPENSTACK_CONTROL_NODE_IP
+SERVICE_HOST=\$HOST_IP
+
+NEUTRON_CREATE_INITIAL_NETWORKS=False
+Q_PLUGIN=ml2
+Q_ML2_TENANT_NETWORK_TYPE=vxlan
+
+ENABLE_TENANT_TUNNELS=True
+
+
+MYSQL_HOST=\$SERVICE_HOST
+RABBIT_HOST=\$SERVICE_HOST
+GLANCE_HOSTPORT=\$SERVICE_HOST:9292
+KEYSTONE_AUTH_HOST=\$SERVICE_HOST
+KEYSTONE_SERVICE_HOST=\$SERVICE_HOST
+
+MYSQL_PASSWORD=mysql
+RABBIT_PASSWORD=rabbit
+SERVICE_TOKEN=service
+SERVICE_PASSWORD=admin
+ADMIN_PASSWORD=admin
+
+enable_plugin networking-odl ${ODL_ML2_DRIVER_REPO} ${ODL_ML2_BRANCH}
+
+ODL_PORT=8080
+ODL_MODE=externalodl
+
+EOF
+
+if [ "${NUM_ODL_SYSTEM}" -gt 1 ]; then
+odl_list=${ODL_SYSTEM_1_IP}
+for i in `seq 2 ${NUM_ODL_SYSTEM}`
+do
+odlip=ODL_SYSTEM_${i}_IP
+odl_list=${odl_list},${!odlip}
+done
+if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then
+HA_PROXY_INDEX=${NUM_OPENSTACK_SYSTEM}
+odlmgrip=OPENSTACK_COMPUTE_NODE_${HA_PROXY_INDEX}_IP
+odl_mgr_ip=${!odlmgrip}
+else
+odl_mgr_ip=${ODL_SYSTEM_1_IP}
+fi
+cat >> ${local_conf_file_name} << EOF
+ODL_OVS_MANAGERS=${odl_list}
+ODL_MGR_IP=${odl_mgr_ip}
+EOF
+else
+cat >> ${local_conf_file_name} << EOF
+ODL_MGR_IP=${ODL_SYSTEM_1_IP}
+EOF
+fi
+
+if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
+cat >> ${local_conf_file_name} << EOF
+
+ODL_PROVIDER_MAPPINGS=br-ex:br100
+
+disable_service q-l3
+Q_L3_ENABLED=True
+ODL_L3=True
+PUBLIC_INTERFACE=br100
+[[post-config|\$NEUTRON_CONF]]
+[DEFAULT]
+service_plugins = networking_odl.l3.l3_odl.OpenDaylightL3RouterPlugin
+
+EOF
+fi
+cat >> ${local_conf_file_name} << EOF
+[[post-config|/etc/neutron/plugins/ml2/ml2_conf.ini]]
+[agent]
+minimize_polling=True
+EOF
+
+echo "local.conf Created...."
+cat ${local_conf_file_name}
+}
+
+function create_compute_node_local_conf {
+HOSTIP=$1
+local_conf_file_name=${WORKSPACE}/local.conf_compute_${HOSTIP}
+cat > ${local_conf_file_name} << EOF
+[[local|localrc]]
+LOGFILE=stack.sh.log
+LOG_COLOR=False
+SCREEN_LOGDIR=/opt/stack/data/log
+RECLONE=yes
+
+NOVA_VNC_ENABLED=True
+MULTI_HOST=1
+ENABLED_SERVICES=n-cpu
+
+HOST_IP=${HOSTIP}
+SERVICE_HOST=${OPENSTACK_CONTROL_NODE_IP}
+
+Q_PLUGIN=ml2
+ENABLE_TENANT_TUNNELS=True
+Q_ML2_TENANT_NETWORK_TYPE=vxlan
+
+Q_HOST=\$SERVICE_HOST
+MYSQL_HOST=\$SERVICE_HOST
+RABBIT_HOST=\$SERVICE_HOST
+GLANCE_HOSTPORT=\$SERVICE_HOST:9292
+KEYSTONE_AUTH_HOST=\$SERVICE_HOST
+KEYSTONE_SERVICE_HOST=\$SERVICE_HOST
+
+MYSQL_PASSWORD=mysql
+RABBIT_PASSWORD=rabbit
+SERVICE_TOKEN=service
+SERVICE_PASSWORD=admin
+ADMIN_PASSWORD=admin
+
+enable_plugin networking-odl ${ODL_ML2_DRIVER_REPO} ${ODL_ML2_BRANCH}
+ODL_MODE=compute
+
+EOF
+
+if [ "${NUM_ODL_SYSTEM}" -gt 1 ]; then
+odl_list=${ODL_SYSTEM_1_IP}
+for i in `seq 2 ${NUM_ODL_SYSTEM}`
+do
+odlip=ODL_SYSTEM_${i}_IP
+odl_list=${odl_list},${!odlip}
+done
+if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then
+HA_PROXY_INDEX=${NUM_OPENSTACK_SYSTEM}
+odlmgrip=OPENSTACK_COMPUTE_NODE_${HA_PROXY_INDEX}_IP
+odl_mgr_ip=${!odlmgrip}
+else
+odl_mgr_ip=${ODL_SYSTEM_1_IP}
+fi
+cat >> ${local_conf_file_name} << EOF
+ODL_OVS_MANAGERS=${odl_list}
+ODL_MGR_IP=${odl_mgr_ip}
+EOF
+else
+cat >> ${local_conf_file_name} << EOF
+ODL_MGR_IP=${ODL_SYSTEM_1_IP}
+EOF
+fi
+
+if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
+cat >> ${local_conf_file_name} << EOF
+# Uncomment lines below if odl-compute is to be used for l3 forwarding
+Q_L3_ENABLED=True
+ODL_L3=True
+PUBLIC_INTERFACE=br100
+EOF
+fi
+echo "local.conf Created...."
+cat ${local_conf_file_name}
+}
+
+function configure_haproxy_for_neutron_requests () {
+HA_PROXY_INDEX=${NUM_OPENSTACK_SYSTEM}
+odlmgrip=OPENSTACK_COMPUTE_NODE_${HA_PROXY_INDEX}_IP
+ha_proxy_ip=${!odlmgrip}
+
+cat > ${WORKSPACE}/install_ha_proxy.sh<< EOF
+sudo systemctl stop firewalld
+sudo yum -y install policycoreutils-python haproxy
+EOF
+
+cat > ${WORKSPACE}/haproxy.cfg << EOF
+global
+  daemon
+  group  haproxy
+  log  /dev/log local0
+  maxconn  20480
+  pidfile  /tmp/haproxy.pid
+  user  haproxy
+
+defaults
+  log  global
+  maxconn  4096
+  mode  tcp
+  retries  3
+  timeout  http-request 10s
+  timeout  queue 1m
+  timeout  connect 10s
+  timeout  client 1m
+  timeout  server 1m
+  timeout  check 10s
+
+listen opendaylight
+  bind ${ha_proxy_ip}:8080
+  balance source
+EOF
+
+for i in `seq 1 ${NUM_ODL_SYSTEM}`
+do
+odlip=ODL_SYSTEM_${i}_IP
+cat >> ${WORKSPACE}/haproxy.cfg << EOF
+  server controller-$i ${!odlip}:8080 check fall 5 inter 2000 rise 2
+EOF
+done
+
+cat > ${WORKSPACE}/deploy_ha_proxy.sh<< EOF
+sudo chown haproxy:haproxy /tmp/haproxy.cfg
+sudo sed -i 's/\\/etc\\/haproxy\\/haproxy.cfg/\\/tmp\\/haproxy.cfg/g' /usr/lib/systemd/system/haproxy.service
+sudo /usr/sbin/semanage permissive -a haproxy_t
+sudo systemctl restart haproxy
+sleep 3
+sudo netstat -tunpl
+sudo systemctl status haproxy
+true
+EOF
+scp ${WORKSPACE}/install_ha_proxy.sh ${ha_proxy_ip}:/tmp
+ssh ${ha_proxy_ip} "sudo bash /tmp/install_ha_proxy.sh"
+scp ${WORKSPACE}/haproxy.cfg ${ha_proxy_ip}:/tmp
+scp ${WORKSPACE}/deploy_ha_proxy.sh ${ha_proxy_ip}:/tmp
+ssh ${ha_proxy_ip} "sudo bash /tmp/deploy_ha_proxy.sh"
+}
+
+function collect_logs_and_exit (){
+set +e  # We do not want to create red dot just because something went wrong while fetching logs.
+for i in `seq 1 ${NUM_ODL_SYSTEM}`
+do
+    CONTROLLERIP=ODL_SYSTEM_${i}_IP
+    echo "dumping first 500K bytes of karaf log..." > "odl${i}_karaf.log"
+    ssh "${!CONTROLLERIP}" head --bytes=500K "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" >> "odl${i}_karaf.log"
+    echo "dumping last 500K bytes of karaf log..." >> "odl${i}_karaf.log"
+    ssh "${!CONTROLLERIP}" tail --bytes=500K "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" >> "odl${i}_karaf.log"
+    echo "killing karaf process..."
+    ssh "${!CONTROLLERIP}" bash -c 'ps axf | grep karaf | grep -v grep | awk '"'"'{print "kill -9 " $1}'"'"' | sh'
+done
+sleep 5
+for i in `seq 1 ${NUM_ODL_SYSTEM}`
+do
+    CONTROLLERIP=ODL_SYSTEM_${i}_IP
+    ssh "${!CONTROLLERIP}" xz -9ekvv "/tmp/${BUNDLEFOLDER}/data/log/karaf.log"
+    scp "${!CONTROLLERIP}:/tmp/${BUNDLEFOLDER}/data/log/karaf.log.xz" "odl${i}_karaf.log.xz"
+done
+
+ssh ${OPENSTACK_CONTROL_NODE_IP} "xz -9ekvv /opt/stack/devstack/nohup.out"
+scp ${OPENSTACK_CONTROL_NODE_IP}:/opt/stack/devstack/nohup.out.xz "openstack_control_stack.log.xz"
+for i in `seq 1 $((NUM_OPENSTACK_SYSTEM - 1))`
+do
+    OSIP=OPENSTACK_COMPUTE_NODE_${i}_IP
+    scp "${!OSIP}:/opt/stack/devstack/nohup.out" "openstack_compute_stack_${i}.log"
+done
+}
+
+cat > ${WORKSPACE}/get_devstack.sh << EOF
+sudo systemctl stop firewalld
+sudo yum install bridge-utils -y
+#Workaround for mysql failure
+echo "127.0.0.1    localhost \${HOSTNAME}" > /tmp/hosts
+echo "::1   localhost  \${HOSTNAME}" >> /tmp/hosts
+sudo mv /tmp/hosts /etc/hosts
+sudo /usr/sbin/brctl addbr br100
+sudo mkdir /opt/stack
+sudo chmod 777 /opt/stack
+cd /opt/stack
+git clone https://git.openstack.org/openstack-dev/devstack
+cd devstack
+git checkout $OPENSTACK_BRANCH
+EOF
+
+echo "Create HAProxy if needed"
+if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then
+ echo "Need to configure HAProxy"
+ configure_haproxy_for_neutron_requests
+fi
+
+os_node_list=()
+echo "Stack the Control Node"
+scp ${WORKSPACE}/get_devstack.sh ${OPENSTACK_CONTROL_NODE_IP}:/tmp
+ssh ${OPENSTACK_CONTROL_NODE_IP} "bash /tmp/get_devstack.sh"
+create_control_node_local_conf
+scp ${WORKSPACE}/local.conf_control ${OPENSTACK_CONTROL_NODE_IP}:/opt/stack/devstack/local.conf
+ssh ${OPENSTACK_CONTROL_NODE_IP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
+ssh ${OPENSTACK_CONTROL_NODE_IP} "ps -ef | grep stack.sh"
+ssh ${OPENSTACK_CONTROL_NODE_IP} "ls -lrt /opt/stack/devstack/nohup.out"
+os_node_list+=(${OPENSTACK_CONTROL_NODE_IP})
+
+
+for i in `seq 1 $((NUM_OPENSTACK_SYSTEM - 1))`
+do
+    COMPUTEIP=OPENSTACK_COMPUTE_NODE_${i}_IP
+    scp ${WORKSPACE}/get_devstack.sh  ${!COMPUTEIP}:/tmp
+    ssh ${!COMPUTEIP} "bash /tmp/get_devstack.sh"
+    create_compute_node_local_conf ${!COMPUTEIP}
+    scp ${WORKSPACE}/local.conf_compute_${!COMPUTEIP} ${!COMPUTEIP}:/opt/stack/devstack/local.conf
+    ssh ${!COMPUTEIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
+    ssh ${!COMPUTEIP} "ps -ef | grep stack.sh"
+    os_node_list+=(${!COMPUTEIP})
+done
+
+cat > ${WORKSPACE}/check_stacking.sh << EOF
+> /tmp/stack_progress
+ps -ef | grep "stack.sh" | grep -v grep
+ret=\$?
+if [ \${ret} -eq 1 ]; then
+  grep "This is your host IP address:" /opt/stack/devstack/nohup.out
+  if [ \$? -eq 0 ]; then
+     echo "Stacking Complete" > /tmp/stack_progress
+  else
+     echo "Stacking Failed" > /tmp/stack_progress
+  fi
+elif [ \${ret} -eq 0 ]; then
+  echo "Still Stacking" > /tmp/stack_progress
+fi
+EOF
+
+#the checking is repeated for an hour
+iteration=0
+in_progress=1
+while [ ${in_progress} -eq 1 ]; do
+iterator=$(($iterator + 1))
+for index in ${!os_node_list[@]}
+do
+echo "Check the status of stacking in ${os_node_list[index]}"
+scp ${WORKSPACE}/check_stacking.sh  ${os_node_list[index]}:/tmp
+ssh ${os_node_list[index]} "bash /tmp/check_stacking.sh"
+scp ${os_node_list[index]}:/tmp/stack_progress .
+#debug
+cat stack_progress
+stacking_status=`cat stack_progress`
+if [ "$stacking_status" == "Still Stacking" ]; then
+  continue
+elif [ "$stacking_status" == "Stacking Failed" ]; then
+  collect_logs_and_exit
+  exit 1
+elif [ "$stacking_status" == "Stacking Complete" ]; then
+  unset os_node_list[index]
+  if  [ ${#os_node_list[@]} -eq 0 ]; then
+     in_progress=0
+  fi
+fi
+done
+ echo "sleep for a minute before the next check"
+ sleep 60
+ if [ ${iteration} -eq 60 ]; then
+  collect_logs_and_exit
+  exit 1
+ fi
+done
+
+echo "Locating test plan to use..."
+testplan_filepath="${WORKSPACE}/test/csit/testplans/${STREAMTESTPLAN}"
+if [ ! -f "${testplan_filepath}" ]; then
+    testplan_filepath="${WORKSPACE}/test/csit/testplans/${TESTPLAN}"
+fi
+
+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' ' '`
+
+echo "Starting Robot test suites ${SUITES} ..."
+pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp -v BUNDLE_URL:${ACTUALBUNDLEURL} \
+-v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} -v JDKVERSION:${JDKVERSION} -v ODL_STREAM:${DISTROSTREAM} \
+-v CONTROLLER:${ODL_SYSTEM_IP} -v CONTROLLER1:${ODL_SYSTEM_2_IP} -v CONTROLLER2:${ODL_SYSTEM_3_IP} -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} \
+-v NUM_ODL_SYSTEM:${NUM_ODL_SYSTEM} -v CONTROLLER_USER:${USER} -v OS_USER:${USER}  \
+-v NUM_OS_SYSTEM:${NUM_OPENSTACK_SYSTEM} -v OS_CONTROL_NODE_IP:${OPENSTACK_CONTROL_NODE_IP} \
+-v DEVSTACK_DEPLOY_PATH:/opt/stack/devstack -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} || true
+
+echo "Tests Executed"
+collect_logs_and_exit
+
+true  # perhaps Jenkins is testing last exit code
+# vim: ts=4 sw=4 sts=4 et ft=sh :
index e498baab120d4d4fe564d0d643936c4cd4cc3908..32be449b88ec751d692564ad54d61061504e2e69 100644 (file)
@@ -2,21 +2,36 @@
 
 ODL_SYSTEM=()
 TOOLS_SYSTEM=()
+OPENSTACK_SYSTEM=()
+
+echo "JCLOUDS IPS are ${JCLOUDS_IPS}"
 
 IFS=',' read -ra ADDR <<< "${JCLOUDS_IPS}"
 
 for i in "${ADDR[@]}"
 do
     REMHOST=`ssh ${i} hostname`
-    if [ `echo ${REMHOST} | grep 'java\|devstack'` ]; then
-        ODL_SYSTEM=( "${ODL_SYSTEM[@]}" "${i}" )
-    else
-        TOOLS_SYSTEM=( "${TOOLS_SYSTEM[@]}" "${i}" )
-    fi
+    case ${REMHOST} in
+    *java*)
+       ODL_SYSTEM=( "${ODL_SYSTEM[@]}" "${i}" )
+       ;;
+    *devstack*)
+       OPENSTACK_SYSTEM=( "${OPENSTACK_SYSTEM[@]}" "${i}" )
+       ;;
+    *)
+       TOOLS_SYSTEM=( "${TOOLS_SYSTEM[@]}" "${i}" )
+       ;;
+    esac
 done
 
 echo "NUM_ODL_SYSTEM=${#ODL_SYSTEM[@]}" >> slave_addresses.txt
 echo "NUM_TOOLS_SYSTEM=${#TOOLS_SYSTEM[@]}" >> slave_addresses.txt
+#if HA Proxy is requested the last devstack node will be configured as haproxy
+if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then
+   echo "NUM_OPENSTACK_SYSTEM=$(( ${#OPENSTACK_SYSTEM[@]} - 1 ))" >> slave_addresses.txt
+else
+   echo "NUM_OPENSTACK_SYSTEM=${#OPENSTACK_SYSTEM[@]}" >> slave_addresses.txt
+fi
 
 # Add alias for ODL_SYSTEM_1_IP as ODL_SYSTEM_IP
 echo "ODL_SYSTEM_IP=${ODL_SYSTEM[0]}" >> slave_addresses.txt
@@ -32,4 +47,10 @@ do
     echo "TOOLS_SYSTEM_$((i+1))_IP=${TOOLS_SYSTEM[${i}]}" >> slave_addresses.txt
 done
 
+echo "OPENSTACK_CONTROL_NODE_IP=${OPENSTACK_SYSTEM[0]}" >> slave_addresses.txt
+for i in `seq 1 $(( ${#OPENSTACK_SYSTEM[@]} - 1 ))`
+do
+    echo "OPENSTACK_COMPUTE_NODE_$((i))_IP=${OPENSTACK_SYSTEM[${i}]}" >> slave_addresses.txt
+done
 # vim: sw=4 ts=4 sts=4 et ft=sh :
+
index 61f5dac337d33128ce4422c2f32e26e674a6bbfb..4bc956436ad5a7e2efd0ccb2377039901f989366 100644 (file)
@@ -67,6 +67,11 @@ do
     ssh ${!CONTROLLERIP} "bash /tmp/verify-cluster-is-up.sh ${i} ${!CONTROLLERIP}"
 done
 
+if [ ${NUM_OPENSTACK_SYSTEM} -gt 0 ]; then
+   echo "Exiting without running tests to deploy openstack for testing"
+   exit
+fi
+
 if [ ${CONTROLLERSCOPE} == 'all' ]; then
     COOLDOWN_PERIOD="180"
 else
index 48eb744317dcd7b7617ba3fab3a211732892bd48..d2b3a2764808bb3be13fd2e3fc0adad7982aa87e 100644 (file)
                 count: '{mininet-vms}'
                 stop-on-terminate: False
 
+# Macro: integration-jclouds-controller-devstack
+# Operation: this macro will spin the controller and devstack vms
+# Used by: {project}-csit-openstack job templates
+- wrapper:
+    name: integration-jclouds-controller-devstack
+    wrappers:
+      - jclouds:
+          instances:
+            - rk-c7-java:
+                cloud-name: 'Rackspace DFW - Integration Dynamic Lab'
+                count: '{controller-vms}'
+                stop-on-terminate: False
+            - rk-c7-devstack:
+                cloud-name: 'Rackspace DFW - Devstack'
+                count: '{openstack-vms}'
+                stop-on-terminate: False
+
 #################
 # Shell Scripts #
 #################
             !include-raw:
                 - include-raw-integration-rebase-gerrit-patch.sh
 
+- builder:
+    name: integration-deploy-openstack-run-test
+    builders:
+        - shell:
+            !include-raw:
+                - include-raw-integration-deploy-openstack-run-test.sh
 ##############
 # Publishers #
 ##############
index e1dde447d86b3a60eaeb3146784e176edf5298d1..963cffe96b03084e4ed167562e86b9d986e1188b 100644 (file)
             unstable-if: 0.0
             pass-if: 100.0
         - archive:
-            artifacts: 'devstacklog.txt,*karaf*'
+            artifacts: '*log*'
+        - email-notification:
+            email-prefix: '[project]'
+
+- job-template:
+    name: '{project}-csit-1node-openstack-{openstack}-{functionality}-{stream}'
+    disabled: false
+
+    project-type: freestyle
+    node: dynamic_robot
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-num-to-keep}'
+
+    parameters:
+        - project-parameter:
+            project: 'integration/test'
+        - integration-branch:
+            branch: '{branch}'
+        - integration-distribution-stream:
+            stream: '{stream}'
+        - integration-bundleurl:
+            bundleurl: 'last'
+        - integration-controller-features:
+            controller-features: '{install-features}'
+        - integration-test-plan:
+            test-plan: '{project}-1node-openstack.txt'
+        - integration-patch-refspec:
+            branch: 'master'
+        - integration-jdk-version:
+            jdkversion: '{jre}'
+        - string:
+            name: OPENSTACK_BRANCH
+            default: '{openstack-branch}'
+            description: 'Openstack version to use with devstack'
+        - string:
+            name: ODL_ML2_DRIVER_REPO
+            default: 'https://github.com/openstack/networking-odl'
+            description: 'URL to fetch networking-odl driver'
+        - string:
+            name: ODL_ML2_VERSION
+            default: '{odl-ml2-version}'
+            description: 'Version of networking-odl to checkout from the repo'
+        - string:
+            name: ODL_ENABLE_L3_FWD
+            default: '{odl-enable-l3}'
+            description: 'Enable L3 FWD in ODL for createing br-ex'
+    scm:
+        - integration-gerrit-scm:
+            credentials-id: '{ssh-credentials}'
+            basedir: 'test'
+            refspec: '$PATCHREFSPEC'
+            branch: 'master'
+
+    wrappers:
+        - build-timeout
+        - integration-jclouds-controller-devstack:
+            controller-vms: 1
+            openstack-vms: '{openstack-vms}'
+        - ssh-agent-credentials:
+            users:
+              - '{ssh-credentials}'
+
+    triggers:
+        - integration-csit-all
+
+    builders:
+        - integration-cleanup-workspace
+        - integration-install-robotframework
+        - inject:
+            properties-file: 'env.properties'
+        - integration-get-slave-addresses
+        - inject:
+            properties-file: 'slave_addresses.txt'
+        - integration-get-bundle-vars
+        - inject:
+            properties-file: 'bundle_vars.txt'
+        - integration-deploy-controller-run-test
+        - integration-deploy-openstack-run-test
+        - integration-cleanup-tmp
+
+    publishers:
+        - integration-robot:
+            unstable-if: 0.0
+            pass-if: 100.0
+        - archive:
+            artifacts: '*log*'
+        - email-notification:
+            email-prefix: '[project]'
+
+- job-template:
+    name: '{project}-csit-3node-openstack-{openstack}-{functionality}-{stream}'
+    disabled: false
+
+    project-type: freestyle
+    node: dynamic_robot
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-num-to-keep}'
+
+    parameters:
+        - project-parameter:
+            project: 'integration/test'
+        - integration-branch:
+            branch: '{branch}'
+        - integration-distribution-stream:
+            stream: '{stream}'
+        - integration-bundleurl:
+            bundleurl: 'last'
+        - integration-controller-features:
+            controller-features: 'odl-jolokia,{install-features}'
+        - integration-test-plan:
+            test-plan: '{project}-3node-openstack.txt'
+        - integration-patch-refspec:
+            branch: 'master'
+        - integration-jdk-version:
+            jdkversion: '{jre}'
+        - string:
+            name: OPENSTACK_BRANCH
+            default: '{openstack-branch}'
+            description: 'Openstack version to use with devstack'
+        - string:
+            name: ODL_ML2_DRIVER_REPO
+            default: 'https://github.com/openstack/networking-odl'
+            description: 'URL to fetch networking-odl driver'
+        - string:
+            name: ODL_ML2_VERSION
+            default: '{odl-ml2-version}'
+            description: 'Version of networking-odl to checkout from the repo'
+        - string:
+            name: ODL_ENABLE_L3_FWD
+            default: '{odl-enable-l3}'
+            description: 'Enable L3 FWD in ODL for createing br-ex'
+        - string:
+            name: ENABLE_HAPROXY_FOR_NEUTRON
+            default: '{enable-haproxy}'
+            description: 'Enable HAProxy for using neutron interface as HA'
+    scm:
+        - integration-gerrit-scm:
+            credentials-id: '{ssh-credentials}'
+            basedir: 'test'
+            refspec: '$PATCHREFSPEC'
+            branch: 'master'
+
+    wrappers:
+        - build-timeout
+        - integration-jclouds-controller-devstack:
+            controller-vms: 3
+            openstack-vms: '{openstack-vms}'
+        - ssh-agent-credentials:
+            users:
+              - '{ssh-credentials}'
+
+    triggers:
+        - integration-csit-all
+
+    builders:
+        - integration-cleanup-workspace
+        - integration-install-robotframework
+        - inject:
+            properties-file: 'env.properties'
+        - integration-get-slave-addresses
+        - inject:
+            properties-file: 'slave_addresses.txt'
+        - integration-get-bundle-vars
+        - inject:
+            properties-file: 'bundle_vars.txt'
+        - integration-configure-clustering
+        - integration-start-cluster-run-test
+        - integration-deploy-openstack-run-test
+        - integration-cleanup-tmp
+
+    publishers:
+        - integration-robot:
+            unstable-if: 0.0
+            pass-if: 100.0
+        - archive:
+            artifacts: '*log*'
         - email-notification:
             email-prefix: '[project]'
diff --git a/jjb/netvirt/netvirt-csit-1node-multi-openstack.yaml b/jjb/netvirt/netvirt-csit-1node-multi-openstack.yaml
new file mode 100644 (file)
index 0000000..950a441
--- /dev/null
@@ -0,0 +1,37 @@
+- project:
+    name: netvirt-csit-openstack-integration
+    jobs:
+        - '{project}-csit-1node-openstack-{openstack}-{functionality}-{stream}'
+
+    # The project name
+    project: 'netvirt'
+
+    # The project name
+    functionality: 'openstack'
+
+    stream:
+        - boron:
+            branch: 'master'
+            jre: 'openjdk8'
+        - beryllium:
+            branch: 'stable/beryllium'
+            jre: 'openjdk7'
+        - stable-lithium:
+            branch: 'stable/lithium'
+            jre: 'openjdk7'
+
+    openstack:
+        - mitaka:
+            openstack-branch: 'stable/mitaka'
+            odl-ml2-version:  'master'
+        - liberty:
+            openstack-branch: 'stable/liberty'
+            odl-ml2-version:  'stable/liberty'
+
+    openstack-vms: 3
+
+    install-features: 'odl-ovsdb-openstack'
+
+    schedule: 'H H * * *'
+
+    odl-enable-l3: 'yes'
diff --git a/jjb/netvirt/netvirt-csit-3node-multi-openstack.yaml b/jjb/netvirt/netvirt-csit-3node-multi-openstack.yaml
new file mode 100644 (file)
index 0000000..994d4c1
--- /dev/null
@@ -0,0 +1,39 @@
+- project:
+    name: netvirt-3node-csit-openstack-integration
+    jobs:
+        - '{project}-csit-3node-openstack-{openstack}-{functionality}-{stream}'
+
+    # The project name
+    project: 'netvirt'
+
+    # The project name
+    functionality: 'openstack'
+
+    stream:
+        - boron:
+            branch: 'master'
+            jre: 'openjdk8'
+        - beryllium:
+            branch: 'stable/beryllium'
+            jre: 'openjdk7'
+        - stable-lithium:
+            branch: 'stable/lithium'
+            jre: 'openjdk7'
+
+    openstack:
+        - mitaka:
+            openstack-branch: 'stable/mitaka'
+            odl-ml2-version:  'master'
+        - liberty:
+            openstack-branch: 'stable/liberty'
+            odl-ml2-version:  'stable/liberty'
+
+    openstack-vms: 4
+
+    install-features: 'odl-ovsdb-openstack,odl-jolokia'
+
+    schedule: 'H H * * *'
+
+    odl-enable-l3: 'yes'
+
+    enable-haproxy: 'yes'