Added new test dvs_heat.
-added dvs_stack.yaml template -added test dvs_heat Change-Id: Iad4714b1024df34ec87af61593db3eb51908bd92
This commit is contained in:
parent
acf582724b
commit
6b7d04d697
|
@ -0,0 +1,68 @@
|
|||
heat_template_version: 2013-05-23
|
||||
|
||||
description: >
|
||||
HOT template to create a new neutron network plus a router to the public
|
||||
network, and for deploying servers into the new network.
|
||||
|
||||
parameters:
|
||||
admin_floating_net:
|
||||
type: string
|
||||
label: admin_floating_net
|
||||
description: ID or name of public network for which floating IP addresses will be allocated
|
||||
default: admin_floating_net
|
||||
flavor:
|
||||
type: string
|
||||
label: flavor
|
||||
description: Flavor to use for servers
|
||||
default: m1.tiny
|
||||
image:
|
||||
type: string
|
||||
label: image
|
||||
description: Image to use for servers
|
||||
default: TestVM-VMDK
|
||||
|
||||
resources:
|
||||
private_net:
|
||||
type: OS::Neutron::Net
|
||||
properties:
|
||||
name: net_1
|
||||
|
||||
private_subnet:
|
||||
type: OS::Neutron::Subnet
|
||||
properties:
|
||||
network_id: { get_resource: private_net }
|
||||
cidr: 10.0.0.0/29
|
||||
dns_nameservers: [ 8.8.8.8, 8.8.4.4 ]
|
||||
|
||||
router:
|
||||
type: OS::Neutron::Router
|
||||
properties:
|
||||
external_gateway_info:
|
||||
network: { get_param: admin_floating_net }
|
||||
|
||||
router_interface:
|
||||
type: OS::Neutron::RouterInterface
|
||||
properties:
|
||||
router_id: { get_resource: router }
|
||||
subnet_id: { get_resource: private_subnet }
|
||||
|
||||
master_image_server_port:
|
||||
type: OS::Neutron::Port
|
||||
properties:
|
||||
network_id: { get_resource: private_net }
|
||||
fixed_ips:
|
||||
- subnet_id: { get_resource: private_subnet }
|
||||
|
||||
master_image_server:
|
||||
type: OS::Nova::Server
|
||||
properties:
|
||||
name: instance_1
|
||||
image: { get_param: image }
|
||||
flavor: { get_param: flavor }
|
||||
availability_zone: "vcenter"
|
||||
networks:
|
||||
- port: { get_resource: master_image_server_port }
|
||||
|
||||
outputs:
|
||||
server_info:
|
||||
value: { get_attr: [master_image_server, show ] }
|
|
@ -15,6 +15,10 @@ under the License.
|
|||
|
||||
import time
|
||||
|
||||
from devops.error import TimeoutError
|
||||
|
||||
from devops.helpers.helpers import wait
|
||||
|
||||
from fuelweb_test import logger
|
||||
|
||||
from fuelweb_test.helpers import os_actions
|
||||
|
@ -1482,3 +1486,57 @@ class TestDVSSystem(TestBasic):
|
|||
ping_result['exit_code'] == 0,
|
||||
"Ping isn't available from {0} to {1}".format(ip, ip_2)
|
||||
)
|
||||
|
||||
@test(depends_on=[dvs_vcenter_systest_setup],
|
||||
groups=["dvs_heat"])
|
||||
@log_snapshot_after_test
|
||||
def dvs_heat(self):
|
||||
"""Check connectivity between instances from different networks.
|
||||
|
||||
Scenario:
|
||||
1. Revert snapshot to dvs_vcenter_systest_setup.
|
||||
2. Create stack with heat template.
|
||||
3. Check that stack was created.
|
||||
|
||||
Duration: 15 min
|
||||
|
||||
"""
|
||||
# constants
|
||||
expect_state = 'CREATE_COMPLETE'
|
||||
boot_timeout = 300
|
||||
template_path = 'plugin_test/templates/dvs_stack.yaml'
|
||||
|
||||
self.show_step(1)
|
||||
self.env.revert_snapshot("dvs_vcenter_systest_setup")
|
||||
|
||||
cluster_id = self.fuel_web.get_last_created_cluster()
|
||||
|
||||
os_ip = self.fuel_web.get_public_vip(cluster_id)
|
||||
os_conn = os_actions.OpenStackActions(
|
||||
os_ip, SERVTEST_USERNAME,
|
||||
SERVTEST_PASSWORD,
|
||||
SERVTEST_TENANT)
|
||||
|
||||
with open(template_path) as f:
|
||||
template = f.read()
|
||||
|
||||
self.show_step(2)
|
||||
stack_id = os_conn.heat.stacks.create(
|
||||
stack_name='dvs_stack',
|
||||
template=template,
|
||||
disable_rollback=True
|
||||
)['stack']['id']
|
||||
|
||||
self.show_step(3)
|
||||
try:
|
||||
wait(
|
||||
lambda:
|
||||
os_conn.heat.stacks.get(stack_id).stack_status == expect_state,
|
||||
timeout=boot_timeout)
|
||||
except TimeoutError:
|
||||
current_state = os_conn.heat.stacks.get(stack_id).stack_status
|
||||
assert_true(
|
||||
current_state == expect_state,
|
||||
"Timeout is reached. Current state of stack is {}".format(
|
||||
current_state)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue