diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ete/labs/windriver/Integration-Jenkins-openrc.sh | 14 | ||||
-rw-r--r-- | test/ete/labs/windriver/Integration-Stable-openrc.sh | 52 | ||||
-rw-r--r-- | test/ete/labs/windriver/onap-openstack.env (renamed from test/ete/labs/windriver/onap.env) | 46 | ||||
-rwxr-xr-x | test/ete/scripts/deploy-onap.sh | 50 | ||||
-rwxr-xr-x[-rw-r--r--] | test/ete/scripts/get-floating-ip.sh | 0 | ||||
-rwxr-xr-x | test/ete/scripts/install_openstack_cli.sh | 47 | ||||
-rwxr-xr-x | test/ete/scripts/remote/run-robot.sh | 18 | ||||
-rwxr-xr-x | test/ete/scripts/run-healthcheck.sh | 14 |
8 files changed, 116 insertions, 125 deletions
diff --git a/test/ete/labs/windriver/Integration-Jenkins-openrc.sh b/test/ete/labs/windriver/Integration-Jenkins-openrc.sh index 0b1801253..ef2aa9a25 100644 --- a/test/ete/labs/windriver/Integration-Jenkins-openrc.sh +++ b/test/ete/labs/windriver/Integration-Jenkins-openrc.sh @@ -28,18 +28,10 @@ unset OS_TENANT_NAME # performing the action as the **user**. export OS_USERNAME="gary_wu" -# Remote Openstack clients will need to set this environment if -# connecting to an HTTPS enabled endpoint -CERT_MSG="Please enter a path for your CA certificate pem file, \ -or press enter if you are not using HTTPS " -read -p "$CERT_MSG" OS_CACERT_INPUT -if [ ! -z "$OS_CACERT_INPUT" ] -then - export OS_CACERT=$(readlink -f $OS_CACERT_INPUT) -fi - # With Keystone you pass the keystone password. -read -sp "Please enter your OpenStack Password for project $OS_PROJECT_NAME as user $OS_USERNAME: " OS_PASSWORD_INPUT +if [ -z ${OS_PASSWORD_INPUT+x} ]; then + read -sp "Please enter your OpenStack Password for project $OS_PROJECT_NAME as user $OS_USERNAME: " OS_PASSWORD_INPUT +fi export OS_PASSWORD=$OS_PASSWORD_INPUT # If your configuration has multiple regions, we set that information here. diff --git a/test/ete/labs/windriver/Integration-Stable-openrc.sh b/test/ete/labs/windriver/Integration-Stable-openrc.sh deleted file mode 100644 index 1d68adc25..000000000 --- a/test/ete/labs/windriver/Integration-Stable-openrc.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash - -# To use an OpenStack cloud you need to authenticate against the Identity -# service named keystone, which returns a **Token** and **Service Catalog**. -# The catalog contains the endpoints for all services the user/tenant has -# access to - such as Compute, Image Service, Identity, Object Storage, Block -# Storage, and Networking (code-named nova, glance, keystone, swift, -# cinder, and neutron). -# -# *NOTE*: Using the 3 *Identity API* does not necessarily mean any other -# OpenStack API is version 3. For example, your cloud provider may implement -# Image API v1.1, Block Storage API v2, and Compute API v2.0. OS_AUTH_URL is -# only for the Identity API served through keystone. -export OS_AUTH_URL=http://10.12.25.2:5000/v3 - -# With the addition of Keystone we have standardized on the term **project** -# as the entity that owns the resources. -export OS_PROJECT_ID=3583253e932845a09cd4c8ca2f31d095 -export OS_PROJECT_NAME="Integration-Stable" -export OS_USER_DOMAIN_NAME="Default" -if [ -z "$OS_USER_DOMAIN_NAME" ]; then unset OS_USER_DOMAIN_NAME; fi - -# unset v2.0 items in case set -unset OS_TENANT_ID -unset OS_TENANT_NAME - -# In addition to the owning entity (tenant), OpenStack stores the entity -# performing the action as the **user**. -export OS_USERNAME="gary_wu" - -# Remote Openstack clients will need to set this environment if -# connecting to an HTTPS enabled endpoint -CERT_MSG="Please enter a path for your CA certificate pem file, \ -or press enter if you are not using HTTPS " -read -p "$CERT_MSG" OS_CACERT_INPUT -if [ ! -z "$OS_CACERT_INPUT" ] -then - export OS_CACERT=$(readlink -f $OS_CACERT_INPUT) -fi - -# With Keystone you pass the keystone password. -read -sp "Please enter your OpenStack Password for project $OS_PROJECT_NAME as user $OS_USERNAME: " OS_PASSWORD_INPUT -export OS_PASSWORD=$OS_PASSWORD_INPUT - -# If your configuration has multiple regions, we set that information here. -# OS_REGION_NAME is optional and only valid in certain environments. -export OS_REGION_NAME="RegionOne" -# Don't leave a blank variable, unset it if it was empty -if [ -z "$OS_REGION_NAME" ]; then unset OS_REGION_NAME; fi - -export OS_INTERFACE=public -export OS_IDENTITY_API_VERSION=3 diff --git a/test/ete/labs/windriver/onap.env b/test/ete/labs/windriver/onap-openstack.env index 5eb5d367f..b0380a17a 100644 --- a/test/ete/labs/windriver/onap.env +++ b/test/ete/labs/windriver/onap-openstack.env @@ -12,8 +12,6 @@ parameters: ubuntu_1604_image: ubuntu-16-04-cloud-amd64 - centos_7_image: CentOS-7 - flavor_small: m1.small flavor_medium: m1.medium @@ -24,18 +22,12 @@ parameters: flavor_xxlarge: m1.xxlarge - security_group: default - vm_base_name: onap key_name: onap_key - dcae_key_name: dcae_key - pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ38Q8CBflhkh - dcae_pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC94pcIva90rzXumORjMCf16qjVrn5+ykfW6uMcn+DPlifU+ihtqx4Up26v1gVZyCuY8BFmbhm4YGxnRykNfi71kYbWOasUFzY86dtptCuLVMRLsMYWwOA3sHQ5IcUYNbWmChh4LyOIfhy4p2atCmB1UUkQf7Icg8LokCIcdI3IohlNko50t9KOIhBvqC7Bnegnl6zpoYdtYQppdgp5xesdhYRrdIGmT86cH2QbImpcR3tMTty7SLsw5WdTSfUFwfm76s07ivUDfCRMCJoWcxQeh6my7P7BkfDYMVIYRyfWmoIf2iv3UrqahHTcCiL79SRiD0iCt0K2SEgGsVyCX2jf - nexus_repo: https://nexus.onap.org/content/sites/raw nexus_docker_repo: nexus3.onap.org:10001 @@ -98,11 +90,11 @@ parameters: clamp_ip_addr: 10.0.12.1 openo_ip_addr: 10.0.14.1 - dcae_coll_float_ip: 10.12.0.32 - dcae_db_float_ip: 10.12.0.24 - dcae_hdp1_float_ip: 10.12.0.30 - dcae_hdp2_float_ip: 10.12.0.33 - dcae_hdp3_float_ip: 10.12.0.15 +# dcae_coll_float_ip: PUT DCAE COLLECTOR FLOATING IP HERE +# dcae_db_float_ip: PUT DCAE DATABASE FLOATING IP HERE +# dcae_hdp1_float_ip: PUT DCAE HADOOP VM1 FLOATING IP HERE +# dcae_hdp2_float_ip: PUT DCAE HADOOP VM2 FLOATING IP HERE +# dcae_hdp3_float_ip: PUT DCAE HADOOP VM3 FLOATING IP HERE ########################### # # @@ -110,19 +102,35 @@ parameters: # # ########################### - dcae_base_environment: 1-NIC-FLOATING-IPS +# dcae_base_environment: 1-NIC-FLOATING-IPS dcae_zone: ZONE - dcae_state: STATE +# dcae_state: STATE + +# nexus_repo_root: https://nexus.onap.org - nexus_repo_root: https://nexus.onap.org +# nexus_url_snapshot: https://nexus.onap.org/content/repositories/snapshots - nexus_url_snapshot: https://nexus.onap.org/content/repositories/snapshots +# gitlab_branch: master - gitlab_branch: master +# dcae_code_version: 1.1.0 - dcae_code_version: 1.1.0 + dcaeos_cloud_env: PUT DACE TARGET DEPLOYMENT STACK'S FLAVOR (e.g. OpenStack) HERE + dcaeos_keystone_url: PUT DACE TARGET DEPLOYMENT STACK'S KEYSTONE URL HERE + dcaeos_openstack_region: PUT DACE TARGET DEPLOYMENT STACK'S REGION HERE + dcaeos_openstack_tenant_id: PUT DACE TARGET DEPLOYMENT STACK'S TENANT ID HERE + dcaeos_openstack_username: PUT DACE TARGET DEPLOYMENT STACK'S USERNAME HERE + dcaeos_openstack_password: PUT DACE TARGET DEPLOYMENT STACK'S PASSWORD HERE + dcaeos_dcae_key_name: PUT DACE TARGET DEPLOYMENT STACK'S UPLOADED KEY-PAIR NAME HERE + dcaeos_dcae_pub_key: PUT DACE TARGET DEPLOYMENT STACK'S PUBLIC KEY HERE + dcaeos_private_key: PUT DACE TARGET DEPLOYMENT STACK'S PRIVATE KEY HERE + dcaeos_openstack_private_network_name: PUT DACE TARGET DEPLOYMENT STACK'S INTERNAL NETWOKR ID HERE + dcaeos_public_net_id: PUT DACE TARGET DEPLOYMENT STACK'S PUBLIC NETWORK ID HERE + dcaeos_ubuntu_1604_image: PUT DACE TARGET DEPLOYMENT STACK'S UBUNTU1604 IMAGE ID (TO BE USED BY DCAE VMS) HERE + dcaeos_centos_7_image: PUT DACE TARGET DEPLOYMENT STACK'S CENTOS7 IMAGE ID (TO BE USED BY DCAE VMS) HERE + dcaeos_security_group: PUT DACE TARGET DEPLOYMENT STACK'S SECURITY GROUP ID (TO BE USED BY DCAE VMS) HERE + dcaeos_flavor_id: PUT DACE TARGET DEPLOYMENT STACK'S VM FLAVOR ID (TO BE USED BY DCAE VMS) HERE ################################ diff --git a/test/ete/scripts/deploy-onap.sh b/test/ete/scripts/deploy-onap.sh index 3c69e15e8..02943935d 100755 --- a/test/ete/scripts/deploy-onap.sh +++ b/test/ete/scripts/deploy-onap.sh @@ -1,53 +1,17 @@ #!/bin/bash -if [ -z "$OS_AUTH_URL" ] || [ -z "$OS_USERNAME" ] -then - echo "ERROR: OpenStack environment variables not set. Please source your OpenStack RC script first." - exit 1 -fi - - if [ -z "$WORKSPACE" ]; then export WORKSPACE=`git rev-parse --show-toplevel` fi +source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh - -# Assume that if ROBOT_VENV is set, we don't need to reinstall robot -if [ -f ${WORKSPACE}/env.properties ]; then - source ${WORKSPACE}/env.properties -fi - -if [ ! -z "$ONAP_VENV" ] && [ -f "$ONAP_VENV/bin/activate" ]; then - source ${ONAP_VENV}/bin/activate -else - ONAP_VENV=$(mktemp -d --suffix=_onap_venv) - virtualenv ${ONAP_VENV} - source ${ONAP_VENV}/bin/activate - - pip install --upgrade pip - pip install --upgrade python-openstackclient python-heatclient - - echo "ONAP_VENV=${ONAP_VENV}" >> $WORKSPACE/env.properties -fi -echo "ONAP_VENV=${ONAP_VENV}" - -if [ -z "$ONAP_WORKDIR" ]; then - ONAP_WORKDIR=$(mktemp -d --suffix=_onap_workdir) - echo "ONAP_WORKDIR=${ONAP_WORKDIR}" >> $WORKSPACE/env.properties -fi -echo "ONAP_WORKDIR=${ONAP_WORKDIR}" -if [ ! -d ${ONAP_WORKDIR}/demo ]; then - git clone http://gerrit.onap.org/r/demo ${ONAP_WORKDIR}/demo -else - pushd ${ONAP_WORKDIR}/demo - git pull - popd -fi - - +# Delete all existing stacks +STACKS=$(openstack stack list -c "Stack Name" -f value) +echo "Deleting Stacks ${STACKS}" +openstack stack delete -y $STACKS STACK="ete-$(uuidgen | cut -c-8)" -echo "Stack Name: ${STACK}" -openstack stack create -t ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.yaml -e ${WORKSPACE}/test/ete/labs/windriver/onap.env $STACK +echo "New Stack Name: ${STACK}" +openstack stack create -t ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.yaml -e ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env $STACK diff --git a/test/ete/scripts/get-floating-ip.sh b/test/ete/scripts/get-floating-ip.sh index 55854e73f..55854e73f 100644..100755 --- a/test/ete/scripts/get-floating-ip.sh +++ b/test/ete/scripts/get-floating-ip.sh diff --git a/test/ete/scripts/install_openstack_cli.sh b/test/ete/scripts/install_openstack_cli.sh new file mode 100755 index 000000000..ec5ad1f76 --- /dev/null +++ b/test/ete/scripts/install_openstack_cli.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +if [ -z "$OS_AUTH_URL" ] || [ -z "$OS_USERNAME" ] +then + echo "ERROR: OpenStack environment variables not set. Please source your OpenStack RC script first." + exit 1 +fi + + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi + + + +# Assume that if ROBOT_VENV is set, we don't need to reinstall robot +if [ -f ${WORKSPACE}/env.properties ]; then + source ${WORKSPACE}/env.properties +fi + +if [ ! -z "$ONAP_VENV" ] && [ -f "$ONAP_VENV/bin/activate" ]; then + source ${ONAP_VENV}/bin/activate +else + ONAP_VENV=$(mktemp -d --suffix=_onap_venv) + virtualenv ${ONAP_VENV} + source ${ONAP_VENV}/bin/activate + + pip install --upgrade pip + pip install --upgrade python-openstackclient python-heatclient + + echo "ONAP_VENV=${ONAP_VENV}" >> $WORKSPACE/env.properties +fi +echo "ONAP_VENV=${ONAP_VENV}" + +if [ -z "$ONAP_WORKDIR" ]; then + ONAP_WORKDIR=$(mktemp -d --suffix=_onap_workdir) + echo "ONAP_WORKDIR=${ONAP_WORKDIR}" >> $WORKSPACE/env.properties +fi +echo "ONAP_WORKDIR=${ONAP_WORKDIR}" +if [ ! -d ${ONAP_WORKDIR}/demo ]; then + git clone http://gerrit.onap.org/r/demo ${ONAP_WORKDIR}/demo +else + pushd ${ONAP_WORKDIR}/demo + git pull + popd +fi + diff --git a/test/ete/scripts/remote/run-robot.sh b/test/ete/scripts/remote/run-robot.sh new file mode 100755 index 000000000..ff7223a17 --- /dev/null +++ b/test/ete/scripts/remote/run-robot.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +cd /opt + +if [ ! -x /opt/demo.sh ]; then + echo "Robot VM not initialized" + exit 2 +fi + +if [ ! -d eteshare/logs/demo ]; then + echo "09d8566ea45e43aa974cf447ed591d77" > /opt/config/openstack_tenant_id.txt + echo "gary_wu" > /opt/config/openstack_username.txt + echo $OS_PASSWORD_INPUT > /opt/config/openstack_password.txt + /bin/bash /opt/eteshare/config/vm_config2robot.sh + echo "test" | /opt/demo.sh init_robot +fi + +/opt/ete.sh health diff --git a/test/ete/scripts/run-healthcheck.sh b/test/ete/scripts/run-healthcheck.sh new file mode 100755 index 000000000..ee6c2668a --- /dev/null +++ b/test/ete/scripts/run-healthcheck.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi + +source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh + +cd $WORKSPACE/test/ete/scripts + +ROBOT_IP=$(./get-floating-ip.sh onap-robot) +echo "ROBOT_IP=${ROBOT_IP}" + +ssh -o StrictHostKeychecking=no -i ~/.ssh/onap_key root@${ROBOT_IP} "OS_PASSWORD_INPUT=$OS_PASSWORD_INPUT bash -s" < ./remote/run-robot.sh |