Added multiple dvs switch configuration.
-added multiple dvs switch configuration -add method get_dvs_plugin_data -increase timeout of network verification from 60*5 to 60*30 -remove tests 'delete_controler' and 'add_delete_nodes' Change-Id: I72243a987a2ea5ace1d3686bb40e75370f6f1c9c
This commit is contained in:
parent
edc34083ea
commit
a61da22a99
|
@ -1 +1 @@
|
|||
Subproject commit cfa90a8b4ad262c7f666d31ea1cf02edd39ece80
|
||||
Subproject commit 06fdb8dcc703bf2fc1e852e14ce9d16aaeee5b49
|
|
@ -24,12 +24,17 @@ from fuelweb_test import logger
|
|||
|
||||
# constants
|
||||
DVS_PLUGIN_PATH = os.environ.get('DVS_PLUGIN_PATH')
|
||||
plugin_name = 'fuel-plugin-vmware-dvs'
|
||||
DVS_PLUGIN_VERSION = os.environ.get('DVS_PLUGIN_VERSION')
|
||||
DVS_SWITCHES = os.environ.get('DVS_SWITCHES').split(',')
|
||||
VCENTER_CLUSTERS = os.environ.get('VCENTER_CLUSTERS').split(',')
|
||||
msg = "Plugin couldn't be enabled. Check plugin version. Test aborted"
|
||||
dvs_switch_name = ['dvSwitch']
|
||||
plugin_name = "fuel-plugin-vmware-dvs"
|
||||
|
||||
|
||||
def install_dvs_plugin(master_node):
|
||||
"""Download and instal DVS plugin on master node.
|
||||
|
||||
"""
|
||||
# copy plugins to the master node
|
||||
checkers.upload_tarball(
|
||||
master_node,
|
||||
|
@ -41,16 +46,24 @@ def install_dvs_plugin(master_node):
|
|||
plugin=os.path.basename(DVS_PLUGIN_PATH))
|
||||
|
||||
|
||||
def enable_plugin(cluster_id, fuel_web_client):
|
||||
def enable_plugin(
|
||||
cluster_id, fuel_web_client, multiclusters=True):
|
||||
"""Enable DVS plugin on cluster
|
||||
|
||||
"""
|
||||
assert_true(
|
||||
fuel_web_client.check_plugin_exists(cluster_id, plugin_name),
|
||||
fuel_web_client.check_plugin_exists(
|
||||
cluster_id, plugin_name),
|
||||
msg)
|
||||
map_switch_clusters = map(
|
||||
lambda x, y: "{0};{1}".format(x, y), VCENTER_CLUSTERS, DVS_SWITCHES)
|
||||
if multiclusters is True:
|
||||
options = {'vmware_dvs_net_maps/value': ''.join(map_switch_clusters)}
|
||||
else:
|
||||
options = {'vmware_dvs_net_maps/value': map_switch_clusters[0]}
|
||||
|
||||
cluster_attr = fuel_web_client.client.get_cluster_attributes(cluster_id)
|
||||
plugin_data = cluster_attr['editable'][plugin_name]
|
||||
plugin_data['metadata']['enabled'] = True
|
||||
plugin_data['metadata']['versions'][0]['vmware_dvs_net_maps']['value'] = \
|
||||
dvs_switch_name[0]
|
||||
fuel_web_client.client.update_cluster_attributes(cluster_id, cluster_attr)
|
||||
logger.info("cluster is {0}".format(cluster_id))
|
||||
|
||||
logger.info("cluster is {}".format(cluster_id))
|
||||
fuel_web_client.update_plugin_settings(
|
||||
cluster_id, plugin_name,
|
||||
DVS_PLUGIN_VERSION, options)
|
||||
|
|
|
@ -45,189 +45,6 @@ class TestDVSPlugin(TestBasic):
|
|||
# defaults
|
||||
inter_net_name = openstack.get_defaults()['networks']['internal']['name']
|
||||
|
||||
@test(depends_on=[SetupEnvironment.prepare_slaves_9],
|
||||
groups=["dvs_vcenter_add_delete_nodes", "dvs_vcenter_plugin"])
|
||||
@log_snapshot_after_test
|
||||
def dvs_vcenter_add_delete_nodes(self):
|
||||
"""Deploy cluster with plugin and vmware datastore backend
|
||||
|
||||
Scenario:
|
||||
1. Upload plugins to the master node.
|
||||
2. Install plugin.
|
||||
3. Create cluster with vcenter.
|
||||
4. Add 3 node with controller role.
|
||||
5. Add 2 node with cinder-vmdk role.
|
||||
6. Add 1 node with compute role.
|
||||
7. Remove node with cinder-vmdk role.
|
||||
8. Add node with cinder role.
|
||||
9. Redeploy cluster.
|
||||
10. Run OSTF.
|
||||
11. Remove node with compute role.
|
||||
12. Add node with cinder-vmdk role.
|
||||
13. Redeploy cluster.
|
||||
14. Run OSTF.
|
||||
|
||||
Duration 3 hours
|
||||
|
||||
"""
|
||||
self.env.revert_snapshot("ready_with_9_slaves")
|
||||
|
||||
plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())
|
||||
|
||||
# Configure cluster
|
||||
cluster_id = self.fuel_web.create_cluster(
|
||||
name=self.__class__.__name__,
|
||||
mode=DEPLOYMENT_MODE,
|
||||
settings={
|
||||
"net_provider": 'neutron',
|
||||
"net_segment_type": NEUTRON_SEGMENT_TYPE
|
||||
}
|
||||
)
|
||||
|
||||
plugin.enable_plugin(cluster_id, self.fuel_web)
|
||||
|
||||
# Assign role to node
|
||||
self.fuel_web.update_nodes(
|
||||
cluster_id,
|
||||
{'slave-01': ['controller'],
|
||||
'slave-02': ['controller'],
|
||||
'slave-03': ['controller'],
|
||||
'slave-04': ['cinder-vmware'],
|
||||
'slave-05': ['compute'],
|
||||
'slave-06': ['compute'],
|
||||
'slave-07': ['compute-vmware'], })
|
||||
|
||||
# Configure VMWare vCenter settings
|
||||
target_node_1 = self.node_name('slave-07')
|
||||
self.fuel_web.vcenter_configure(
|
||||
cluster_id,
|
||||
target_node_1=target_node_1,
|
||||
multiclusters=True
|
||||
)
|
||||
self.fuel_web.deploy_cluster_wait(cluster_id)
|
||||
|
||||
self.fuel_web.run_ostf(
|
||||
cluster_id=cluster_id, test_sets=['smoke'])
|
||||
|
||||
# Remove node with cinder-vmdk role
|
||||
self.fuel_web.update_nodes(
|
||||
cluster_id,
|
||||
{'slave-04': ['cinder-vmware'], }, False, True)
|
||||
|
||||
# Add 1 node with cinder role and redeploy cluster
|
||||
self.fuel_web.update_nodes(
|
||||
cluster_id,
|
||||
{
|
||||
'slave-08': ['cinder'],
|
||||
}
|
||||
)
|
||||
|
||||
self.fuel_web.deploy_cluster_wait(cluster_id)
|
||||
|
||||
self.fuel_web.run_ostf(
|
||||
cluster_id=cluster_id, test_sets=['smoke'])
|
||||
|
||||
# Remove node with compute role
|
||||
self.fuel_web.update_nodes(
|
||||
cluster_id,
|
||||
{'slave-05': ['compute'], }, False, True)
|
||||
|
||||
# Add 1 node with cinder-vmdk role and redeploy cluster
|
||||
self.fuel_web.update_nodes(
|
||||
cluster_id,
|
||||
{
|
||||
'slave-04': ['cinder-vmware'],
|
||||
}
|
||||
)
|
||||
|
||||
self.fuel_web.deploy_cluster_wait(cluster_id)
|
||||
|
||||
self.fuel_web.run_ostf(
|
||||
cluster_id=cluster_id, test_sets=['smoke'])
|
||||
|
||||
@test(depends_on=[SetupEnvironment.prepare_slaves_9],
|
||||
groups=["dvs_vcenter_add_delete_controller", "dvs_vcenter_plugin"])
|
||||
@log_snapshot_after_test
|
||||
def dvs_vcenter_add_delete_controller(self):
|
||||
"""Deploy cluster with plugin, adding and deletion controler node.
|
||||
|
||||
Scenario:
|
||||
1. Upload plugins to the master node.
|
||||
2. Install plugin.
|
||||
3. Create cluster with vcenter.
|
||||
4. Add 4 node with controller role.
|
||||
5. Add 1 node with cinder-vmdk role.
|
||||
6. Add 1 node with compute role.
|
||||
7. Deploy cluster.
|
||||
8. Run OSTF.
|
||||
9. Remove node with controller role.
|
||||
10. Redeploy cluster.
|
||||
11. Run OSTF.
|
||||
12. Add node with controller role.
|
||||
13. Redeploy cluster.
|
||||
14. Run OSTF.
|
||||
|
||||
Duration 3.5 hours
|
||||
|
||||
"""
|
||||
self.env.revert_snapshot("ready_with_9_slaves")
|
||||
|
||||
plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())
|
||||
|
||||
# Configure cluster
|
||||
cluster_id = self.fuel_web.create_cluster(
|
||||
name=self.__class__.__name__,
|
||||
mode=DEPLOYMENT_MODE,
|
||||
settings={
|
||||
"net_provider": 'neutron',
|
||||
"net_segment_type": NEUTRON_SEGMENT_TYPE
|
||||
}
|
||||
)
|
||||
|
||||
plugin.enable_plugin(cluster_id, self.fuel_web)
|
||||
|
||||
# Assign role to node
|
||||
self.fuel_web.update_nodes(
|
||||
cluster_id,
|
||||
{'slave-01': ['controller'],
|
||||
'slave-02': ['controller'],
|
||||
'slave-03': ['controller'],
|
||||
'slave-04': ['controller'],
|
||||
'slave-05': ['cinder-vmware'],
|
||||
'slave-06': ['compute'], })
|
||||
|
||||
# Configure VMWare vCenter settings
|
||||
self.fuel_web.vcenter_configure(cluster_id)
|
||||
|
||||
self.fuel_web.deploy_cluster_wait(cluster_id)
|
||||
|
||||
self.fuel_web.run_ostf(
|
||||
cluster_id=cluster_id, test_sets=['smoke'])
|
||||
|
||||
# Remove node with controller role
|
||||
self.fuel_web.update_nodes(
|
||||
cluster_id,
|
||||
{'slave-01': ['controller'], }, False, True)
|
||||
|
||||
self.fuel_web.deploy_cluster_wait(cluster_id, check_services=False)
|
||||
|
||||
self.fuel_web.run_ostf(
|
||||
cluster_id=cluster_id, test_sets=['smoke'])
|
||||
|
||||
# Add node with controller role
|
||||
|
||||
self.fuel_web.update_nodes(
|
||||
cluster_id,
|
||||
{
|
||||
'slave-07': ['controller'],
|
||||
}
|
||||
)
|
||||
|
||||
self.fuel_web.deploy_cluster_wait(cluster_id, check_services=False)
|
||||
|
||||
self.fuel_web.run_ostf(
|
||||
cluster_id=cluster_id, test_sets=['smoke'])
|
||||
|
||||
@test(depends_on=[SetupEnvironment.prepare_slaves_5],
|
||||
groups=["dvs_vcenter_destructive_setup", "dvs_vcenter_plugin"])
|
||||
@log_snapshot_after_test
|
||||
|
@ -249,7 +66,8 @@ class TestDVSPlugin(TestBasic):
|
|||
"""
|
||||
self.env.revert_snapshot("ready_with_5_slaves")
|
||||
|
||||
plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())
|
||||
plugin.install_dvs_plugin(
|
||||
self.env.d_env.get_admin_remote())
|
||||
|
||||
# Configure cluster with 2 vcenter clusters and vcenter glance
|
||||
cluster_id = self.fuel_web.create_cluster(
|
||||
|
@ -303,10 +121,14 @@ class TestDVSPlugin(TestBasic):
|
|||
|
||||
"""
|
||||
|
||||
plugin_name = "fuel-plugin-vmware-dvs"
|
||||
|
||||
self.env.revert_snapshot("dvs_vcenter_destructive_setup")
|
||||
|
||||
# Try to uninstall dvs plugin
|
||||
cmd = 'fuel plugins --remove {}==1.1.0'.format(plugin.plugin_name)
|
||||
cmd = 'fuel plugins --remove {0}=={1}'.format(
|
||||
plugin_name, plugin.DVS_PLUGIN_VERSION)
|
||||
|
||||
self.env.d_env.get_admin_remote().execute(cmd)['exit_code'] == 1
|
||||
|
||||
# Check that plugin is not removed
|
||||
|
@ -447,7 +269,8 @@ class TestDVSPlugin(TestBasic):
|
|||
"""
|
||||
self.env.revert_snapshot("ready_with_5_slaves")
|
||||
|
||||
plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())
|
||||
plugin.install_dvs_plugin(
|
||||
self.env.d_env.get_admin_remote())
|
||||
|
||||
# Configure cluster with 2 vcenter clusters and vcenter glance
|
||||
cluster_id = self.fuel_web.create_cluster(
|
||||
|
@ -555,7 +378,8 @@ class TestDVSPlugin(TestBasic):
|
|||
"""
|
||||
self.env.revert_snapshot("ready_with_5_slaves")
|
||||
|
||||
plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())
|
||||
plugin.install_dvs_plugin(
|
||||
self.env.d_env.get_admin_remote())
|
||||
|
||||
# Configure cluster with 2 vcenter clusters and vcenter glance
|
||||
cluster_id = self.fuel_web.create_cluster(
|
||||
|
|
|
@ -50,7 +50,8 @@ class TestDVSPlugin(TestBasic):
|
|||
"""
|
||||
self.env.revert_snapshot("ready_with_9_slaves")
|
||||
|
||||
plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())
|
||||
plugin.install_dvs_plugin(
|
||||
self.env.d_env.get_admin_remote())
|
||||
|
||||
# Configure cluster with 2 vcenter clusters and vcenter glance
|
||||
cluster_id = self.fuel_web.create_cluster(
|
||||
|
|
|
@ -59,7 +59,8 @@ class TestDVSPlugin(TestBasic):
|
|||
"""
|
||||
self.env.revert_snapshot("ready_with_3_slaves")
|
||||
|
||||
plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())
|
||||
plugin.install_dvs_plugin(
|
||||
self.env.d_env.get_admin_remote())
|
||||
|
||||
# Configure cluster with 2 vcenter clusters
|
||||
cluster_id = self.fuel_web.create_cluster(
|
||||
|
@ -71,7 +72,8 @@ class TestDVSPlugin(TestBasic):
|
|||
'images_vcenter': True
|
||||
}
|
||||
)
|
||||
plugin.enable_plugin(cluster_id, self.fuel_web)
|
||||
plugin.enable_plugin(
|
||||
cluster_id, self.fuel_web, multiclusters=False)
|
||||
|
||||
# Assign role to node
|
||||
self.fuel_web.update_nodes(
|
||||
|
@ -125,7 +127,8 @@ class TestDVSPlugin(TestBasic):
|
|||
"""
|
||||
self.env.revert_snapshot("ready_with_9_slaves")
|
||||
|
||||
plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())
|
||||
plugin.install_dvs_plugin(
|
||||
self.env.d_env.get_admin_remote())
|
||||
|
||||
# Configure cluster with 2 vcenter clusters and vcenter glance
|
||||
cluster_id = self.fuel_web.create_cluster(
|
||||
|
@ -164,7 +167,7 @@ class TestDVSPlugin(TestBasic):
|
|||
multiclusters=True
|
||||
)
|
||||
|
||||
self.fuel_web.verify_network(cluster_id)
|
||||
self.fuel_web.verify_network(cluster_id, timeout=60 * 15)
|
||||
self.fuel_web.deploy_cluster_wait(cluster_id)
|
||||
|
||||
self.fuel_web.run_ostf(
|
||||
|
|
|
@ -74,7 +74,8 @@ class TestDVSPlugin(TestBasic):
|
|||
"""
|
||||
self.env.revert_snapshot("ready_with_5_slaves")
|
||||
|
||||
plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())
|
||||
plugin.install_dvs_plugin(
|
||||
self.env.d_env.get_admin_remote())
|
||||
|
||||
# Configure cluster with 2 vcenter clusters and vcenter glance
|
||||
cluster_id = self.fuel_web.create_cluster(
|
||||
|
|
|
@ -72,7 +72,8 @@ class TestNetworkTemplates(TestNetworkTemplatesBase, TestBasic):
|
|||
|
||||
self.env.revert_snapshot("ready_with_9_slaves")
|
||||
|
||||
plugin.install_dvs_plugin(self.env.d_env.get_admin_remote())
|
||||
plugin.install_dvs_plugin(
|
||||
self.env.d_env.get_admin_remote())
|
||||
|
||||
cluster_id = self.fuel_web.create_cluster(
|
||||
name=self.__class__.__name__,
|
||||
|
|
|
@ -260,6 +260,9 @@ CheckVariables() {
|
|||
if [ -z "${VCENTER_CLUSTERS}" ]; then
|
||||
export VCENTER_CLUSTERS="Cluster1,Cluster2"
|
||||
fi
|
||||
if [ -z "${DVS_SWITCHES}" ]; then
|
||||
export DVS_SWITCHES="dvSwitch,dvSwitch2"
|
||||
fi
|
||||
if [ -z "${WORKSTATION_SNAPSHOT}" ]; then
|
||||
export WORKSTATION_SNAPSHOT="vcenterha"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue