Add tests for different Neutron configurations
Add test VLAN + DVR deploy. Add test VxLAN + L2pop + DVR deploy. Add test VLAN + L3HA deploy. Add test VxLAN + L3HA deploy. Small fixes in docstring for consistency. Added controller HA configuration for cluster. Change-Id: I9f827ed4aff755088855d8ca5656ad430a85feb7
This commit is contained in:
parent
22f88a6434
commit
094fe3aafb
@ -36,3 +36,10 @@ Network templates
|
||||
|
||||
.. automodule:: stacklight_tests.toolchain.test_network_templates
|
||||
:members:
|
||||
|
||||
|
||||
Neutron configuration
|
||||
=====================
|
||||
|
||||
.. automodule:: stacklight_tests.toolchain.test_neutron
|
||||
:members:
|
||||
|
@ -419,7 +419,7 @@ class PluginHelper(object):
|
||||
remote.check_call(cmd)
|
||||
|
||||
def fuel_create_repositories(self, nodes):
|
||||
"""Start task to setup repositories on provided nodes
|
||||
"""Start task to setup repositories on provided nodes.
|
||||
|
||||
:param nodes: list of nodes to run task on them
|
||||
:type nodes: list
|
||||
@ -580,7 +580,7 @@ class PluginHelper(object):
|
||||
|
||||
def check_pacemaker_resource(self, resource_name, role):
|
||||
"""Check that the pacemaker resource is started on nodes with given
|
||||
role
|
||||
role.
|
||||
:param resource_name: the name of the pacemaker resource
|
||||
:type resource_name: str
|
||||
:param role: the role of node when pacemaker is running
|
||||
@ -606,3 +606,20 @@ class PluginHelper(object):
|
||||
resource_name, pcm_nodes), config), None,
|
||||
'Resource [{0}] is not properly configured'.format(
|
||||
resource_name))
|
||||
|
||||
def update_neutron_advanced_configuration(self, option, value):
|
||||
"""Method updates current cluster neutron advanced configuration option
|
||||
with provided value.
|
||||
|
||||
:param option: option to set
|
||||
:type option: str
|
||||
:param value: value to set
|
||||
:type value: any
|
||||
:return: None
|
||||
"""
|
||||
attributes = self.nailgun_client.get_cluster_attributes(
|
||||
self.cluster_id)
|
||||
nac_subdict = attributes['editable']['neutron_advanced_configuration']
|
||||
nac_subdict[option]['value'] = value
|
||||
self.nailgun_client.update_cluster_attributes(
|
||||
self.cluster_id, attributes)
|
||||
|
@ -25,6 +25,36 @@ class TestToolchainNeutron(api.ToolchainApi):
|
||||
configurations.
|
||||
"""
|
||||
|
||||
def _deploy_with_neutron_configuration(self, caller, config=None,
|
||||
advanced_options=(), is_ha=False):
|
||||
self.check_run(caller)
|
||||
base_snapshot_name = "ready_with_3_slaves"
|
||||
nodes = self.settings.base_nodes
|
||||
if is_ha:
|
||||
base_snapshot_name = "ready_with_5_slaves"
|
||||
nodes = self.settings.ha_controller_nodes
|
||||
self.env.revert_snapshot(base_snapshot_name)
|
||||
|
||||
self.prepare_plugins()
|
||||
|
||||
self.helpers.create_cluster(
|
||||
name=caller,
|
||||
settings=config
|
||||
)
|
||||
|
||||
self.activate_plugins()
|
||||
|
||||
for option in advanced_options:
|
||||
self.helpers.update_neutron_advanced_configuration(*option)
|
||||
|
||||
self.helpers.deploy_cluster(nodes,
|
||||
verify_network=True)
|
||||
self.check_plugins_online()
|
||||
|
||||
self.helpers.run_ostf()
|
||||
|
||||
self.env.make_snapshot(caller, is_make=True)
|
||||
|
||||
@test(depends_on_groups=["prepare_slaves_3"],
|
||||
groups=["deploy_toolchain_neutron_vxlan", "deploy",
|
||||
"toolchain", "network_configuration"])
|
||||
@ -47,25 +77,136 @@ class TestToolchainNeutron(api.ToolchainApi):
|
||||
Duration 60m
|
||||
Snapshot deploy_toolchain_neutron_vxlan
|
||||
"""
|
||||
self.check_run("deploy_toolchain_neutron_vxlan")
|
||||
self.env.revert_snapshot("ready_with_3_slaves")
|
||||
|
||||
self.prepare_plugins()
|
||||
|
||||
self.helpers.create_cluster(
|
||||
name="deploy_toolchain_neutron_vxlan",
|
||||
settings={
|
||||
self._deploy_with_neutron_configuration(
|
||||
"deploy_toolchain_neutron_vxlan",
|
||||
config={
|
||||
"net_provider": "neutron",
|
||||
"net_segment_type": settings.NEUTRON_SEGMENT["tun"]
|
||||
}
|
||||
)
|
||||
|
||||
self.activate_plugins()
|
||||
@test(depends_on_groups=["prepare_slaves_3"],
|
||||
groups=["deploy_toolchain_neutron_vlan_dvr", "deploy",
|
||||
"toolchain", "network_configuration"])
|
||||
@log_snapshot_after_test
|
||||
def deploy_toolchain_neutron_vlan_dvr(self):
|
||||
"""Deploy a cluster with the LMA Toolchain plugins with
|
||||
Neutron VLAN segmentation and DVR feature.
|
||||
|
||||
self.helpers.deploy_cluster(self.settings.base_nodes,
|
||||
verify_network=True)
|
||||
self.check_plugins_online()
|
||||
Scenario:
|
||||
1. Upload the LMA Toolchain plugins to the master node
|
||||
2. Install the plugins
|
||||
3. Create the cluster using VLAN segmentation
|
||||
4. Set DVR option
|
||||
5. Add 1 node with controller role
|
||||
6. Add 1 node with compute and cinder roles
|
||||
7. Add 1 node with plugin roles
|
||||
8. Deploy the cluster
|
||||
9. Check that LMA Toolchain plugins are running
|
||||
10. Run OSTF
|
||||
|
||||
self.helpers.run_ostf()
|
||||
Duration 60m
|
||||
Snapshot deploy_toolchain_neutron_vlan_dvr
|
||||
"""
|
||||
options = ('neutron_dvr', True),
|
||||
self._deploy_with_neutron_configuration(
|
||||
"deploy_toolchain_neutron_vlan_dvr", advanced_options=options)
|
||||
|
||||
self.env.make_snapshot("deploy_toolchain_neutron_vxlan", is_make=True)
|
||||
@test(depends_on_groups=["prepare_slaves_5"],
|
||||
groups=["deploy_toolchain_neutron_vlan_l3ha", "deploy",
|
||||
"toolchain", "network_configuration"])
|
||||
@log_snapshot_after_test
|
||||
def deploy_toolchain_neutron_vlan_l3ha(self):
|
||||
"""Deploy a cluster with the LMA Toolchain plugins with
|
||||
Neutron VLAN segmentation and L3HA feature.
|
||||
|
||||
Scenario:
|
||||
1. Upload the LMA Toolchain plugins to the master node
|
||||
2. Install the plugins
|
||||
3. Create the cluster using VLAN segmentation
|
||||
4. Set L3HA option
|
||||
5. Add 1 node with controller role
|
||||
6. Add 1 node with compute and cinder roles
|
||||
7. Add 1 node with plugin roles
|
||||
8. Deploy the cluster
|
||||
9. Check that LMA Toolchain plugins are running
|
||||
10. Run OSTF
|
||||
|
||||
Duration 60m
|
||||
Snapshot deploy_toolchain_neutron_vlan_l3ha
|
||||
"""
|
||||
options = ('neutron_l3_ha', True),
|
||||
self._deploy_with_neutron_configuration(
|
||||
"deploy_toolchain_neutron_vlan_l3ha",
|
||||
advanced_options=options, is_ha=True)
|
||||
|
||||
@test(depends_on_groups=["prepare_slaves_3"],
|
||||
groups=["deploy_toolchain_neutron_vxlan_l2pop_dvr", "deploy",
|
||||
"toolchain", "network_configuration"])
|
||||
@log_snapshot_after_test
|
||||
def deploy_toolchain_neutron_vxlan_l2pop_dvr(self):
|
||||
"""Deploy a cluster with the LMA Toolchain plugins with
|
||||
Neutron VxLAN segmentation and DVR feature.
|
||||
|
||||
Scenario:
|
||||
1. Upload the LMA Toolchain plugins to the master node
|
||||
2. Install the plugins
|
||||
3. Create the cluster using VxLAN segmentation
|
||||
4. Set L2pop and DVR options
|
||||
5. Add 1 node with controller role
|
||||
6. Add 1 node with compute and cinder roles
|
||||
7. Add 1 node with plugin roles
|
||||
8. Deploy the cluster
|
||||
9. Check that LMA Toolchain plugins are running
|
||||
10. Run OSTF
|
||||
|
||||
Duration 60m
|
||||
Snapshot deploy_toolchain_neutron_vxlan_l2pop_dvr
|
||||
"""
|
||||
|
||||
options = (('neutron_l2_pop', True),
|
||||
('neutron_dvr', True))
|
||||
|
||||
self._deploy_with_neutron_configuration(
|
||||
"deploy_toolchain_neutron_vxlan_l2pop_dvr",
|
||||
config={
|
||||
"net_provider": "neutron",
|
||||
"net_segment_type": settings.NEUTRON_SEGMENT["tun"]
|
||||
},
|
||||
advanced_options=options
|
||||
)
|
||||
|
||||
@test(depends_on_groups=["prepare_slaves_5"],
|
||||
groups=["deploy_toolchain_neutron_vxlan_l3ha", "deploy",
|
||||
"toolchain", "network_configuration"])
|
||||
@log_snapshot_after_test
|
||||
def deploy_toolchain_neutron_vxlan_l3ha(self):
|
||||
"""Deploy a cluster with the LMA Toolchain plugins with
|
||||
Neutron VxLAN segmentation and L3HA feature.
|
||||
|
||||
Scenario:
|
||||
1. Upload the LMA Toolchain plugins to the master node
|
||||
2. Install the plugins
|
||||
3. Create the cluster using VxLAN segmentation
|
||||
4. Set L3HA option
|
||||
5. Add 1 node with controller role
|
||||
6. Add 1 node with compute and cinder roles
|
||||
7. Add 1 node with plugin roles
|
||||
8. Deploy the cluster
|
||||
9. Check that LMA Toolchain plugins are running
|
||||
10. Run OSTF
|
||||
|
||||
Duration 60m
|
||||
Snapshot deploy_toolchain_neutron_vxlan_l3ha
|
||||
"""
|
||||
|
||||
options = ('neutron_l3_ha', True),
|
||||
|
||||
self._deploy_with_neutron_configuration(
|
||||
"deploy_toolchain_neutron_vxlan_l3ha",
|
||||
config={
|
||||
"net_provider": "neutron",
|
||||
"net_segment_type": settings.NEUTRON_SEGMENT["tun"]
|
||||
},
|
||||
advanced_options=options, is_ha=True
|
||||
)
|
||||
|
@ -72,9 +72,9 @@ class TestToolchainPostInstallation(api.ToolchainApi):
|
||||
4. Add 3 nodes with the plugin roles
|
||||
5. Deploy the cluster
|
||||
6. Redeploy the nodes that existed before the last deploy (MOS 8
|
||||
only)
|
||||
6. Check that LMA Toolchain plugins are running
|
||||
7. Run OSTF
|
||||
only)
|
||||
7. Check that LMA Toolchain plugins are running
|
||||
8. Run OSTF
|
||||
|
||||
Duration 60m
|
||||
Snapshot deploy_toolchain_in_existing_environment
|
||||
|
@ -33,6 +33,14 @@ base_nodes = {
|
||||
'slave-03': stacklight_roles
|
||||
}
|
||||
|
||||
ha_controller_nodes = {
|
||||
'slave-01': ['controller'],
|
||||
'slave-02': ['controller'],
|
||||
'slave-03': ['controller'],
|
||||
'slave-04': ['compute', 'cinder'],
|
||||
'slave-05': stacklight_roles,
|
||||
}
|
||||
|
||||
full_ha_nodes = {
|
||||
'slave-01': ['controller'],
|
||||
'slave-02': ['controller'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user