diff options
Diffstat (limited to 'test/ete')
24 files changed, 1037 insertions, 142 deletions
diff --git a/test/ete/labs/gwu/apt-proxy.sh b/test/ete/labs/gwu/apt-proxy.sh new file mode 100755 index 000000000..d69415bd8 --- /dev/null +++ b/test/ete/labs/gwu/apt-proxy.sh @@ -0,0 +1,18 @@ +#!/bin/bash +sed -i '/#!\/bin\/bash/a\ + # sleep up to 3 minutes to avoid disk contention\ + sleep $((RANDOM / 200))\ + mkdir -p /etc/docker\ + cat > /etc/docker/daemon.json <<EOF\ + {\ + "insecure-registries" : ["192.168.1.51:5000"]\ + }\ + EOF\ + cat > /etc/apt/apt.conf.d/30proxy<<EOF\ + Acquire::http { Proxy "http://192.168.1.51:3142"; };\ + Acquire::https::Proxy "DIRECT";\ + EOF\ + apt-get -y update' $1 + +# don't use insecure docker proxy in dcae +perl -i -0pe 's/(?<=dcae_c_vm:)(.*?)\{ get_param: nexus_docker_repo \}/$1"nexus3.onap.org:10001"/s' $1 diff --git a/test/ete/labs/gwu/onap-oom.env b/test/ete/labs/gwu/onap-oom.env new file mode 100644 index 000000000..6315267ef --- /dev/null +++ b/test/ete/labs/gwu/onap-oom.env @@ -0,0 +1,26 @@ +parameters: + + ############################################## + # # + # Parameters used across all ONAP components # + # # + ############################################## + + public_net_id: 024582bd-ef9b-48b9-9e70-e6732559d9df + public_net_name: provider + docker_proxy: 192.168.1.51:5000 + apt_proxy: 192.168.1.51:3142 + ubuntu_1404_image: trusty + ubuntu_1604_image: xenial + centos_7_image: centos7 + openstack_tenant_id: 4c93f99551604bf7af25a8f80c7f34cb + openstack_tenant_name: onap + openstack_username: demo + openstack_api_key: demo + keystone_url: http://192.168.1.11:5000 + rancher_vm_flavor: m1.small + k8s_vm_flavor: m2.xxlarge + dns_list: ["192.168.1.11", "192.168.1.3"] + dns_forwarder: 192.168.1.11 + oam_network_cidr: 172.16.0.0/16 + dcae_ip_addr: 172.16.0.4 diff --git a/test/ete/labs/gwu/onap-openrc b/test/ete/labs/gwu/onap-openrc new file mode 100644 index 000000000..1a452fa0a --- /dev/null +++ b/test/ete/labs/gwu/onap-openrc @@ -0,0 +1,9 @@ +export OS_PROJECT_ID=4c93f99551604bf7af25a8f80c7f34cb +export OS_PROJECT_DOMAIN_NAME=Default +export OS_USER_DOMAIN_NAME=Default +export OS_PROJECT_NAME=onap +export OS_USERNAME=demo +export OS_PASSWORD=demo +export OS_AUTH_URL=http://controller:5000/v3 +export OS_IDENTITY_API_VERSION=3 +export OS_IMAGE_API_VERSION=2 diff --git a/test/ete/labs/gwu/onap-openstack-template.env b/test/ete/labs/gwu/onap-openstack-template.env new file mode 100644 index 000000000..97adca265 --- /dev/null +++ b/test/ete/labs/gwu/onap-openstack-template.env @@ -0,0 +1,142 @@ +parameters: + + ############################################## + # # + # Parameters used across all ONAP components # + # # + ############################################## + + public_net_id: 024582bd-ef9b-48b9-9e70-e6732559d9df + + public_net_name: provider + + ubuntu_1404_image: trusty + + ubuntu_1604_image: xenial + + flavor_small: m1.small + + flavor_medium: m1.medium + + flavor_large: m1.large + + flavor_xlarge: m1.xlarge + + flavor_xxlarge: m1.xlarge # purposely use a smaller VM here to reduce RAM usage + + vm_base_name: onap + + key_name: onap_key + + pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ38Q8CBflhkh + + nexus_repo: https://nexus.onap.org/content/sites/raw + + nexus_docker_repo: 192.168.1.51:5000 + + nexus_username: anonymous + + nexus_password: anonymous + + dmaap_topic: AUTO + + artifacts_version: 1.1.1 + + openstack_tenant_id: ${OS_PROJECT_ID} + + openstack_tenant_name: ${OS_PROJECT_NAME} + + openstack_username: ${OS_USERNAME} + + openstack_api_key: ${OS_PASSWORD} + + openstack_auth_method: password + + openstack_region: RegionOne + + horizon_url: http://192.168.1.11/horizon + + keystone_url: http://192.168.1.11:5000 + + cloud_env: RegionOne + + + ###################### + # # + # Network parameters # + # # + ###################### + + dns_list: ["192.168.1.11", "192.168.1.3"] + external_dns: 192.168.1.3 + dns_forwarder: 192.168.1.11 + oam_network_cidr: 172.16.0.0/16 + + ### Private IP addresses ### + + aai1_ip_addr: 172.16.1.1 + aai2_ip_addr: 172.16.1.2 + appc_ip_addr: 172.16.2.1 + dcae_ip_addr: 172.16.4.1 + dns_ip_addr: 172.16.100.1 + so_ip_addr: 172.16.5.1 + mr_ip_addr: 172.16.11.1 + policy_ip_addr: 172.16.6.1 + portal_ip_addr: 172.16.9.1 + robot_ip_addr: 172.16.10.1 + sdc_ip_addr: 172.16.3.1 + sdnc_ip_addr: 172.16.7.1 + vid_ip_addr: 172.16.8.1 + clamp_ip_addr: 172.16.12.1 + openo_ip_addr: 172.16.14.1 + + ########################### + # # + # Parameters used by DCAE # + # # + ########################### + + dnsaas_config_enabled: false + dnsaas_region: RegionOne + dnsaas_keystone_url: http://192.168.1.11:5000/v3 + dnsaas_tenant_name: ${OS_PROJECT_NAME} + dnsaas_username: ${OS_USERNAME} + dnsaas_password: ${OS_PASSWORD} + dcae_keystone_url: http://192.168.1.11:5000/v2.0 + dcae_centos_7_image: centos7 + dcae_domain: dcaeg2.onap.org + dcae_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6M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d6qAM2EsNXQvewf8fipBVBRPsRqKOv+uepd01dHNy62I5B+zRm\n +be9Kbe+EN60qdzvyPM+2hV6CnvGv1dirimS9pu6RrxD2Rmz1ectnJE+rAoGBAM3w\n +UbSEemyZ6EKjck2RfdipzY0MNBnIZ2cUqHh8mmPXjdTLzpXb9vmPbHb01Qwo8MP+\n +gMnTbTBOzyNAaHdIrCO9FHW6C85j3ot5Yzcr+EcBVcua+7KHU0Sgn44JNH8DisJ7\n +Y63UP/1Xb4d1/QvHfxYy3WOvvRdVZ7pPo8JNX95jAoGAIe5CIg8/JizUZa7KeKUh\n +9pgDleQPkQsrHQ6/AyIwFBsLwf9THSS5V+uV9D57SfUs46Bf2U8J6N90YQSlt8iS\n +aWuManFPVgT+yxDIzt6obf2mCEpOIBtQ6N4ZRh2HhQwdWTCrkzkDdGQaHG+jYL6C\n +xGPwiG2ON7OAfGIAM7eN5lECgYEAhoRLWlaOgRGnHKAWsYQvZ67CjTdDcPPuVu6v\n +fMQnNMA/7JeTwV+E205L0wfpgZ/cZKmBBlQMJlnUA3q2wfO+PTnse1mjDJU/cGtB\n +22/lJLxChlQdxGeQhGtGzUhF+hEeOhrO6WSSx7CtMRZoy6Dr6lwfMFZCdVNcBd6v\n +YOOZk3ECgYEAseUKGb6E80XTVVNziyuiVbQCsI0ZJuRfqMZ2IIDQJU9u6AnGAway\n +itqHbkGsmDT+4HUz01+1JKnnw42RdSrHdU/LaOonD+RIGqe2x800QXzqASKLdCXr\n +y7RoiFqJtkdFQykzJemA+xOXvHLgKi/MXFsU90PCD0VJKLj8vwpX78Y=\n +-----END RSA PRIVATE KEY-----' + + ################################ + # # + # Docker versions and branches # + # Rest of the file will be autogenerated from demo repo + # # + ################################ diff --git a/test/ete/labs/huawei/apt-proxy.sh b/test/ete/labs/huawei/apt-proxy.sh new file mode 100755 index 000000000..37018ca6b --- /dev/null +++ b/test/ete/labs/huawei/apt-proxy.sh @@ -0,0 +1,16 @@ +#!/bin/bash +sed -i '/#!\/bin\/bash/a\ + mkdir -p /etc/docker\ + cat > /etc/docker/daemon.json <<EOF\ + {\ + "insecure-registries" : ["10.145.122.118:5000"]\ + }\ + EOF\ + cat > /etc/apt/apt.conf.d/30proxy<<EOF\ + Acquire::http { Proxy "http://10.145.122.118:3142"; };\ + Acquire::https::Proxy "DIRECT";\ + EOF\ + apt-get -y update' $1 + +# don't use insecure docker proxy in dcae +perl -i -0pe 's/(?<=dcae_c_vm:)(.*?)\{ get_param: nexus_docker_repo \}/$1"nexus3.onap.org:10001"/s' $1 diff --git a/test/ete/labs/huawei/k8s_vm_entrypoint.sh b/test/ete/labs/huawei/k8s_vm_entrypoint.sh new file mode 100644 index 000000000..cae0f392b --- /dev/null +++ b/test/ete/labs/huawei/k8s_vm_entrypoint.sh @@ -0,0 +1,196 @@ +#!/bin/bash -x +printenv + +mkdir -p /opt/config +echo "__rancher_ip_addr__" > /opt/config/rancher_ip_addr.txt +echo `hostname -I` `hostname` >> /etc/hosts +mkdir -p /etc/docker +cat > /etc/docker/daemon.json <<EOF +{ + "insecure-registries" : ["__docker_proxy__"] +} +EOF +cat > /etc/apt/apt.conf.d/30proxy<<EOF +Acquire::http { Proxy "http://__apt_proxy__"; }; +Acquire::https::Proxy "DIRECT"; +EOF +apt-get -y update +apt-get -y install jq + +cd ~ + +# install docker 1.12 +curl -s https://releases.rancher.com/install-docker/1.12.sh | sh +usermod -aG docker ubuntu + +# install kubernetes 1.8.6 +curl -s -LO https://storage.googleapis.com/kubernetes-release/release/v1.8.6/bin/linux/amd64/kubectl +chmod +x ./kubectl +sudo mv ./kubectl /usr/local/bin/kubectl +mkdir ~/.kube + +# install helm 2.3 +wget -q http://storage.googleapis.com/kubernetes-helm/helm-v2.3.0-linux-amd64.tar.gz +tar -zxvf helm-v2.3.0-linux-amd64.tar.gz +sudo mv linux-amd64/helm /usr/local/bin/helm + +# Fix virtual memory allocation for onap-log:elasticsearch: +echo "vm.max_map_count=262144" >> /etc/sysctl.conf +sysctl -p + +# install rancher agent +echo export RANCHER_IP=__rancher_ip_addr__ > api-keys-rc +source api-keys-rc + +sleep 50 +until curl -s -o projects.json -H "Accept: application/json" http://$RANCHER_IP:8080/v2-beta/projects; do + sleep 10 +done +OLD_PID=$(jq -r '.data[0].id' projects.json) + +curl -s -H "Accept: application/json" -H "Content-Type: application/json" -d '{"accountId":"1a1"}' http://$RANCHER_IP:8080/v2-beta/apikeys | tee apikeys.json +echo export RANCHER_ACCESS_KEY=`jq -r '.publicValue' apikeys.json` >> api-keys-rc +echo export RANCHER_SECRET_KEY=`jq -r '.secretValue' apikeys.json` >> api-keys-rc +source api-keys-rc + +curl -s -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" -X DELETE -H 'Content-Type: application/json' "http://$RANCHER_IP:8080/v2-beta/projects/$OLD_PID" + +until [ ! -z "$TEMPLATE_ID" ] && [ "$TEMPLATE_ID" != "null" ]; do + sleep 5 + curl -s -H "Accept: application/json" http://$RANCHER_IP:8080/v2-beta/projectTemplates?name=Kubernetes | tee projectTemplatesKubernetes.json + TEMPLATE_ID=$(jq -r '.data[0].id' projectTemplatesKubernetes.json) +done + +curl -s -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" -X POST -H 'Content-Type: application/json' -d '{ "name":"oom", "projectTemplateId":"'$TEMPLATE_ID'" }' "http://$RANCHER_IP:8080/v2-beta/projects" | tee project.json +PID=`jq -r '.id' project.json` +echo export RANCHER_URL=http://$RANCHER_IP:8080/v1/projects/$PID >> api-keys-rc +source api-keys-rc + +until [ $(jq -r '.state' project.json) == "active" ]; do + sleep 5 + curl -s -H "Accept: application/json" http://$RANCHER_IP:8080/v1/projects/$PID | tee project.json +done + +TID=$(curl -s -X POST -H "Accept: application/json" -H "Content-Type: application/json" http://$RANCHER_IP:8080/v1/projects/$PID/registrationTokens | jq -r '.id') +touch token.json +while [ $(jq -r .command token.json | wc -c) -lt 10 ]; do + sleep 5 + curl -s -X GET -H "Accept: application/json" http://$RANCHER_IP:8080/v1/projects/$PID/registrationToken/$TID | tee token.json +done +CMD=$(jq -r .command token.json) +eval $CMD + +# download rancher CLI +wget -q https://github.com/rancher/cli/releases/download/v0.6.7/rancher-linux-amd64-v0.6.7.tar.xz +unxz rancher-linux-amd64-v0.6.7.tar.xz +tar xvf rancher-linux-amd64-v0.6.7.tar + +# Clone OOM: +cd ~ +git clone -b amsterdam http://gerrit.onap.org/r/oom + +# Update values.yaml to point to docker-proxy instead of nexus3: +cd ~/oom/kubernetes +perl -p -i -e 's/nexus3.onap.org:10001/__docker_proxy__/g' `find ./ -name values.yaml` oneclick/setenv.bash + +KUBETOKEN=$(echo -n 'Basic '$(echo -n "$RANCHER_ACCESS_KEY:$RANCHER_SECRET_KEY" | base64 -w 0) | base64 -w 0) + +# create .kube/config +cat > ~/.kube/config <<EOF +apiVersion: v1 +kind: Config +clusters: +- cluster: + api-version: v1 + insecure-skip-tls-verify: true + server: "https://$RANCHER_IP:8080/r/projects/$PID/kubernetes:6443" + name: "oom" +contexts: +- context: + cluster: "oom" + user: "oom" + name: "oom" +current-context: "oom" +users: +- name: "oom" + user: + token: "$KUBETOKEN" +EOF + +export KUBECONFIG=/root/.kube/config +kubectl config view + +# Update ~/oom/kubernetes/kube2msb/values.yaml kubeMasterAuthToken to use the token from ~/.kube/config +sed -i "s/kubeMasterAuthToken:.*/kubeMasterAuthToken: $KUBETOKEN/" ~/oom/kubernetes/kube2msb/values.yaml + +# Put your onap_key ssh private key in ~/.ssh/onap_key + +# Create or edit ~/oom/kubernetes/config/onap-parameters.yaml +cp ~/oom/kubernetes/config/onap-parameters-sample.yaml ~/oom/kubernetes/config/onap-parameters.yaml +cat >> ~/oom/kubernetes/config/onap-parameters.yaml <<EOF + +#################################### +# Overridden by k8s_vm_entrypoint.sh +#################################### + +OPENSTACK_UBUNTU_14_IMAGE: "__ubuntu_1404_image__" +OPENSTACK_UBUNTU_16_IMAGE: "__ubuntu_1604_image__" +OPENSTACK_CENTOS_7_IMAGE: "__centos_7_image__" +OPENSTACK_PUBLIC_NET_ID: "__public_net_id__" +OPENSTACK_PUBLIC_NET_NAME: "__public_net_name__" +OPENSTACK_OAM_NETWORK_CIDR: "__oam_network_cidr__" +OPENSTACK_TENANT_NAME: "__openstack_tenant_name__" +OPENSTACK_TENANT_ID: "__openstack_tenant_id__" +OPENSTACK_USERNAME: "__openstack_username__" +OPENSTACK_API_KEY: "__openstack_api_key__" +OPENSTACK_KEYSTONE_URL: "__keystone_url__" +DCAE_IP_ADDR: "__dcae_ip_addr__" +DCAE_KEYSTONE_URL: "__keystone_url__/v2.0" +DNS_LIST: "__dns_list__" +DNS_FORWARDER: "__dns_forwarder__" +EXTERNAL_DNS: "8.8.8.8" +DNSAAS_REGION: "RegionOne" +DNSAAS_KEYSTONE_URL: "__keystone_url__/v2.0" +DNSAAS_TENANT_NAME: "__openstack_tenant_name__" +DNSAAS_USERNAME: "__openstack_username__" +DNSAAS_PASSWORD: "__openstack_api_key__" + +EOF +cat ~/oom/kubernetes/config/onap-parameters.yaml + + +# wait for kubernetes to initialze +sleep 100 +until [ $(kubectl get pods --namespace kube-system | tail -n +2 | grep -c Running) -ge 6 ]; do + sleep 10 +done + +# Source the environment file: +cd ~/oom/kubernetes/oneclick/ +source setenv.bash + +# run the config pod creation +cd ~/oom/kubernetes/config +./createConfig.sh -n onap + +# Wait until the config container completes. +sleep 200 +until [ $(kubectl get pods --namespace onap -a | tail -n +2 | grep -c Completed) -eq 1 ]; do + sleep 10 +done + +# version control the config to see what's happening +cd /dockerdata-nfs/ +git init +git config user.email "root@k8s" +git config user.name "root" +git add -A +git commit -m "initial commit" + +# Run ONAP: +cd ~/oom/kubernetes/oneclick/ +./createAll.bash -n onap + +# Check ONAP status: +sleep 3 +kubectl get pods --all-namespaces diff --git a/test/ete/labs/huawei/onap-ci-amsterdam-heat-openrc b/test/ete/labs/huawei/onap-ci-amsterdam-heat-openrc new file mode 100644 index 000000000..5acb86759 --- /dev/null +++ b/test/ete/labs/huawei/onap-ci-amsterdam-heat-openrc @@ -0,0 +1,9 @@ +export OS_PROJECT_DOMAIN_NAME=Default +export OS_USER_DOMAIN_NAME=Default +export OS_PROJECT_ID=3d228d2fcbb7447bbba3cde703431bc1 +export OS_PROJECT_NAME=onap-ci-amsterdam-heat +export OS_USERNAME=demo +export OS_PASSWORD=demo +export OS_AUTH_URL=http://controller.neo.futurewei.com:5000/v3 +export OS_IDENTITY_API_VERSION=3 +export OS_IMAGE_API_VERSION=2 diff --git a/test/ete/labs/huawei/onap-oom.env b/test/ete/labs/huawei/onap-oom.env new file mode 100644 index 000000000..423480fef --- /dev/null +++ b/test/ete/labs/huawei/onap-oom.env @@ -0,0 +1,21 @@ +parameters: + + ############################################## + # # + # Parameters used across all ONAP components # + # # + ############################################## + + public_net_id: 3a6247f1-fac6-4167-a49f-33cc8415ccf4 + docker_proxy: 10.145.122.118:5000 + apt_proxy: 10.145.122.118:3142 + dns_list: ["10.145.122.117", "10.145.122.118"] + oam_network_cidr: 172.16.0.0/16 + ubuntu_1404_image: trusty + openstack_tenant_id: 3d228d2fcbb7447bbba3cde703431bc1 + openstack_tenant_name: onap-ci-amsterdam-heat + openstack_username: demo + openstack_api_key: demo + keystone_url: http://10.145.122.117:5000 + rancher_vm_flavor: m1.small + k8s_vm_flavor: m1.xxlarge diff --git a/test/ete/labs/huawei/onap-oom.yaml b/test/ete/labs/huawei/onap-oom.yaml new file mode 100644 index 000000000..5db534471 --- /dev/null +++ b/test/ete/labs/huawei/onap-oom.yaml @@ -0,0 +1,130 @@ +heat_template_version: 2015-10-15 +description: ONAP on Kubernetes using OOM + +parameters: + docker_proxy: + type: string + + apt_proxy: + type: string + + public_net_id: + type: string + description: The ID of the Public network for floating IP address allocation + + public_net_name: + type: string + description: The name of the Public network referred by public_net_id + + dns_list: + type: comma_delimited_list + description: List of External DNS for OAM ONAP network + + oam_network_cidr: + type: string + description: CIDR of the OAM ONAP network + + keystone_url: + type: string + description: URL of OpenStack Keystone + + openstack_tenant_id: + type: string + description: OpenStack tenant ID + + openstack_tenant_name: + type: string + description: OpenStack tenant name (matching with the openstack_tenant_id) + + openstack_username: + type: string + description: OpenStack username + + openstack_api_key: + type: string + description: OpenStack password or API Key + + ubuntu_1404_image: + type: string + description: Name of the Ubuntu 14.04 image + + ubuntu_1604_image: + type: string + description: Name of the Ubuntu 16.04 image + + centos_7_image: + type: string + description: the id/name of the CentOS 7 VM imange + + rancher_vm_flavor: + type: string + description: Name of the Ubuntu 14.04 image + + k8s_vm_flavor: + type: string + description: Name of the Ubuntu 14.04 image + + dcae_ip_addr: + type: string + + dns_forwarder: + type: string + description: the forwarder address for setting up ONAP's private DNS server + + +resources: + random-str: + type: OS::Heat::RandomString + properties: + length: 4 + + rancher_vm: + type: OS::Nova::Server + properties: + name: rancher + image: xenial + flavor: { get_param: rancher_vm_flavor } + key_name: onap_key + networks: + - network: { get_param: public_net_id } + user_data_format: RAW + user_data: + str_replace: + params: + __docker_proxy__: { get_param: docker_proxy } + __apt_proxy__: { get_param: apt_proxy } + template: + get_file: rancher_vm_entrypoint.sh + + k8s_vm: + type: OS::Nova::Server + properties: + name: k8s + image: xenial + flavor: { get_param: k8s_vm_flavor } + key_name: onap_key + networks: + - network: { get_param: public_net_id } + user_data_format: RAW + user_data: + str_replace: + params: + __docker_proxy__: { get_param: docker_proxy } + __apt_proxy__: { get_param: apt_proxy } + __rancher_ip_addr__: { get_attr: [rancher_vm, first_address] } + __openstack_tenant_id__: { get_param: openstack_tenant_id } + __openstack_tenant_name__: { get_param: openstack_tenant_name } + __openstack_username__: { get_param: openstack_username } + __openstack_api_key__: { get_param : openstack_api_key } + __public_net_id__: { get_param: public_net_id } + __public_net_name__: { get_param: public_net_name } + __oam_network_cidr__: { get_param: oam_network_cidr } + __ubuntu_1404_image__: { get_param: ubuntu_1404_image } + __ubuntu_1604_image__: { get_param: ubuntu_1604_image } + __centos_7_image__: { get_param: centos_7_image } + __keystone_url__: { get_param: keystone_url } + __dcae_ip_addr__: { get_param: dcae_ip_addr } + __dns_list__: { get_param: [dns_list, 0] } + __dns_forwarder__: { get_param: dns_forwarder } + template: + get_file: k8s_vm_entrypoint.sh diff --git a/test/ete/labs/huawei/onap-openstack-template.env b/test/ete/labs/huawei/onap-openstack-template.env new file mode 100644 index 000000000..bffbd2df2 --- /dev/null +++ b/test/ete/labs/huawei/onap-openstack-template.env @@ -0,0 +1,142 @@ +parameters: + + ############################################## + # # + # Parameters used across all ONAP components # + # # + ############################################## + + public_net_id: 3a6247f1-fac6-4167-a49f-33cc8415ccf4 + + public_net_name: provider + + ubuntu_1404_image: trusty + + ubuntu_1604_image: xenial + + flavor_small: m1.small + + flavor_medium: m1.medium + + flavor_large: m1.large + + flavor_xlarge: m1.xlarge + + flavor_xxlarge: m1.2xlarge + + vm_base_name: onap + + key_name: onap_key + + pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ38Q8CBflhkh + + nexus_repo: https://nexus.onap.org/content/sites/raw + + nexus_docker_repo: 10.145.122.118:5000 + + nexus_username: anonymous + + nexus_password: anonymous + + dmaap_topic: AUTO + + artifacts_version: 1.1.1 + + openstack_tenant_id: ${OS_PROJECT_ID} + + openstack_tenant_name: ${OS_PROJECT_NAME} + + openstack_username: ${OS_USERNAME} + + openstack_api_key: ${OS_PASSWORD} + + openstack_auth_method: password + + openstack_region: RegionOne + + horizon_url: http://10.145.122.117/horizon + + keystone_url: http://10.145.122.117:5000 + + cloud_env: RegionOne + + + ###################### + # # + # Network parameters # + # # + ###################### + + dns_list: ["10.145.122.117", "10.145.122.118"] + external_dns: 10.145.122.118 + dns_forwarder: 10.145.122.117 + oam_network_cidr: 172.16.0.0/16 + + ### Private IP addresses ### + + aai1_ip_addr: 172.16.1.1 + aai2_ip_addr: 172.16.1.2 + appc_ip_addr: 172.16.2.1 + dcae_ip_addr: 172.16.4.1 + dns_ip_addr: 172.16.100.1 + so_ip_addr: 172.16.5.1 + mr_ip_addr: 172.16.11.1 + policy_ip_addr: 172.16.6.1 + portal_ip_addr: 172.16.9.1 + robot_ip_addr: 172.16.10.1 + sdc_ip_addr: 172.16.3.1 + sdnc_ip_addr: 172.16.7.1 + vid_ip_addr: 172.16.8.1 + clamp_ip_addr: 172.16.12.1 + openo_ip_addr: 172.16.14.1 + + ########################### + # # + # Parameters used by DCAE # + # # + ########################### + + dnsaas_config_enabled: false + dnsaas_region: RegionOne + dnsaas_keystone_url: http://10.145.122.117:5000/v3 + dnsaas_tenant_name: ${OS_PROJECT_NAME} + dnsaas_username: ${OS_USERNAME} + dnsaas_password: ${OS_PASSWORD} + dcae_keystone_url: http://10.145.122.117:5000/v2.0 + dcae_centos_7_image: centos7 + dcae_domain: dcaeg2.onap.org + dcae_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ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85j3ot5Yzcr+EcBVcua+7KHU0Sgn44JNH8DisJ7\n +Y63UP/1Xb4d1/QvHfxYy3WOvvRdVZ7pPo8JNX95jAoGAIe5CIg8/JizUZa7KeKUh\n +9pgDleQPkQsrHQ6/AyIwFBsLwf9THSS5V+uV9D57SfUs46Bf2U8J6N90YQSlt8iS\n +aWuManFPVgT+yxDIzt6obf2mCEpOIBtQ6N4ZRh2HhQwdWTCrkzkDdGQaHG+jYL6C\n +xGPwiG2ON7OAfGIAM7eN5lECgYEAhoRLWlaOgRGnHKAWsYQvZ67CjTdDcPPuVu6v\n +fMQnNMA/7JeTwV+E205L0wfpgZ/cZKmBBlQMJlnUA3q2wfO+PTnse1mjDJU/cGtB\n +22/lJLxChlQdxGeQhGtGzUhF+hEeOhrO6WSSx7CtMRZoy6Dr6lwfMFZCdVNcBd6v\n +YOOZk3ECgYEAseUKGb6E80XTVVNziyuiVbQCsI0ZJuRfqMZ2IIDQJU9u6AnGAway\n +itqHbkGsmDT+4HUz01+1JKnnw42RdSrHdU/LaOonD+RIGqe2x800QXzqASKLdCXr\n +y7RoiFqJtkdFQykzJemA+xOXvHLgKi/MXFsU90PCD0VJKLj8vwpX78Y=\n +-----END RSA PRIVATE KEY-----' + + ################################ + # # + # Docker versions and branches # + # Rest of the file will be autogenerated from demo repo + # # + ################################ diff --git a/test/ete/labs/huawei/rancher_vm_entrypoint.sh b/test/ete/labs/huawei/rancher_vm_entrypoint.sh new file mode 100644 index 000000000..da1955446 --- /dev/null +++ b/test/ete/labs/huawei/rancher_vm_entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash -x +printenv + +echo `hostname -I` `hostname` >> /etc/hosts +mkdir -p /etc/docker +cat > /etc/docker/daemon.json <<EOF +{ + "insecure-registries" : ["__docker_proxy__"] +} +EOF +cat > /etc/apt/apt.conf.d/30proxy<<EOF +Acquire::http { Proxy "http://__apt_proxy__"; }; +Acquire::https::Proxy "DIRECT"; +EOF +apt-get -y update +apt-get -y install docker.io +usermod -aG docker ubuntu +docker run --restart unless-stopped -d -p 8080:8080 rancher/server:v1.6.10 diff --git a/test/ete/labs/windriver/Integration-Jenkins-openrc.sh b/test/ete/labs/windriver/Integration-Jenkins-openrc.sh index ef2aa9a25..ca2e2c2cf 100644 --- a/test/ete/labs/windriver/Integration-Jenkins-openrc.sh +++ b/test/ete/labs/windriver/Integration-Jenkins-openrc.sh @@ -15,7 +15,7 @@ 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=09d8566ea45e43aa974cf447ed591d77 +export OS_PROJECT_ID="09d8566ea45e43aa974cf447ed591d77" export OS_PROJECT_NAME="Integration-Jenkins" export OS_USER_DOMAIN_NAME="Default" if [ -z "$OS_USER_DOMAIN_NAME" ]; then unset OS_USER_DOMAIN_NAME; fi @@ -26,7 +26,10 @@ 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" +if [ -z ${OS_USERNAME_INPUT+x} ]; then + read -sp "Please enter your OpenStack Username for project $OS_PROJECT_NAME: " OS_USERNAME_INPUT +fi +export OS_USERNAME=$OS_USERNAME_INPUT # With Keystone you pass the keystone password. if [ -z ${OS_PASSWORD_INPUT+x} ]; then diff --git a/test/ete/labs/windriver/Integration-SB-04-openrc.sh b/test/ete/labs/windriver/Integration-SB-04-openrc.sh new file mode 100644 index 000000000..e7cee93b9 --- /dev/null +++ b/test/ete/labs/windriver/Integration-SB-04-openrc.sh @@ -0,0 +1,49 @@ +#!/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="d570c718cbc545029f40e50b75eb13df" +export OS_PROJECT_NAME="Integration-SB-04" +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**. +# In addition to the owning entity (tenant), OpenStack stores the entity +# performing the action as the **user**. +if [ -z ${OS_USERNAME_INPUT+x} ]; then + read -sp "Please enter your OpenStack Username for project $OS_PROJECT_NAME: " OS_USERNAME_INPUT +fi +export OS_USERNAME=$OS_USERNAME_INPUT + +# With Keystone you pass the keystone password. +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. +# 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/apt-proxy.sh b/test/ete/labs/windriver/apt-proxy.sh new file mode 100755 index 000000000..f8bb32ff0 --- /dev/null +++ b/test/ete/labs/windriver/apt-proxy.sh @@ -0,0 +1,16 @@ +#!/bin/bash +sed -i '/#!\/bin\/bash/a\ + mkdir -p /etc/docker\ + cat > /etc/docker/daemon.json <<EOF\ + {\ + "insecure-registries" : ["10.12.5.80:5000"]\ + }\ + EOF\ + cat > /etc/apt/apt.conf.d/30proxy<<EOF\ + Acquire::http { Proxy "http://10.12.5.80:3142"; };\ + Acquire::https::Proxy "DIRECT";\ + EOF\ + apt-get -y update' $1 + +# don't use insecure docker proxy in dcae +perl -i -0pe 's/(?<=dcae_c_vm:)(.*?)\{ get_param: nexus_docker_repo \}/$1"nexus3.onap.org:10001"/s' $1 diff --git a/test/ete/labs/windriver/onap-openstack-template.env b/test/ete/labs/windriver/onap-openstack-template.env index b1b31ee88..1992a42ed 100644 --- a/test/ete/labs/windriver/onap-openstack-template.env +++ b/test/ete/labs/windriver/onap-openstack-template.env @@ -32,15 +32,15 @@ parameters: nexus_repo: https://nexus.onap.org/content/sites/raw - nexus_docker_repo: nexus3.onap.org:10001 + nexus_docker_repo: 10.12.5.80:5000 - nexus_username: docker + nexus_username: anonymous - nexus_password: docker + nexus_password: anonymous dmaap_topic: AUTO - artifacts_version: 1.1.0-SNAPSHOT + artifacts_version: 1.2.0-SNAPSHOT openstack_tenant_id: ${OS_PROJECT_ID} @@ -69,6 +69,7 @@ parameters: dns_list: ["10.12.25.5", "8.8.8.8"] external_dns: 8.8.8.8 + dns_forwarder: 10.12.25.5 oam_network_cidr: 10.0.0.0/16 ### Private IP addresses ### @@ -77,11 +78,6 @@ parameters: aai2_ip_addr: 10.0.1.2 appc_ip_addr: 10.0.2.1 dcae_ip_addr: 10.0.4.1 - dcae_coll_ip_addr: 10.0.4.102 - dcae_db_ip_addr: 10.0.4.101 - dcae_hdp1_ip_addr: 10.0.4.103 - dcae_hdp2_ip_addr: 10.0.4.104 - dcae_hdp3_ip_addr: 10.0.4.105 dns_ip_addr: 10.0.100.1 so_ip_addr: 10.0.5.1 mr_ip_addr: 10.0.11.1 @@ -94,32 +90,12 @@ parameters: clamp_ip_addr: 10.0.12.1 openo_ip_addr: 10.0.14.1 -# 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 - ########################### # # # Parameters used by DCAE # # # ########################### -# dcae_base_environment: 1-NIC-FLOATING-IPS - -# dcae_zone: ZONE - -# dcae_state: STATE - -# nexus_repo_root: https://nexus.onap.org - -# nexus_url_snapshot: https://nexus.onap.org/content/repositories/snapshots - -# gitlab_branch: master - -# dcae_code_version: 1.1.0 - dnsaas_config_enabled: true dnsaas_region: RegionOne dnsaas_keystone_url: http://10.12.25.5:5000/v3 @@ -128,92 +104,39 @@ parameters: dnsaas_password: ${OS_PASSWORD} dcae_keystone_url: "http://10.0.14.1/api/multicloud-titanium_cloud/v0/pod25_RegionOne/identity/v2.0" dcae_centos_7_image: CentOS-7 - dcae_security_group: default - dcae_key_name: 'id_lji_onap' - dcae_public_key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDloKgBHx/yKRV77lr828rqa+zK+iTZpqmH3WSUU3vdNhSbEMNKkGVXR4+Gq1hNd8UNF+jMg87kOFSlQbE5jvsQMWuu1unxLKbH3AeXJd21gR1Gx4KXjkWsfl4URWMZ9WNvH0hMvqEV5SdFIDQmx07C/NOfy3R5N1pCgNsh9RT+EpDFh7jmimxrAqdxP0HnGFC2oM3rYMnzfh2/+Obkag6O3RZOkYx/WLQKbOKTi8K1C4UM5pwFzLT/vC+d9DF8pE7P9dlrbHTF9c3IGsP5oCa8CQ/WE4lVj/L9/iFNs0WsxdYaOnf11GJmPs663hltvWbQiqsFpdjX6tk/zMb3Xipz ubuntu@lusheng-sm-b781d54e-48ac-42fa-a780-3289b56e6598' - dcae_private_key: '-----BEGIN RSA PRIVATE KEY-----\n -MIIEowIBAAKCAQEA5aCoAR8f8ikVe+5a/NvK6mvsyvok2aaph91klFN73TYUmxDD\n -SpBlV0ePhqtYTXfFDRfozIPO5DhUpUGxOY77EDFrrtbp8Symx9wHlyXdtYEdRseC\n -l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PplPCSVtemCyRQQX8n5Z2m8FznzeQ86HS+AhueWbCXEl0aabH/5NfjG\n -lIyC4uvL22aBwyvuYQqE7QKBgE6zKREBbqmQT3EbZqIyLCChJLEmkOPWYpnyIAA/\n -p7LK4qygIS/2dyFyCS+iZXyOyBQaBesnxauobFsvDBnqa0AUYAKj9ofGtS5k5moo\n -XQS8yAqnKibnvonDYWRECmjlE7Wv6XvpOp0m5uBjFBPkBkXwjFQ8bXiH42FPoOZE\n -acMVAoGBAJk4+VGPw1Z7NZbJiDRtdCOY1SZBqWXf1Mth6H8JFUGPLyTfFq1cGpN8\n -+Odna/7rl4jCiiWrCJyob4F4DF0AE1t3lEa1XgWwDIdagnldH9e5z/psR3I/p1wv\n -m3bZLBvlAVvCajosd/qeX0FkPGZlgk1dGZ8/7SyK7NITqAfgMMRS\n + dcae_domain: dcaeg2.onap.org + dcae_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ38Q8CBflhkh + dcae_private_key: '-----BEGIN RSA PRIVATE KEY-----\n +MIIEpQIBAAKCAQEAylw4KKN/ljqnFBvP+blG5PNfsnM4MAuGPMsE5rkKmzcZWNaE\n +NGMXTFKlJ4YrUl7OUv8kbgFTmB8BoNpgrNtKACDaz/psQSOeOADCG/YrT4wrYKrR\n +NhFqOjJpxRmxweEsd14qBOxeFT7Ie42qbCMMzo260HvjLmtUxk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zkDdGQaHG+jYL6C\n +xGPwiG2ON7OAfGIAM7eN5lECgYEAhoRLWlaOgRGnHKAWsYQvZ67CjTdDcPPuVu6v\n +fMQnNMA/7JeTwV+E205L0wfpgZ/cZKmBBlQMJlnUA3q2wfO+PTnse1mjDJU/cGtB\n +22/lJLxChlQdxGeQhGtGzUhF+hEeOhrO6WSSx7CtMRZoy6Dr6lwfMFZCdVNcBd6v\n +YOOZk3ECgYEAseUKGb6E80XTVVNziyuiVbQCsI0ZJuRfqMZ2IIDQJU9u6AnGAway\n +itqHbkGsmDT+4HUz01+1JKnnw42RdSrHdU/LaOonD+RIGqe2x800QXzqASKLdCXr\n +y7RoiFqJtkdFQykzJemA+xOXvHLgKi/MXFsU90PCD0VJKLj8vwpX78Y=\n -----END RSA PRIVATE KEY-----' ################################ # # # Docker versions and branches # + # Rest of the file will be autogenerated from demo repo # # ################################ - - aai_branch: master - appc_branch: master - so_branch: master - mr_branch: master - dcae_branch: master - policy_branch: master - portal_branch: release-1.3.0 - robot_branch: master - sdc_branch: master - sdnc_branch: master - vid_branch: master - clamp_branch: master - vnfsdk_branch: master - - aai_docker: 1.1-STAGING-latest - appc_docker: 1.1-STAGING-latest - so_docker: 1.1-STAGING-latest - mr_docker: 1.1-STAGING-latest - dcae_docker: 1.1-latest - policy_docker: 1.1-STAGING-latest - portal_docker: 1.3-STAGING-latest - robot_docker: 1.1-STAGING-latest - sdc_docker: 1.1-STAGING-latest - sdnc_docker: 1.2-STAGING-latest - vid_docker: 1.1-STAGING-latest - clamp_docker: 1.1-STAGING-latest - msb_docker: latest - mvim_docker: latest - vfc_docker: latest - uui_docker: latest - esr_docker: latest - dgbuilder_docker: 0.1-STAGING-latest - cli_docker: 1.1-STAGING-latest - - ##################### - # # - # ONAP repositories # - # # - ##################### - aai_repo: http://gerrit.onap.org/r/aai/test-config - appc_repo: http://gerrit.onap.org/r/appc/deployment.git - dcae_repo: http://gerrit.onap.org/r/dcae/demo/startup/controller.git - mr_repo: http://gerrit.onap.org/r/dcae/demo/startup/message-router.git - so_repo: http://gerrit.onap.org/r/so/docker-config.git - policy_repo: http://gerrit.onap.org/r/policy/docker.git - portal_repo: http://gerrit.onap.org/r/portal.git - robot_repo: http://gerrit.onap.org/r/testsuite/properties.git - sdc_repo: http://gerrit.onap.org/r/sdc.git - sdnc_repo: http://gerrit.onap.org/r/sdnc/oam.git - vid_repo: http://gerrit.onap.org/r/vid.git - clamp_repo: http://gerrit.onap.org/r/clamp.git - vnfsdk_repo: http://gerrit.onap.org/r/vnfsdk/refrepo.git diff --git a/test/ete/scripts/deploy-onap.sh b/test/ete/scripts/deploy-onap.sh index 69296ab17..68ca34830 100755 --- a/test/ete/scripts/deploy-onap.sh +++ b/test/ete/scripts/deploy-onap.sh @@ -1,26 +1,91 @@ -#!/bin/bash +#!/bin/bash -x + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 <lab-name>" + exit 1 +fi if [ -z "$WORKSPACE" ]; then export WORKSPACE=`git rev-parse --show-toplevel` fi +LAB_DIR=${WORKSPACE}/test/ete/labs/$1 + +if [ ! -d "$LAB_DIR" ]; then + echo "Directory $LAB_DIR not found" + exit 2 +fi + source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh -# Delete all existing stacks -STACKS=$(openstack stack list -c "Stack Name" -f value) -if [ ! -z "${STACKS}" ]; then - echo "Deleting Stacks ${STACKS}" - openstack stack delete -y $STACKS -else - echo "No existing stacks to delete." + +SENTINEL='Docker versions and branches' + +mkdir -p ${LAB_DIR}/target +YAML_FILE=${LAB_DIR}/target/onap_openstack.yaml +ENV_FILE=${LAB_DIR}/target/onap_openstack.env +YAML_SRC=${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.yaml +ENV_SRC=${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.env + +# copy heat template to WORKSPACE +cp ${YAML_SRC} ${YAML_FILE} + +# generate final env file +pushd ${ONAP_WORKDIR}/demo +envsubst < ${LAB_DIR}/onap-openstack-template.env | sed -n "1,/${SENTINEL}/p" > ${ENV_FILE} +echo " # Rest of the file was AUTO-GENERATED from" | tee -a ${ENV_FILE} +echo " #" $(git config --get remote.origin.url) heat/ONAP/onap_openstack.env $(git rev-parse HEAD) | tee -a ${ENV_FILE} +popd +sed "1,/${SENTINEL}/d" ${ENV_SRC} >> ${ENV_FILE} +cat ${ENV_FILE} + +sdiff -w 180 ${ENV_SRC} ${ENV_FILE} + +# generate final heat template +# add apt proxy to heat template if applicable +if [ -x $LAB_DIR/apt-proxy.sh ]; then + $LAB_DIR/apt-proxy.sh ${YAML_FILE} + sdiff -w 180 ${YAML_SRC} ${YAML_FILE} fi + +#exit 0 + +#diff ${LAB_DIR}/onap-openstack-template.env ${LAB_DIR}/onap-openstack.env + + +# tear down old deployment +$WORKSPACE/test/ete/scripts/teardown-onap.sh + +# create new stack STACK="ete-$(uuidgen | cut -c-8)" echo "New Stack Name: ${STACK}" +openstack stack create -t ${YAML_FILE} -e ${ENV_FILE} $STACK + +while [ "CREATE_IN_PROGRESS" == "$(openstack stack show -c stack_status -f value $STACK)" ]; do + sleep 20 +done +STATUS=$(openstack stack show -c stack_status -f value $STACK) +echo $STATUS +if [ "CREATE_COMPLETE" != "$STATUS" ]; then + exit 1 +fi + + +# wait until Robot VM initializes +ROBOT_IP=$($WORKSPACE/test/ete/scripts/get-floating-ip.sh onap-robot) +echo "ROBOT_IP=${ROBOT_IP}" + +if [ "" == "${ROBOT_IP}" ]; then + exit 1 +fi -cp ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.env ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-demo.env -envsubst < ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-template.env > ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env +ssh-keygen -R ${ROBOT_IP} -openstack stack create -t ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.yaml -e ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env $STACK +SSH_KEY=~/.ssh/onap_key +until ssh -o StrictHostKeychecking=no -i ${SSH_KEY} ubuntu@${ROBOT_IP} "sudo docker ps" | grep openecompete_container +do + sleep 2m +done diff --git a/test/ete/scripts/dns-zones/delete-dns-zones.sh b/test/ete/scripts/dns-zones/delete-dns-zones.sh new file mode 100755 index 000000000..54cafecd8 --- /dev/null +++ b/test/ete/scripts/dns-zones/delete-dns-zones.sh @@ -0,0 +1,27 @@ +#!/bin/bash -x + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 <project-name>" + exit 1 +fi + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi + +MULTICLOUD_IP=$($WORKSPACE/test/ete/scripts/get-floating-ip.sh onap-multi-service) + +export MULTICLOUD_PLUGIN_ENDPOINT=http://$MULTICLOUD_IP:9005/api/multicloud-titanium_cloud/v0/pod25_RegionOne + +export TOKEN=$(curl -v -s -H "Content-Type: application/json" -X POST -d '{"auth": {"identity": {"methods": ["password"],"password": {"user": {"name": "'$OS_USERNAME'","password": "'$OS_PASSWORD'"}}},"scope": {"project":{"domain":{"name":"Default"},"name": "'$1'" } }}}' $MULTICLOUD_PLUGIN_ENDPOINT/identity/v3/auth/tokens 2>&1 | grep X-Subject-Token | sed "s/^.*: //") + + +ZONES=$(curl -v -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET $MULTICLOUD_PLUGIN_ENDPOINT/dns-delegate/v2/zones | jq '.["zones"][] | .name' | tr -d '"' ) + +echo $ZONES + +for ZONENAME in $ZONES; do + echo $ZONENAME; + export ZONEID=$(curl -v -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET $MULTICLOUD_PLUGIN_ENDPOINT/dns-delegate/v2/zones?name=$ZONENAME |sed 's/^.*"id":"\([a-zA-Z0-9-]*\)",.*$/\1/') + curl -v -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X DELETE $MULTICLOUD_PLUGIN_ENDPOINT/dns-delegate/v2/zones/$ZONEID +done diff --git a/test/ete/scripts/get-floating-ip.sh b/test/ete/scripts/get-floating-ip.sh index 55854e73f..196f6d244 100755 --- a/test/ete/scripts/get-floating-ip.sh +++ b/test/ete/scripts/get-floating-ip.sh @@ -1,6 +1,3 @@ -#!/bin/sh +#!/bin/bash # Get floating IP assigned to a server name - -PORT_ID=$(openstack server show -f json $1 | python -c 'import sys, json; print json.load(sys.stdin)["wrs-if:nics"][0]["nic1"]["port_id"]') -FLOATING_IP=$(openstack floating ip list -f json --port $PORT_ID | python -c 'import sys, json; print json.load(sys.stdin)[0]["Floating IP Address"]') -echo $FLOATING_IP +openstack server show -c addresses -f json $1 | jq -r '.addresses' | tr -d ' ' | cut -d ',' -f 2 diff --git a/test/ete/scripts/install_openstack_cli.sh b/test/ete/scripts/install_openstack_cli.sh index ec5ad1f76..8f1529606 100755 --- a/test/ete/scripts/install_openstack_cli.sh +++ b/test/ete/scripts/install_openstack_cli.sh @@ -26,7 +26,7 @@ else source ${ONAP_VENV}/bin/activate pip install --upgrade pip - pip install --upgrade python-openstackclient python-heatclient + pip install openstacksdk==0.9.19 python-openstackclient python-heatclient python-designateclient echo "ONAP_VENV=${ONAP_VENV}" >> $WORKSPACE/env.properties fi @@ -38,7 +38,7 @@ if [ -z "$ONAP_WORKDIR" ]; then fi echo "ONAP_WORKDIR=${ONAP_WORKDIR}" if [ ! -d ${ONAP_WORKDIR}/demo ]; then - git clone http://gerrit.onap.org/r/demo ${ONAP_WORKDIR}/demo + git clone https://gerrit.onap.org/r/demo ${ONAP_WORKDIR}/demo else pushd ${ONAP_WORKDIR}/demo git pull diff --git a/test/ete/scripts/post-jenkins-results.sh b/test/ete/scripts/post-jenkins-results.sh new file mode 100755 index 000000000..8e01e6cde --- /dev/null +++ b/test/ete/scripts/post-jenkins-results.sh @@ -0,0 +1,6 @@ +#!/bin/bash -x + +CRUMB=$(curl -s -u "lf:lf" 'http://12.234.32.117/jenkins/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)') + +curl -v -u "lf:eea50a6d845752e1d2fa459a3c0ca25e" -H "$CRUMB" -d '<run><log encoding="hexBinary">4142430A</log><result>0</result><duration>17</duration></run>' http://12.234.32.117/jenkins/job/external-job/postBuildResult + diff --git a/test/ete/scripts/pull-docker-images.sh b/test/ete/scripts/pull-docker-images.sh new file mode 100755 index 000000000..e14ee8349 --- /dev/null +++ b/test/ete/scripts/pull-docker-images.sh @@ -0,0 +1,22 @@ +#!/bin/bash -x + +# this script will pull all the docker images listed in the manifest +# specify a parameter to override the default proxy of nexus3.onap.org:100001 + +if [ "$#" -ne 1 ]; then + PROXY=nexus3.onap.org:10001 +else + PROXY=$1 +fi + + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi + +MANIFEST=${WORKSPACE}/version-manifest/src/main/resources/docker-manifest.csv +IMAGES=$(tail -n +2 $MANIFEST | tr ',' ':') + +for image in $IMAGES; do + docker pull ${PROXY}/${image} +done diff --git a/test/ete/scripts/remote/run-robot.sh b/test/ete/scripts/remote/run-robot.sh index ff7223a17..162acbe24 100755 --- a/test/ete/scripts/remote/run-robot.sh +++ b/test/ete/scripts/remote/run-robot.sh @@ -1,18 +1,20 @@ -#!/bin/bash +#!/bin/bash -x cd /opt -if [ ! -x /opt/demo.sh ]; then - echo "Robot VM not initialized" +docker ps | grep -q openecompete_container +if [ ! $? -eq 0 ]; then + echo "Robot 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 + echo $OS_PROJECT_ID > /opt/config/openstack_tenant_id.txt + echo $OS_USERNAME > /opt/config/openstack_username.txt + echo $OS_PASSWORD > /opt/config/openstack_password.txt /bin/bash /opt/eteshare/config/vm_config2robot.sh - echo "test" | /opt/demo.sh init_robot + # set robot VM http server password + echo "admin" | /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 index 1555dad85..2f0f014d3 100755 --- a/test/ete/scripts/run-healthcheck.sh +++ b/test/ete/scripts/run-healthcheck.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x SSH_KEY=~/.ssh/onap_key @@ -13,10 +13,14 @@ cd $WORKSPACE/test/ete/scripts ROBOT_IP=$(./get-floating-ip.sh onap-robot) echo "ROBOT_IP=${ROBOT_IP}" -# allow direct login as root -ssh -o StrictHostKeychecking=no -i ${SSH_KEY} ubuntu@${ROBOT_IP} 'sudo cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/' +if [ "" == "${ROBOT_IP}" ]; then + exit 1 +fi + +ssh-keygen -R ${ROBOT_IP} + +ssh -o StrictHostKeychecking=no -i ${SSH_KEY} root@${ROBOT_IP} "OS_PROJECT_ID=$OS_PROJECT_ID OS_USERNAME=$OS_USERNAME OS_PASSWORD=$OS_PASSWORD bash -s" < ./remote/run-robot.sh -ssh -o StrictHostKeychecking=no -i ${SSH_KEY} root@${ROBOT_IP} "OS_PASSWORD_INPUT=$OS_PASSWORD_INPUT bash -s" < ./remote/run-robot.sh LOG_DIR=$(ssh -o StrictHostKeychecking=no -i ${SSH_KEY} root@${ROBOT_IP} "ls -1t /opt/eteshare/logs | head -1") echo "Browse Robot results at http://${ROBOT_IP}:88/logs/${LOG_DIR}/" rsync -e "ssh -i ${SSH_KEY}" -avPz root@${ROBOT_IP}:/opt/eteshare/logs/${LOG_DIR}/ $WORKSPACE/archives/ diff --git a/test/ete/scripts/teardown-onap.sh b/test/ete/scripts/teardown-onap.sh new file mode 100755 index 000000000..eecef876b --- /dev/null +++ b/test/ete/scripts/teardown-onap.sh @@ -0,0 +1,54 @@ +#!/bin/bash -x + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi + +source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh + +# delete all Designate DNS records; do this first since we rely on multi-vim for this +$WORKSPACE/test/ete/scripts/dns-zones/delete-dns-zones.sh $OS_PROJECT_NAME +sleep 1 + +# delete all instances +openstack server delete $(openstack server list -c ID -f value) +sleep 1 + +# miscellaneous cleanup +openstack floating ip delete $(openstack floating ip list -c ID -f value) +sleep 1 + +ROUTERS=$(openstack router list -c ID -f value) +echo $ROUTERS +for ROUTER in $ROUTERS; do + echo $ZONENAME; + PORTS=$(openstack router show $ROUTER -c "interfaces_info" -f "value" | jq -r '.[].port_id') + for PORT in $PORTS; do + openstack router remove port $ROUTER $PORT + done + openstack router delete $ROUTER +done + +openstack port delete $(openstack port list -f value -c ID) +openstack volume delete $(openstack volume list -f value -c ID) + +# delete all except "default" security group +SECURITY_GROUPS=$(openstack security group list -c Name -f value | grep -v default) +openstack security group delete $SECURITY_GROUPS +sleep 1 + + +# Delete all existing stacks +STACKS=$(openstack stack list -c "Stack Name" -f value) + +if [ ! -z "${STACKS}" ]; then + echo "Deleting Stacks ${STACKS}" + openstack stack delete -y $STACKS + for STACK in ${STACKS}; do + until [ "DELETE_IN_PROGRESS" != "$(openstack stack show -c stack_status -f value $STACK)" ]; do + sleep 2 + done + done +else + echo "No existing stacks to delete." +fi |