summaryrefslogtreecommitdiffstats
path: root/tests/blueprints/tosca-vnfd-hello-ves/blueprint.yaml
diff options
context:
space:
mode:
authorbryan <bryan.sullivan@att.com>2017-03-05 10:12:18 -0800
committerbryan <bryan.sullivan@att.com>2017-03-06 06:25:04 -0800
commitc5fe902ac6e773ec7232ccca67a64856e1b508d0 (patch)
tree46819cf086340b2534df3e7fd1d326f8c2e90f14 /tests/blueprints/tosca-vnfd-hello-ves/blueprint.yaml
parentef6609a879de38fa825645b949bf3a4f82f75348 (diff)
Update for Danube (work in progress)
JIRA: VES-1 Removed preliminary versions of tests for now. Aligned with the Models vHello_3Node_Tacker test. Separated out actions for collectd and monitor install and run them directly vs thru the container. Added parameters as needed for the new design. Updated with typical overview of the test/demo flow. Add port 30000 ingress to vHello security group. Remove juju workaround for port_security. Remote use of id_rsa (replaced with notes on ssh assumptions). Use VDU3 (LB) in traffic generation. Change-Id: I42807449f7526efcd191c0b7b0b4754ffcfffa6e Signed-off-by: bryan <bryan.sullivan@att.com>
Diffstat (limited to 'tests/blueprints/tosca-vnfd-hello-ves/blueprint.yaml')
-rwxr-xr-xtests/blueprints/tosca-vnfd-hello-ves/blueprint.yaml146
1 files changed, 146 insertions, 0 deletions
diff --git a/tests/blueprints/tosca-vnfd-hello-ves/blueprint.yaml b/tests/blueprints/tosca-vnfd-hello-ves/blueprint.yaml
index d17e300..c652423 100755
--- a/tests/blueprints/tosca-vnfd-hello-ves/blueprint.yaml
+++ b/tests/blueprints/tosca-vnfd-hello-ves/blueprint.yaml
@@ -19,6 +19,61 @@ topology_template:
image: models-xenial-server
availability_zone: nova
mgmt_driver: noop
+ config_drive: true
+ user_data_format: RAW
+ user_data: |
+ #!/bin/bash
+ set -x
+ mkdir /home/ubuntu
+ chown -R ubuntu /home/ubuntu
+ mkdir /home/ubuntu/.ssh
+ cat << EOM >/home/ubuntu/.ssh/authorized_keys
+ <pubkey>
+ EOM
+ sudo mount /dev/sr0 /mnt/
+ mkdir /tmp/www
+ cd /tmp/www
+ mkdir html
+ cat >Dockerfile <<EOM
+ FROM nginx
+ COPY html /usr/share/nginx/html
+ EOM
+ host=$(hostname)
+ id=$(cut -d ',' -f 3 /mnt/openstack/latest/meta_data.json)
+ cat <<EOM >html/index.html
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Hello World!</title>
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1"/>
+ <style>
+ body { width: 100%; background-color: white; color: black; padding: 0px; margin: 0px; font-family: sans-serif; font-size:100%; }
+ </style>
+ </head>
+ <body>
+ <large>Welcome to OPNFV @ $host!</large><br/>
+ <a href="http://wiki.opnfv.org"><img src="https://www.opnfv.org/sites/all/themes/opnfv/logo.png"></a>
+ <div>
+ <p>Instance ID fom config drive file /mnt/openstack/latest/meta_data.json></p>
+ <pre>
+ $id
+ </pre>
+ <p>Server setup completed at $(date)</p>
+ </div>
+ </body></html>
+ EOM
+ wget -O /tmp/www/html/favicon.ico https://git.opnfv.org/models/plain/tests/blueprints/tosca-vnfd-3node-tacker/favicon.ico
+ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
+ curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
+ sudo apt-key update
+ echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" >~/dockerrepo
+ sudo tee -a /etc/apt/sources.list.d/docker.list ~/dockerrepo
+ sudo add-apt-repository "deb https://apt.dockerproject.org/repo/ ubuntu-xenial main"
+ sudo apt-get update
+ sudo apt-get install -y docker-engine
+ sudo docker pull nginx
+ sudo docker build -t vhello .
+ sudo docker run --name vHello -d -p 80:80 vhello
config: |
param0: key1
param1: key2
@@ -56,6 +111,61 @@ topology_template:
image: models-xenial-server
availability_zone: nova
mgmt_driver: noop
+ config_drive: true
+ user_data_format: RAW
+ user_data: |
+ #!/bin/bash
+ set -x
+ mkdir /home/ubuntu
+ chown -R ubuntu /home/ubuntu
+ mkdir /home/ubuntu/.ssh
+ cat << EOM >/home/ubuntu/.ssh/authorized_keys
+ <pubkey>
+ EOM
+ sudo mount /dev/sr0 /mnt/
+ mkdir /tmp/www
+ cd /tmp/www
+ mkdir html
+ cat >Dockerfile <<EOM
+ FROM nginx
+ COPY html /usr/share/nginx/html
+ EOM
+ host=$(hostname)
+ id=$(cut -d ',' -f 3 /mnt/openstack/latest/meta_data.json)
+ cat <<EOM >html/index.html
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Hello World!</title>
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1"/>
+ <style>
+ body { width: 100%; background-color: white; color: black; padding: 0px; margin: 0px; font-family: sans-serif; font-size:100%; }
+ </style>
+ </head>
+ <body>
+ <large>Welcome to OPNFV @ $host!</large><br/>
+ <a href="http://wiki.opnfv.org"><img src="https://www.opnfv.org/sites/all/themes/opnfv/logo.png"></a>
+ <div>
+ <p>Instance ID fom config drive file /mnt/openstack/latest/meta_data.json></p>
+ <pre>
+ $id
+ </pre>
+ <p>Server setup completed at $(date)</p>
+ </div>
+ </body></html>
+ EOM
+ wget -O /tmp/www/html/favicon.ico https://git.opnfv.org/models/plain/tests/blueprints/tosca-vnfd-3node-tacker/favicon.ico
+ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
+ curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
+ sudo apt-key update
+ echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" >~/dockerrepo
+ sudo tee -a /etc/apt/sources.list.d/docker.list ~/dockerrepo
+ sudo add-apt-repository "deb https://apt.dockerproject.org/repo/ ubuntu-xenial main"
+ sudo apt-get update
+ sudo apt-get install -y docker-engine
+ sudo docker pull nginx
+ sudo docker build -t vhello .
+ sudo docker run --name vHello -d -p 80:80 vhello
config: |
param0: key1
param1: key2
@@ -93,6 +203,32 @@ topology_template:
image: models-xenial-server
availability_zone: nova
mgmt_driver: noop
+ user_data_format: RAW
+ user_data: |
+ #!/bin/bash
+ set -x
+ mkdir /home/ubuntu
+ chown -R ubuntu /home/ubuntu
+ mkdir /home/ubuntu/.ssh
+ cat << EOM >/home/ubuntu/.ssh/authorized_keys
+ <pubkey>
+ EOM
+ cat << EOF >/tmp/setup.sh
+ echo "1" | sudo tee /proc/sys/net/ipv4/ip_forward
+ sudo sysctl net.ipv4.ip_forward=1
+ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -m state \\
+ --state NEW -m statistic --mode nth --every 2 --packet 0 \\
+ -j DNAT --to-destination <vdu1_ip>:80
+ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -m state \\
+ --state NEW -m statistic --mode nth --every 2 --packet 0 \\
+ -j DNAT --to-destination <vdu2_ip>:80
+ sudo iptables -t nat -A POSTROUTING -j MASQUERADE
+ EOF
+ bash /tmp/setup.sh
+ config: |
+ param0: key1
+ param1: key2
+
config: |
param0: key1
param1: key2
@@ -130,6 +266,16 @@ topology_template:
image: models-xenial-server
availability_zone: nova
mgmt_driver: noop
+ user_data_format: RAW
+ user_data: |
+ #!/bin/bash
+ set -x
+ mkdir /home/ubuntu
+ chown -R ubuntu /home/ubuntu
+ mkdir /home/ubuntu/.ssh
+ cat << EOM >/home/ubuntu/.ssh/authorized_keys
+ <pubkey>
+ EOM
config: |
param0: key1
param1: key2