Deployment with network template: One-network deployment is impossible

Deploy cluster with specific network configuration:
 No dedicated management nework.

This is automated test for already fixed and manually tested bug.

Related-Bug: #1518439
Change-Id: Ifa8dcba050e0c45fbae6e4144d25d70d27bc5375
This commit is contained in:
Alexey Stepanov 2016-01-28 18:14:10 +03:00
parent fcc04db66f
commit 04cb053545
3 changed files with 217 additions and 0 deletions

View File

@ -534,6 +534,10 @@ class NailgunClient(object):
def add_network_group(self, network_data):
return self.client.post('/api/networks/', data=network_data)
@logwrap
def del_network_group(self, network_id):
return self.client.delete('/api/networks/{0}/'.format(network_id))
@logwrap
@json_parse
def update_network_group(self, network_id, network_data):

View File

@ -0,0 +1,130 @@
adv_net_template:
default:
nic_mapping:
default:
if1: enp0s3 # admin
if2: enp0s4 # public
if3: enp0s5 # private
if4: enp0s6 # storage
templates_for_node_role:
controller:
- public
- private
- storage
- common
compute:
- common
- private
- storage
cinder:
- common
- storage
ceph-osd:
- common
- storage
network_assignments:
storage:
ep: br-storage
private:
ep: br-prv
public:
ep: br-ex
fuelweb_admin:
ep: br-fw-admin
network_scheme:
storage:
transformations:
- action: add-br
name: br-storage
- action: add-port
bridge: br-storage
name: <% if4 %>
endpoints:
- br-storage
roles:
cinder/iscsi: br-storage
swift/replication: br-storage
ceph/replication: br-storage
storage: br-storage
private:
transformations:
- action: add-br
name: br-prv
provider: ovs
- action: add-br
name: br-aux
- action: add-patch
bridges:
- br-prv
- br-aux
provider: ovs
mtu: 65000
- action: add-port
bridge: br-aux
name: <% if3 %>
endpoints:
- br-prv
roles:
neutron/private: br-prv
public:
transformations:
- action: add-br
name: br-ex
- action: add-br
name: br-floating
provider: ovs
- action: add-patch
bridges:
- br-floating
- br-ex
provider: ovs
mtu: 65000
- action: add-port
bridge: br-ex
name: <% if2 %>
endpoints:
- br-ex
roles:
public/vip: br-ex
neutron/floating: br-floating
ceph/radosgw: br-ex
ex: br-ex
common:
transformations:
- action: add-br
name: br-fw-admin
- action: add-port
bridge: br-fw-admin
name: <% if1 %>
endpoints:
- br-fw-admin
roles:
admin/pxe: br-fw-admin
fw-admin: br-fw-admin
mongo/db: br-fw-admin
management: br-fw-admin
keystone/api: br-fw-admin
neutron/api: br-fw-admin
neutron/mesh: br-fw-admin
swift/api: br-fw-admin
sahara/api: br-fw-admin
ceilometer/api: br-fw-admin
cinder/api: br-fw-admin
glance/api: br-fw-admin
heat/api: br-fw-admin
nova/api: br-fw-admin
nova/migration: br-fw-admin
murano/api: br-fw-admin
murano/cfapi: br-fw-admin
horizon: br-fw-admin
mgmt/api: br-fw-admin
mgmt/memcache: br-fw-admin
mgmt/database: br-fw-admin
mgmt/messaging: br-fw-admin
mgmt/corosync: br-fw-admin
mgmt/vip: br-fw-admin
mgmt/api: br-fw-admin
ceph/public: br-fw-admin
ironic/api: br-fw-admin
ironic/baremetal: br-fw-admin

View File

@ -15,6 +15,7 @@
from proboscis import SkipTest
from proboscis import test
from proboscis.asserts import assert_equal
from proboscis.asserts import assert_true
from fuelweb_test import logger
from fuelweb_test.helpers.decorators import log_snapshot_after_test
@ -480,3 +481,85 @@ class TestNetworkTemplates(TestNetworkTemplatesBase):
self.env.make_snapshot("network_config_consistency_on_reboot",
is_make=self.is_make_snapshot())
@test(depends_on=[SetupEnvironment.prepare_slaves_3],
groups=["deploy_cluster_without_management_net"])
@log_snapshot_after_test
def deploy_cluster_without_management_net(self):
"""Deploy HA environment network template: no dedicate management nwk
Scenario:
1. Revert snapshot with 3 slaves
2. Create cluster (HA) with Neutron VLAN
3. Add 1 controller + cinder nodes
4. Add 2 compute + cinder nodes
5. Upload network template
6. Delete 'management' network-group
7. Run network verification
8. Deploy cluster
9. Run network verification
10. Run health checks (OSTF)
Duration 180m
Snapshot deploy_cluster_without_management_net
"""
self.show_step(1, initialize=True)
self.env.revert_snapshot("ready_with_3_slaves")
self.show_step(2)
cluster_id = self.fuel_web.create_cluster(
name=self.__class__.__name__,
mode=DEPLOYMENT_MODE_HA,
)
self.show_step(3)
self.show_step(4)
self.fuel_web.update_nodes(
cluster_id,
{
'slave-01': ['controller', 'cinder'],
'slave-02': ['compute', 'cinder'],
'slave-03': ['compute', 'cinder'],
},
update_interfaces=False
)
self.show_step(5)
template = 'default_no_mgmt_nwk'
logger.info('using template: {!s}'.format(template))
network_template = get_network_template(template)
self.fuel_web.client.upload_network_template(
cluster_id=cluster_id, network_template=network_template)
self.show_step(6)
mgmt_net = filter(
lambda grp: grp['name'] == 'management',
self.fuel_web.client.get_network_groups()
).pop()
assert_true(
self.fuel_web.client.del_network_group(mgmt_net['id']).code
in {200, 204},
'Network group delete failed'
)
assert_true(
mgmt_net not in self.fuel_web.client.get_network_groups(),
'Network group has not been deleted'
)
self.show_step(7)
self.fuel_web.verify_network(cluster_id)
self.show_step(8)
self.fuel_web.deploy_cluster_wait(cluster_id)
self.show_step(9)
self.fuel_web.verify_network(cluster_id)
self.show_step(10)
self.fuel_web.run_ostf(
cluster_id=cluster_id,
test_sets=['smoke', 'sanity', 'ha', 'tests_platform'])
self.env.make_snapshot('deploy_cluster_without_management_net')