From a49dea0cc307843eaa4ea445096df3c3d13b7bc3 Mon Sep 17 00:00:00 2001 From: gvrangan Date: Thu, 7 Apr 2016 01:12:44 +0000 Subject: [PATCH] Builder job for deploying Openstack for testing Change-Id: I48a8fc573042d8e55898b6817ec6880eccdb4597 Signed-off-by: gvrangan Signed-off-by: Jamo Luhrsen --- ...de-raw-integration-configure-clustering.sh | 7 + ...-integration-deploy-controller-run-test.sh | 12 +- ...w-integration-deploy-openstack-run-test.sh | 394 ++++++++++++++++++ ...ude-raw-integration-get-slave-addresses.sh | 31 +- ...-raw-integration-start-cluster-run-test.sh | 5 + jjb/integration/integration-macros.yaml | 23 + jjb/integration/integration-templates.yaml | 185 +++++++- .../netvirt-csit-1node-multi-openstack.yaml | 37 ++ .../netvirt-csit-3node-multi-openstack.yaml | 39 ++ 9 files changed, 726 insertions(+), 7 deletions(-) create mode 100644 jjb/integration/include-raw-integration-deploy-openstack-run-test.sh create mode 100644 jjb/netvirt/netvirt-csit-1node-multi-openstack.yaml create mode 100644 jjb/netvirt/netvirt-csit-3node-multi-openstack.yaml diff --git a/jjb/integration/include-raw-integration-configure-clustering.sh b/jjb/integration/include-raw-integration-configure-clustering.sh index 0950622f2..264f659b3 100644 --- a/jjb/integration/include-raw-integration-configure-clustering.sh +++ b/jjb/integration/include-raw-integration-configure-clustering.sh @@ -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} diff --git a/jjb/integration/include-raw-integration-deploy-controller-run-test.sh b/jjb/integration/include-raw-integration-deploy-controller-run-test.sh index 8d25ebb55..78bdec2fe 100644 --- a/jjb/integration/include-raw-integration-deploy-controller-run-test.sh +++ b/jjb/integration/include-raw-integration-deploy-controller-run-test.sh @@ -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 index 000000000..66e5ea162 --- /dev/null +++ b/jjb/integration/include-raw-integration-deploy-openstack-run-test.sh @@ -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 : diff --git a/jjb/integration/include-raw-integration-get-slave-addresses.sh b/jjb/integration/include-raw-integration-get-slave-addresses.sh index e498baab1..32be449b8 100644 --- a/jjb/integration/include-raw-integration-get-slave-addresses.sh +++ b/jjb/integration/include-raw-integration-get-slave-addresses.sh @@ -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 : + diff --git a/jjb/integration/include-raw-integration-start-cluster-run-test.sh b/jjb/integration/include-raw-integration-start-cluster-run-test.sh index 61f5dac33..4bc956436 100644 --- a/jjb/integration/include-raw-integration-start-cluster-run-test.sh +++ b/jjb/integration/include-raw-integration-start-cluster-run-test.sh @@ -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 diff --git a/jjb/integration/integration-macros.yaml b/jjb/integration/integration-macros.yaml index 48eb74431..d2b3a2764 100644 --- a/jjb/integration/integration-macros.yaml +++ b/jjb/integration/integration-macros.yaml @@ -214,6 +214,23 @@ 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 # ################# @@ -394,6 +411,12 @@ !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 # ############## diff --git a/jjb/integration/integration-templates.yaml b/jjb/integration/integration-templates.yaml index e1dde447d..963cffe96 100644 --- a/jjb/integration/integration-templates.yaml +++ b/jjb/integration/integration-templates.yaml @@ -687,6 +687,189 @@ 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 index 000000000..950a441b6 --- /dev/null +++ b/jjb/netvirt/netvirt-csit-1node-multi-openstack.yaml @@ -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 index 000000000..994d4c1a0 --- /dev/null +++ b/jjb/netvirt/netvirt-csit-3node-multi-openstack.yaml @@ -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' -- 2.36.6