Merge "Add tests for different Neutron configurations"
This commit is contained in:
commit
297952ffc8
@ -36,3 +36,10 @@ Network templates
|
|||||||
|
|
||||||
.. automodule:: stacklight_tests.toolchain.test_network_templates
|
.. automodule:: stacklight_tests.toolchain.test_network_templates
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
Neutron configuration
|
||||||
|
=====================
|
||||||
|
|
||||||
|
.. automodule:: stacklight_tests.toolchain.test_neutron
|
||||||
|
:members:
|
||||||
|
@ -419,7 +419,7 @@ class PluginHelper(object):
|
|||||||
remote.check_call(cmd)
|
remote.check_call(cmd)
|
||||||
|
|
||||||
def fuel_create_repositories(self, nodes):
|
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
|
:param nodes: list of nodes to run task on them
|
||||||
:type nodes: list
|
:type nodes: list
|
||||||
@ -580,7 +580,7 @@ class PluginHelper(object):
|
|||||||
|
|
||||||
def check_pacemaker_resource(self, resource_name, role):
|
def check_pacemaker_resource(self, resource_name, role):
|
||||||
"""Check that the pacemaker resource is started on nodes with given
|
"""Check that the pacemaker resource is started on nodes with given
|
||||||
role
|
role.
|
||||||
:param resource_name: the name of the pacemaker resource
|
:param resource_name: the name of the pacemaker resource
|
||||||
:type resource_name: str
|
:type resource_name: str
|
||||||
:param role: the role of node when pacemaker is running
|
:param role: the role of node when pacemaker is running
|
||||||
@ -606,3 +606,20 @@ class PluginHelper(object):
|
|||||||
resource_name, pcm_nodes), config), None,
|
resource_name, pcm_nodes), config), None,
|
||||||
'Resource [{0}] is not properly configured'.format(
|
'Resource [{0}] is not properly configured'.format(
|
||||||
resource_name))
|
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.
|
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"],
|
@test(depends_on_groups=["prepare_slaves_3"],
|
||||||
groups=["deploy_toolchain_neutron_vxlan", "deploy",
|
groups=["deploy_toolchain_neutron_vxlan", "deploy",
|
||||||
"toolchain", "network_configuration"])
|
"toolchain", "network_configuration"])
|
||||||
@ -47,25 +77,136 @@ class TestToolchainNeutron(api.ToolchainApi):
|
|||||||
Duration 60m
|
Duration 60m
|
||||||
Snapshot deploy_toolchain_neutron_vxlan
|
Snapshot deploy_toolchain_neutron_vxlan
|
||||||
"""
|
"""
|
||||||
self.check_run("deploy_toolchain_neutron_vxlan")
|
self._deploy_with_neutron_configuration(
|
||||||
self.env.revert_snapshot("ready_with_3_slaves")
|
"deploy_toolchain_neutron_vxlan",
|
||||||
|
config={
|
||||||
self.prepare_plugins()
|
|
||||||
|
|
||||||
self.helpers.create_cluster(
|
|
||||||
name="deploy_toolchain_neutron_vxlan",
|
|
||||||
settings={
|
|
||||||
"net_provider": "neutron",
|
"net_provider": "neutron",
|
||||||
"net_segment_type": settings.NEUTRON_SEGMENT["tun"]
|
"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,
|
Scenario:
|
||||||
verify_network=True)
|
1. Upload the LMA Toolchain plugins to the master node
|
||||||
self.check_plugins_online()
|
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
|
||||||
|
)
|
||||||
|
@ -73,8 +73,8 @@ class TestToolchainPostInstallation(api.ToolchainApi):
|
|||||||
5. Deploy the cluster
|
5. Deploy the cluster
|
||||||
6. Redeploy the nodes that existed before the last deploy (MOS 8
|
6. Redeploy the nodes that existed before the last deploy (MOS 8
|
||||||
only)
|
only)
|
||||||
6. Check that LMA Toolchain plugins are running
|
7. Check that LMA Toolchain plugins are running
|
||||||
7. Run OSTF
|
8. Run OSTF
|
||||||
|
|
||||||
Duration 60m
|
Duration 60m
|
||||||
Snapshot deploy_toolchain_in_existing_environment
|
Snapshot deploy_toolchain_in_existing_environment
|
||||||
|
@ -33,6 +33,14 @@ base_nodes = {
|
|||||||
'slave-03': stacklight_roles
|
'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 = {
|
full_ha_nodes = {
|
||||||
'slave-01': ['controller'],
|
'slave-01': ['controller'],
|
||||||
'slave-02': ['controller'],
|
'slave-02': ['controller'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user