summaryrefslogtreecommitdiffstats
path: root/utils/infra_setup/heat_template/vstf_heat_template
diff options
context:
space:
mode:
authorYang (Gabriel) Yu <Gabriel.yuyang@huawei.com>2018-12-24 08:04:02 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-12-24 08:04:02 +0000
commitb102f935eddb0e42574781910aff999563bdb2cb (patch)
treeb6c0b904b1f12bc140b3465ff744db2c71e2e3ae /utils/infra_setup/heat_template/vstf_heat_template
parentb90c5379dc9c8108847dd6a43437edc363ce232e (diff)
parent34740f4b9ff5d4a8300db69021db7543a45772fc (diff)
Merge "Remove useless files in Bottlenecks repo" into stable/gambia
Diffstat (limited to 'utils/infra_setup/heat_template/vstf_heat_template')
-rw-r--r--utils/infra_setup/heat_template/vstf_heat_template/bottleneck_vstf.yaml252
-rwxr-xr-xutils/infra_setup/heat_template/vstf_heat_template/dashboard.json6
-rw-r--r--utils/infra_setup/heat_template/vstf_heat_template/launch_vstf.sh156
-rwxr-xr-xutils/infra_setup/heat_template/vstf_heat_template/vstf_HOT_create_instance.sh241
-rw-r--r--utils/infra_setup/heat_template/vstf_heat_template/vstf_test.sh94
5 files changed, 0 insertions, 749 deletions
diff --git a/utils/infra_setup/heat_template/vstf_heat_template/bottleneck_vstf.yaml b/utils/infra_setup/heat_template/vstf_heat_template/bottleneck_vstf.yaml
deleted file mode 100644
index d9419929..00000000
--- a/utils/infra_setup/heat_template/vstf_heat_template/bottleneck_vstf.yaml
+++ /dev/null
@@ -1,252 +0,0 @@
-heat_template_version: 2013-05-23
-description: >
- This template is used for creating a new environment on the Openstack Release L ,
- and the deployment will create three virtual machine on the compute node, one manager
- and two agent vm included. Each vm will has a nic on the controlplane switch and two
- agent vms will has a additional nic on the dataplane.
-parameters:
- #nova keypair-list to query available key pair
- key_name:
- type: string
- description: Name of keypair to assign to servers
- default: vstf-key
- #nova image-list to query available images
- image:
- type: string
- description: Name of image to use for servers
- default: bottlenecks-trusty-server
- #new addition image for the actual deployment
- image_vstf_manager:
- type: string
- description: Name of image to use for servers
- default: vstf-manager
- image_vstf_tester:
- type: string
- description: Name of image to use for servers
- default: vstf-tester
- image_vstf_target:
- type: string
- description: Name of image to use for servers
- default: vstf-target
- #nova flavor-list to query available flavors
- flavor:
- type: string
- description: Flavor to use for servers
- default: m1.large
- #nova net-list to query available
- public_net:
- type: string
- description: >
- ID or name of public network for which floating IP addresses will be allocated
- default: net04_ext
-
- #private controlplane
- private_net_name:
- type: string
- description: Name of private network to be created
- default: vstf-private
- private_net_cidr:
- type: string
- description: Private network address (CIDR notation)
- default: "10.0.11.0/24"
- private_net_gateway:
- type: string
- description: Private network gateway address
- default: "10.0.11.1"
- private_net_pool_start:
- type: string
- description: Start of private network IP address allocation pool
- default: "10.0.11.2"
- private_net_pool_end:
- type: string
- description: End of private network IP address allocation pool
- default: "10.0.11.199"
-
- #testing dataplane
- testing_net_name:
- type: string
- description: Name of private network to be created
- default: bottlenecks-testing
- testing_net_cidr:
- type: string
- description: Private network address (CIDR notation)
- default: "10.0.20.0/24"
- testing_net_gateway:
- type: string
- description: Private network gateway address
- default: "10.0.20.1"
- testing_net_pool_start:
- type: string
- description: Start of private network IP address allocation pool
- default: "10.0.20.2"
- testing_net_pool_end:
- type: string
- description: End of private network IP address allocation pool
- default: "10.0.20.199"
-
-
-resources:
- #control plane
- private_net:
- type: OS::Neutron::Net
- properties:
- name: { get_param: private_net_name }
- private_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: private_net }
- cidr: { get_param: private_net_cidr }
- gateway_ip: { get_param: private_net_gateway }
- allocation_pools:
- - start: { get_param: private_net_pool_start }
- end: { get_param: private_net_pool_end }
-
- #dataplane
- testing_net:
- type: OS::Neutron::Net
- properties:
- name: { get_param: testing_net_name }
- testing_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: { get_resource: testing_net }
- cidr: { get_param: testing_net_cidr }
- gateway_ip: { get_param: testing_net_gateway }
- allocation_pools:
- - start: { get_param: testing_net_pool_start }
- end: { get_param: testing_net_pool_end }
-
- #router info
- router:
- type: OS::Neutron::Router
- properties:
- external_gateway_info:
- network: { get_param: public_net }
- router_interface:
- type: OS::Neutron::RouterInterface
- properties:
- router_id: { get_resource: router }
- subnet_id: { get_resource: private_subnet }
-
- #security_group
- server_security_group:
- type: OS::Neutron::SecurityGroup
- properties:
- description: vstf group for servers access.
- name: vstf-security-group
- rules: [
- {remote_ip_prefix: 0.0.0.0/0,
- protocol: tcp,
- port_range_min: 1,
- port_range_max: 65535},
- {remote_ip_prefix: 0.0.0.0/0,
- protocol: udp,
- port_range_min: 1,
- port_range_max: 65535},
- {remote_ip_prefix: 0.0.0.0/0,
- protocol: icmp}]
-
- #nova server vstf manager definition info
- vstf-manager:
- type: OS::Nova::Server
- properties:
- name: vstf-manager
- image: { get_param: image_vstf_manager }
- flavor: { get_param: flavor }
- key_name: { get_param: key_name }
- networks:
- - port: { get_resource: manager_control_port }
- manager_control_port:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: private_net }
- fixed_ips:
- - subnet_id: { get_resource: private_subnet }
- security_groups: [{ get_resource: server_security_group }]
- manager_control_floating_ip:
- type: OS::Neutron::FloatingIP
- properties:
- floating_network: { get_param: public_net }
- port_id: { get_resource: manager_control_port }
-
- #nova server vstf target definition info
- vstf-target:
- type: OS::Nova::Server
- properties:
- name: vstf-target
- image: { get_param: image_vstf_target }
- flavor: { get_param: flavor }
- key_name: { get_param: key_name }
- networks:
- - port: { get_resource: target_control_port }
- - port: { get_resource: target_testing_port }
- target_control_port:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: private_net }
- fixed_ips:
- - subnet_id: { get_resource: private_subnet }
- security_groups: [{ get_resource: server_security_group }]
- target_testing_port:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: testing_net }
- fixed_ips:
- - subnet_id: { get_resource: testing_subnet }
- security_groups: [{ get_resource: server_security_group }]
- target_control_floating_ip:
- type: OS::Neutron::FloatingIP
- properties:
- floating_network: { get_param: public_net }
- port_id: { get_resource: target_control_port }
-
- #nova server vstf tester definition info
- vstf-tester:
- type: OS::Nova::Server
- properties:
- name: vstf-tester
- image: { get_param: image_vstf_tester }
- flavor: { get_param: flavor }
- key_name: { get_param: key_name }
- networks:
- - port: { get_resource: tester_control_port }
- - port: { get_resource: tester_testing_port }
- tester_control_port:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: private_net }
- fixed_ips:
- - subnet_id: { get_resource: private_subnet }
- security_groups: [{ get_resource: server_security_group }]
- tester_testing_port:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: testing_net }
- fixed_ips:
- - subnet_id: { get_resource: testing_subnet }
- security_groups: [{ get_resource: server_security_group }]
- tester_control_floating_ip:
- type: OS::Neutron::FloatingIP
- properties:
- floating_network: { get_param: public_net }
- port_id: { get_resource: tester_control_port }
-
-outputs:
- manager_control_private_ip:
- description: IP address of manager_control in private network
- value: { get_attr: [ vstf-manager, first_address ] }
- manager_control_public_ip:
- description: Floating IP address of manager_control in public network
- value: { get_attr: [ manager_control_floating_ip, floating_ip_address ] }
- target_control_private_ip:
- description: IP address of manager_control in private network
- value: { get_attr: [ vstf-target, first_address ] }
- target_control_public_ip:
- description: Floating IP address of manager_control in public network
- value: { get_attr: [ target_control_floating_ip, floating_ip_address ] }
- tester_control_private_ip:
- description: IP address of manager_control in private network
- value: { get_attr: [ vstf-tester, first_address ] }
- tester_control_public_ip:
- description: Floating IP address of manager_control in public network
- value: { get_attr: [ tester_control_floating_ip, floating_ip_address ] }
diff --git a/utils/infra_setup/heat_template/vstf_heat_template/dashboard.json b/utils/infra_setup/heat_template/vstf_heat_template/dashboard.json
deleted file mode 100755
index df6f64c3..00000000
--- a/utils/infra_setup/heat_template/vstf_heat_template/dashboard.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "pod_name": "unknown-pod",
- "installer": "fuel",
- "version": "unknown",
- "target": "http://213.77.62.197/results"
-} \ No newline at end of file
diff --git a/utils/infra_setup/heat_template/vstf_heat_template/launch_vstf.sh b/utils/infra_setup/heat_template/vstf_heat_template/launch_vstf.sh
deleted file mode 100644
index ec615ec2..00000000
--- a/utils/infra_setup/heat_template/vstf_heat_template/launch_vstf.sh
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/bin/bash
-##############################################################################
-# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-set -x
-
-STACK_NAME="bottlenecks_vstf_stack"
-VM_MANAGER_USER="root"
-VM_MANAGER_PASSWD="root"
-VM_TARGET_USER="root"
-VM_TARGET_PASSWD="root"
-VM_TESTER_USER="root"
-VM_TESTER_PASSWD="root"
-RABBITMQ_PORT="5672"
-
-#load func
-#source ./ssh.sh
-#source ./scp.sh
-
-function fn_parser_ipaddress(){
- #parser and get output ipaddress
- manager_control_private_ip=`heat output-show ${STACK_NAME} manager_control_private_ip | sed 's/\"//g'`
- manager_control_public_ip=`heat output-show ${STACK_NAME} manager_control_public_ip | sed 's/\"//g'`
- echo "manager_control_private_ip = ${manager_control_private_ip}"
- #ping -c 5 ${manager_control_private_ip}
- echo "manager_control_public_ip = ${manager_control_public_ip}"
- ping -c 5 ${manager_control_public_ip}
- target_control_private_ip=`heat output-show ${STACK_NAME} target_control_private_ip | sed 's/\"//g'`
- target_control_public_ip=`heat output-show ${STACK_NAME} target_control_public_ip | sed 's/\"//g'`
- echo "target_control_private_ip = ${target_control_private_ip}"
- #ping -c 5 ${target_control_private_ip}
- echo "target_control_public_ip = ${target_control_public_ip}"
- ping -c 5 ${target_control_public_ip}
- tester_control_private_ip=`heat output-show ${STACK_NAME} tester_control_private_ip | sed 's/\"//g'`
- tester_control_public_ip=`heat output-show ${STACK_NAME} tester_control_public_ip | sed 's/\"//g'`
- echo "tester_control_private_ip = ${tester_control_private_ip}"
- #ping -c 5 ${tester_control_private_ip}
- echo "tester_control_public_ip = ${tester_control_public_ip}"
- ping -c 5 ${tester_control_public_ip}
-
- #get testing ipaddress
- tester_testing_ip=`nova list | grep "vstf-tester" | grep "bottlenecks-testing" | awk -F'bottlenecks-testing=' '{print $2}' | awk '{print $1}'`
- target_testing_ip=`nova list | grep "vstf-target" | grep "bottlenecks-testing" | awk -F'bottlenecks-testing=' '{print $2}' | awk '{print $1}'`
- echo "tester_testing_ip = ${tester_testing_ip}"
- echo "target_testing_ip = ${target_testing_ip}"
-
- #config ip for the testing plane
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${target_control_public_ip}
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${target_control_public_ip} "ifconfig eth1 ${target_testing_ip}/24;sleep 4"
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${tester_control_public_ip}
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${tester_control_public_ip} "ifconfig eth1 ${tester_testing_ip}/24;sleep 4"
- #ping with each other
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${target_control_public_ip}
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${target_control_public_ip} "ping -c 10 ${tester_testing_ip}"
-
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${tester_control_public_ip}
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${tester_control_public_ip} "ping -c 10 ${target_testing_ip}"
-
- local ipaddr=""
- for ipaddr in ${manager_control_private_ip} ${manager_control_public_ip} ${target_control_private_ip} \
- ${target_control_public_ip} ${tester_control_private_ip} ${tester_control_public_ip}
- do
- if [ "${ipaddr}x" == "x" ]
- then
- echo "[ERROR]The ipaddress is null ,get ip from heat output failed"
- exit 1
- fi
- done
-
- return 0
-}
-
-function fn_generate_amqp(){
- local node_type=$1
- if [ "${node_type}" == "manager" ]
- then
- return 0
- elif [ "${node_type}" == "target" -o "${node_type}" == "tester" ]
- then
- echo "[rabbit]" > ./vstf-${node_type}.ini
- echo "user=guest" >> ./vstf-${node_type}.ini
- echo "passwd=guest" >> ./vstf-${node_type}.ini
- echo "host=${manager_control_private_ip}" >> ./vstf-${node_type}.ini
- echo "port=${RABBITMQ_PORT}" >> ./vstf-${node_type}.ini
- echo "id=\"${node_type}\"" >> ./vstf-${node_type}.ini
- else
- echo "[ERROR]node type ${node_type} does not exist"
- exit 1
- fi
- return 0
-}
-
-function fn_provision_agent_file(){
-
- #apt-get -y install expect
- #manager
- fn_generate_amqp "manager"
-
- #target
- fn_generate_amqp "target"
- #scp_cmd ${target_control_public_ip} ${VM_TARGET_USER} ${VM_TARGET_PASSWD} "./vstf-target.ini" "/etc/vstf/amqp/amqp.ini" "file"
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${target_control_public_ip}
- sshpass -p root scp -o StrictHostKeyChecking=no "./vstf-target.ini" root@${target_control_public_ip}:/etc/vstf/amqp/amqp.ini
- #tester
- fn_generate_amqp "tester"
- #scp_cmd ${tester_control_public_ip} ${VM_TESTER_USER} ${VM_TESTER_PASSWD} "./vstf-tester.ini" "/etc/vstf/amqp/amqp.ini" "file"
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${tester_control_public_ip}
- sshpass -p root scp -o StrictHostKeyChecking=no "./vstf-tester.ini" root@${tester_control_public_ip}:/etc/vstf/amqp/amqp.ini
-
- return 0
-}
-
-function fn_launch_vstf_process(){
-
- #launch manager
- local manager_cmd="vstf-manager stop;pkill vstf-manager;rm -rf /opt/vstf/vstf-server.pid;vstf-manager start --monitor ${manager_control_private_ip} --port ${RABBITMQ_PORT}"
- #run_cmd ${manager_control_public_ip} ${VM_MANAGER_USER} ${VM_MANAGER_PASSWD} "${manager_cmd}"
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${manager_control_public_ip}
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "ifconfig -a"
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "${manager_cmd}"
-
- #launch target agent
- local target_cmd="vstf-agent stop;pkill vstf-agent;rm -rf /tmp/esp_rpc_client.pid;vstf-agent start --config_file=/etc/vstf/amqp/amqp.ini"
- #run_cmd ${target_control_public_ip} ${VM_TARGET_USER} ${VM_TARGET_PASSWD} "${target_cmd}"
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${target_control_public_ip}
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${target_control_public_ip} "ifconfig -a"
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${target_control_public_ip} "${target_cmd}"
-
- #launch tester agent
- #run_cmd ${tester_control_public_ip} ${VM_TESTER_USER} ${VM_TESTER_PASSWD} "${target_cmd}"
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${tester_control_public_ip}
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${tester_control_public_ip} "ifconfig -a"
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${tester_control_public_ip} "${target_cmd}"
-
- return 0
-}
-
-function main(){
- fn_parser_ipaddress
- fn_provision_agent_file
- fn_launch_vstf_process
- cmd="rabbitmqctl list_queues"
- sleep 20
- #${manager_control_public_ip} ${VM_MANAGER_USER} ${VM_MANAGER_PASSWD} "${cmd}"
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${manager_control_public_ip}
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "${cmd}"
- return 0
-}
-
-main
-set +x
diff --git a/utils/infra_setup/heat_template/vstf_heat_template/vstf_HOT_create_instance.sh b/utils/infra_setup/heat_template/vstf_heat_template/vstf_HOT_create_instance.sh
deleted file mode 100755
index ce8ed439..00000000
--- a/utils/infra_setup/heat_template/vstf_heat_template/vstf_HOT_create_instance.sh
+++ /dev/null
@@ -1,241 +0,0 @@
-#!/bin/bash
-##############################################################################
-# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-set -ex
-
-GERRIT_REFSPEC_DEBUG=$1
-
-echo "vstf DEBUG test"
-echo "vstf workflow goes here"
-
-bottlenecks_env_prepare()
-{
- if [ -d $BOTTLENECKS_REPO_DIR ]; then
- rm -rf ${BOTTLENECKS_REPO_DIR}
- fi
-
- mkdir -p ${BOTTLENECKS_REPO_DIR}
- git config --global http.sslVerify false
- git clone ${BOTTLENECKS_REPO} ${BOTTLENECKS_REPO_DIR}
- if [ x"$GERRIT_REFSPEC_DEBUG" != x ]; then
- cd ${BOTTLENECKS_REPO_DIR}
- git fetch $BOTTLENECKS_REPO $GERRIT_REFSPEC_DEBUG && git checkout FETCH_HEAD
- cd -
- fi
-
- #obtain installer(openstack) IP, etc, use rubbos's temporarily, later we can amend this
- source $BOTTLENECKS_REPO_DIR/rubbos/rubbos_scripts/1-1-1/scripts/env_preparation.sh
-}
-
-vstf_cleanup()
-{
- echo "[INFO]Begin to clean up vstf heat-stack ,glance images and keypairs"
- #heat stack-delete bottlenecks
- sleep 30
- if heat stack-list; then
- for stack in $(heat stack-list | grep -e " vstf " | awk '{print $2}'); do
- echo "[INFO]clean up stack $stack"
- heat stack-delete $stack || true
- sleep 30
- done
- fi
-
- echo "begin to clean the image"
- glance image-delete ${MANAGER_IMAGE_NAME};glance image-delete "${TARGET_IMAGE_NAME}";glance image-delete "${TESTER_IMAGE_NAME}"
- if glance image-list; then
- for image in $(glance image-list | grep -e "${MANAGER_IMAGE_NAME}" | awk '{print $2}'); do
- echo "[INFO]clean up image $image"
- glance image-delete $image || true
- done
- for image in $(glance image-list | grep -e "${TARGET_IMAGE_NAME}" | awk '{print $2}'); do
- echo "[INFO]clean up image $image"
- glance image-delete $image || true
- done
- for image in $(glance image-list | grep -e "${TESTER_IMAGE_NAME}" | awk '{print $2}'); do
- echo "[INFO]clean up image $image"
- glance image-delete $image || true
- done
- fi
-
- if nova keypair-list; then
- for key in $(nova keypair-list | grep -e $KEY_NAME | awk '{print $2}'); do
- echo "[INFO]clean up key $key"
- nova keypair-delete $key || true
- done
- fi
-
- #check the default flavor m1.large existing
- if nova flavor-list; then
- flag=`nova flavor-list | grep "m1.large "`
- echo "[INFO]the flavor m1.large num is $flag"
- fi
-
- #delete image file
- rm -rf /tmp/vstf-manager.img;rm -rf /tmp/vstf-agent.img ;rm -rf /tmp/vstf-agent_1.img
- return 0
-
-}
-
-vstf_register()
-{
- echo "[INFO]download vstf images"
- #download vstf-manager and vstf-agent image
- #curl --connect-timeout 10 -o /tmp/vstf-manager.img $MANAGER_IMAGE_URL -v
- #curl --connect-timeout 10 -o /tmp/vstf-agent.img $AGENT_IMAGE_URL -v
- curl --connect-timeout 10 -o /tmp/vstf-manager.img $MANAGER_IMAGE_URL -v
- curl --connect-timeout 10 -o /tmp/vstf-agent.img $MANAGER_IMAGE_URL -v
- curl --connect-timeout 10 -o /tmp/vstf-agent_1.img $MANAGER_IMAGE_URL -v
- #echo "begin to test downloading from vstf directory!!!!!!"
- #curl --connect-timeout 10 -o /tmp/vstf-test.txt
- #echo "begin to cat /tmp/vstf-test.txt vstf directory!!!!!!"
- #cat /tmp/vstf-test.txt
- #register
- echo "[INFO]register vstf manager and agent images"
- result=$(glance image-create \
- --name $MANAGER_IMAGE_NAME \
- --disk-format qcow2 \
- --container-format bare \
- --file /tmp/vstf-manager.img)
- echo "Manager image register result $result."
-
- result=$(glance image-create \
- --name $TESTER_IMAGE_NAME \
- --disk-format qcow2 \
- --container-format bare \
- --file /tmp/vstf-agent.img)
- echo "Agent image register result $result."
-
- result=$(glance image-create \
- --name $TARGET_IMAGE_NAME \
- --disk-format qcow2 \
- --container-format bare \
- --file /tmp/vstf-agent_1.img)
- echo "Agent image register result $result."
-
- glance image-list
-
- rm -rf /tmp/vstf-manager.img;rm -rf /tmp/vstf-agent.img ;rm -rf /tmp/vstf-agent_1.img
-}
-
-#vstf logic function here
-vstf_create_heat_template()
-{
- echo "create vstf instance using heat template"
- echo "upload keypair"
- nova keypair-add --pub_key $KEY_PATH/bottlenecks_key.pub $KEY_NAME
- nova keypair-list
- echo "use heat template to create stack"
- cd ${HOT_PATH}
- heat stack-create vstf -f ${TEMPLATE_NAME}
-
-}
-
-wait_heat_stack_complete()
-{
- retry=0
- while true
- do
- status=$(heat stack-list | grep vstf | awk '{print $6}')
- if [ x$status = x"CREATE_COMPLETE" ]; then
- echo "vstf stacke create complete"
- heat stack-show vstf
- nova list | grep vstf-
- break;
- elif [ x$status = x"CREATE_FAILED" ]; then
- echo "bottlenecks stacke create failed !!!"
- heat stack-show vstf
- exit 1
- fi
-
- if [ "$BOTTLENECKS_DEBUG" == "True" ]; then
- heat stack-show vstf
- nova list | grep vstf-
- for i in $(nova list | grep "vstf-" | grep ERROR | awk '{print $2}')
- do
- nova show $i
- done
- fi
- sleep 1
- let retry+=1
- if [[ $retry -ge $1 ]];then
- echo "Heat vstf stack create timeout, status $status !!!"
- exit 1
- fi
- done
-}
-
-
-vstf_check_instance_ok()
-{
- wait_heat_stack_complete 120
-
- return 0
-}
-
-vstf_launch()
-{
- cd ${HOT_PATH}
- bash -x ./launch_vstf.sh
-
-}
-
-vstf_test()
-{
- cd ${HOT_PATH}
- bash -x ./vstf_test.sh
-}
-
-main()
-{
- echo "bottlenecks vstf: create instances with heat template"
-
- BOTTLENECKS_REPO=https://gerrit.opnfv.org/gerrit/bottlenecks
- BOTTLENECKS_REPO_DIR=/tmp/opnfvrepo_vstf/bottlenecks
- #vstf parameter here
- MANAGER_IMAGE_URL=http://artifacts.opnfv.org/bottlenecks/vstf-manager-new.img
- AGENT_IMAGE_URL=http://artifacts.opnfv.org/bottlenecks/vstf-agent-new.img
- #MANAGER_IMAGE_URL=http://artifacts.opnfv.org/bottlenecks/rubbos/bottlenecks-trusty-server.img
- #AGENT_IMAGE_URL=http://artifacts.opnfv.org/bottlenecks/rubbos/bottlenecks-trusty-server.img
- MANAGER_IMAGE_NAME="vstf-manager"
- TESTER_IMAGE_NAME="vstf-tester"
- TARGET_IMAGE_NAME="vstf-target"
-
- KEY_PATH=$BOTTLENECKS_REPO_DIR/utils/infra_setup/bottlenecks_key
- HOT_PATH=$BOTTLENECKS_REPO_DIR/utils/infra_setup/heat_template/vstf_heat_template
- KEY_NAME=vstf-key
- #use the default openstack flavor m1.large
- FLAVOR_NAME="m1.large"
- TEMPLATE_NAME=bottleneck_vstf.yaml
- PUBLIC_NET_NAME=net04_ext
-
- #load adminrc
- bottlenecks_env_prepare
- #vstf function here
- vstf_cleanup
- vstf_register
- vstf_create_heat_template
- vstf_check_instance_ok
- heat stack-list
- nova list
- sleep 100
- vstf_launch
- sleep 30
- vstf_test
- sleep 10
- echo "[INFO]bottleneck vstf testsuite done ,results in the directory ${HOT_PATH}/result"
- echo "[INFO]Begin to clean up the vstf heat-stack and image"
- vstf_cleanup
- sleep 30
- heat stack-list
- nova list
-
-}
-
-main
-set +ex
diff --git a/utils/infra_setup/heat_template/vstf_heat_template/vstf_test.sh b/utils/infra_setup/heat_template/vstf_heat_template/vstf_test.sh
deleted file mode 100644
index 94e42e23..00000000
--- a/utils/infra_setup/heat_template/vstf_heat_template/vstf_test.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/bin/bash
-##############################################################################
-# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-set -x
-
-VM_MANAGER_USER="root"
-VM_MANAGER_PASSWD="root"
-STACK_NAME="bottlenecks_vstf_stack"
-
-function fn_parser_ipaddress(){
- #parser and get output ipaddress
- manager_control_private_ip=`heat output-show ${STACK_NAME} manager_control_private_ip | sed 's/\"//g'`
- manager_control_public_ip=`heat output-show ${STACK_NAME} manager_control_public_ip | sed 's/\"//g'`
-
- local ipaddr=""
- for ipaddr in ${manager_control_private_ip} ${manager_control_public_ip}
- do
- if [ "${ipaddr}x" == "x" ]
- then
- echo "[ERROR]The ipaddress is null ,get ip from heat output failed"
- exit 1
- fi
- done
-
- return 0
-}
-
-function fn_vstf_test_config(){
- #get testing ipaddress
- tester_testing_ip=`nova list | grep "vstf-tester" | grep "bottlenecks-testing" | awk -F'bottlenecks-testing=' '{print $2}' | awk '{print $1}'`
- target_testing_ip=`nova list | grep "vstf-target" | grep "bottlenecks-testing" | awk -F'bottlenecks-testing=' '{print $2}' | awk '{print $1}'`
- echo "tester_testing_ip = ${tester_testing_ip}"
- echo "target_testing_ip = ${target_testing_ip}"
- #setting testting ipaddress
- local cmd="vstfadm settings ${tester_testing_ip} ${target_testing_ip}"
- echo "$cmd"
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${manager_control_public_ip}
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "${cmd}"
-
- return 0
-}
-
-function fn_testing_scenario(){
- local head_cmd="vstfadm perf-test "
- local test_length_list="64 128 256 512 1024"
- local test_scenario_list="Tu-1 Tu-3"
- local test_tool="netperf"
- local protocol="udp"
- local test_type="frameloss"
- for scene in ${test_scenario_list}
- do
- local cmd="${head_cmd} ${scene} ${test_tool} ${protocol} ${test_type} \"${test_length_list}\" > /root/${scene}-result.txt"
- echo ${cmd}
-
- ssh-keygen -f "/home/jenkins-ci/.ssh/known_hosts" -R ${manager_control_public_ip}
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "${cmd}"
- sleep 10
- done
- return 0
-}
-
-function fn_result(){
- local test_scenario_list="Tu-1 Tu-3"
- mkdir ./result
- rm -rf ./result/*
- for scene in ${test_scenario_list}
- do
- sshpass -p root ssh -o StrictHostKeyChecking=no root@${manager_control_public_ip} "cat /root/${scene}-result.txt"
- sshpass -p root scp -o StrictHostKeyChecking=no root@${manager_control_public_ip}:/root/${scene}-result.txt "./result/${scene}"
- done
- return 0
-}
-
-function fn_upload(){
- python vstf_collector.py --config dashboard.json --dir result
-}
-
-function main(){
- fn_parser_ipaddress
- fn_vstf_test_config
- fn_testing_scenario
- fn_result
- fn_upload
- return 0
-}
-
-main
-set +x