Update Release Notes for Gambia 7.1 Release
[sdnvpn.git] / sdnvpn / artifacts / testcase_8bis.yaml
1 heat_template_version: 2013-05-23
2
3 description: >
4   Template for SDNVPN testcase 8
5   Test floating IP and router assoc coexistence
6
7 parameters:
8   flavor:
9     type: string
10     description: flavor for the servers to be created
11     constraints:
12       - custom_constraint: nova.flavor
13   image_n:
14     type: string
15     description: image for the servers to be created
16     constraints:
17       - custom_constraint: glance.image
18   av_zone_1:
19     type: string
20     description: availability zone 1
21
22   external_nw:
23     type: string
24     description: the external network
25   net_1_name:
26     type: string
27     description: network 1
28   subnet_1_name:
29     type: string
30     description: subnet 1 name
31   subnet_1_cidr:
32     type: string
33     description: subnet 1 cidr
34   router_1_name:
35     type: string
36     description: router 1 cidr
37   net_2_name:
38     type: string
39     description: network 2
40   subnet_2_name:
41     type: string
42     description: subnet 2 name
43   subnet_2_cidr:
44     type: string
45     description: subnet 1 cidr
46
47   secgroup_name:
48     type: string
49     description: security group name
50   secgroup_descr:
51     type: string
52     description: security group slogan
53
54   instance_1_name:
55     type: string
56     description: instance name
57   instance_2_name:
58     type: string
59     description: instance name
60
61   ping_count:
62     type: string
63     description: ping count for user data script
64     default: 10
65
66 resources:
67   router_1:
68     type: OS::Neutron::Router
69     properties:
70       name: { get_param: router_1_name }
71       external_gateway_info:
72         network: { get_param: external_nw }
73
74   net_1:
75     type: OS::Neutron::Net
76     properties:
77       name: { get_param: net_1_name }
78   subnet_1:
79     type: OS::Neutron::Subnet
80     properties:
81       name: { get_param: subnet_1_name }
82       network: { get_resource: net_1 }
83       cidr: { get_param: subnet_1_cidr }
84   routerinterface_1:
85     type: OS::Neutron::RouterInterface
86     properties:
87       router_id: { get_resource: router_1 }
88       subnet_id: { get_resource: subnet_1 }
89
90   net_2:
91     type: OS::Neutron::Net
92     properties:
93       name: { get_param: net_2_name }
94   subnet_2:
95     type: OS::Neutron::Subnet
96     properties:
97       name: { get_param: subnet_2_name }
98       network: { get_resource: net_2 }
99       cidr: { get_param: subnet_2_cidr }
100
101   sec_group:
102     type: OS::Neutron::SecurityGroup
103     properties:
104       name: { get_param: secgroup_name }
105       description: { get_param: secgroup_descr }
106       rules:
107         - protocol: icmp
108           remote_ip_prefix: 0.0.0.0/0
109         - protocol: tcp
110           port_range_min: 22
111           port_range_max: 22
112           remote_ip_prefix: 0.0.0.0/0
113
114   vm1:
115     type: OS::Nova::Server
116     depends_on: [ vm2 ]
117     properties:
118       name: { get_param: instance_1_name }
119       image: { get_param: image_n }
120       flavor: { get_param: flavor }
121       availability_zone: { get_param: av_zone_1 }
122       security_groups:
123         - { get_resource: sec_group }
124       networks:
125         - subnet: { get_resource: subnet_1 }
126       config_drive: True
127       user_data_format: RAW
128       user_data:
129         str_replace:
130           template: |
131             #!/bin/sh
132             set $IP_VM2
133             while true; do
134              for i do
135               ip=$i
136               ping -c $COUNT $ip 2>&1 >/dev/null
137               RES=$?
138               if [ \"Z$RES\" = \"Z0\" ] ; then
139                echo ping $ip OK
140               else echo ping $ip KO
141               fi
142               done
143              sleep 1
144             done
145           params:
146             $IP_VM2: { get_attr: [vm2, addresses, { get_resource: net_1}, 0, addr] }
147             $COUNT: { get_param: ping_count }
148   vm2:
149     type: OS::Nova::Server
150     properties:
151       name: { get_param: instance_2_name }
152       image: { get_param: image_n }
153       flavor: { get_param: flavor }
154       availability_zone: { get_param: av_zone_1 }
155       security_groups:
156         - { get_resource: sec_group }
157       networks:
158         - subnet: { get_resource: subnet_2 }
159
160
161 outputs:
162   router_1_o:
163     description: the id of network 1
164     value: { get_attr: [router_1, show, id] }
165   net_2_o:
166     description: the id of network 2
167     value: { get_attr: [net_2, show, id] }
168   vm1_o:
169     description: the deployed vm resource
170     value: { get_attr: [vm1, show, name] }
171   vm2_o:
172     description: the deployed vm resource
173     value: { get_attr: [vm2, show, name] }