def contrail_smoke(self): """Deploy a cluster with Contrail Plugin. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable Contrail plugin 3. Add a node with contrail-controller 4. Add a node with contrail-analytics and contrail-analytics-db roles 4. Add a node with controller role 5. Add a node with compute role 6. Deploy cluster with plugin Duration 90 min """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=5) self.show_step(2) plugin.activate_plugin(self) plugin.show_range(self, 3, 6) self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['contrail-controller'], 'slave-02': ['contrail-analytics', 'contrail-analytics-db'], 'slave-03': ['controller'], 'slave-04': ['compute'], }) self.show_step(6) openstack.deploy_cluster(self) TestContrailCheck(self).cloud_check(['contrail'])
def contrail_smoke(self): """Deploy a cluster with Contrail Plugin Scenario: 1. Revert snapshot "ready_with_3_slaves" 2. Create cluster 3. Add 1 node with contrail-config, contrail-control and contrail-db roles 4. Add a node with controller role 4. Add a node with compute role 6. Enable Contrail plugin 5. Deploy cluster with plugin Duration 90 min """ plugin.prepare_contrail_plugin(self, slaves=3) # enable plugin in contrail settings plugin.activate_plugin(self) self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['contrail-config', 'contrail-control', 'contrail-db'], 'slave-02': ['controller'], 'slave-03': ['compute'], }) # deploy cluster openstack.deploy_cluster(self)
def plugin_smoke(self): """Deploy a cluster with a plugin Scenario: 1. Revert snapshot "ready_with_2_slaves" 2. Create a cluster 3. Add a node with controller role 4. Add a node with compute role 6. Enable a plugin 5. Deploy a cluster with the plugin enabled Duration 90 min """ plugin.prepare_test_plugin(self, slaves=2) # enable plugin in settings plugin.activate_plugin(self) self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller'], 'slave-02': ['compute'], }) # deploy cluster openstack.deploy_cluster(self) self.fuel_web.run_ostf( cluster_id=self.cluster_id, should_fail=2, failed_test_name=[('Check network connectivity from instance via floating IP'),('Launch instance with file injection')] )
def contrail_ceph_multirole(self): """Check deploy contrail with Controller + Ceph multirole. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration and CEPH storage 2. Enable and configure Contrail plugin 3. Add 3 nodes with "controller" + "Ceph-OSD" multirole 4. Add 2 nodes with "compute" role 5. Add a node with 'contrail-controller' role 6. Add 2 nodes with 'contrail-analytics-db', "contrail-analytics" roles 7. Add a node with 'contrail-analytics-db' role 8. Deploy cluster with plugin 9. Run contrail health check tests 10. Run OSTF tests """ self.show_step(1) plugin.prepare_contrail_plugin( self, slaves=9, options={ 'images_ceph': True, 'volumes_ceph': True, 'ephemeral_ceph': True, 'objects_ceph': True, 'volumes_lvm': False }) self.show_step(2) plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 8) self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller', 'ceph-osd'], 'slave-02': ['controller', 'ceph-osd'], 'slave-03': ['controller', 'ceph-osd'], 'slave-04': ['compute'], 'slave-05': ['compute'], 'slave-06': ['contrail-controller'], 'slave-07': ['contrail-analytics-db', 'contrail-analytics'], 'slave-08': ['contrail-analytics-db', 'contrail-analytics'], 'slave-09': ['contrail-analytics-db'] }) self.show_step(8) openstack.deploy_cluster(self) self.show_step(9) TestContrailCheck(self).cloud_check(['contrail']) self.show_step(10) if vsrx_setup_result: self.fuel_web.run_ostf(cluster_id=self.cluster_id, test_sets=['smoke', 'sanity', 'ha'])
def contrail_uninstall(self): """Check that plugin can be removed. Scenario: 1. Install plugin and create cluster with activated plugin. 2. Try to remove plugin and ensure that alert presents in cli: '400 Client Error: Bad Request (Can not delete plugin which is enabled for some environment.)' 3. Remove environment. 4. Remove plugin. 5. Check that it was removed successfully. Duration: 5 min """ # constants plugin_name = 'contrail' message = "400 Client Error: Bad Request for url: " + \ "http://10.109.0.2:8000/api/v1/plugins/1 " + \ "(Can't delete plugin which is enabled for some environment.)" self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=3) plugin.activate_plugin(self) cluster_id = self.fuel_web.get_last_created_cluster() self.show_step(2) cmd = 'fuel plugins --remove {0}=={1}'.format( plugin_name, CONTRAIL_PLUGIN_VERSION) result = self.env.d_env.get_admin_remote().execute(cmd) assert_true( result['exit_code'] == 1, 'Plugin is removed.') assert_true( result['stderr'].pop().splitlines().pop() == message, 'Error message was not displayed.') self.show_step(3) self.fuel_web.delete_env_wait(cluster_id) self.show_step(4) result = self.env.d_env.get_admin_remote().execute(cmd) assert_true( result['exit_code'] == 0, 'Plugin was not removed.') self.show_step(5) cmd = 'fuel plugins list' output = list(self.env.d_env.get_admin_remote().execute( cmd)['stdout']).pop().split(' ') assert_true( plugin_name not in output, "Plugin is not removed {}".format(plugin_name) )
def contrail_add_delete_compute_ceph(self): """Verify that compute node can be added and deleted in env with Ceph. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Add a node with "controller" + "mongo" roles 4. Add 3 nodes with "compute" + "ceph-osd" roles 5. Add a node with all contrail-controller role 6. Add a node with contrail-analytics and contrail-analytics-db 7. Deploy cluster and run OSTF tests 8. Run contrail health check tests 9. Add node with "compute" role 10. Deploy changes and run OSTF tests 11. Run contrail health check tests 12. Delete node with "compute" role 13. Deploy changes and run OSTF tests 14. Run contrail health check tests """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=9, options={ 'images_ceph': True, 'volumes_ceph': True, 'ephemeral_ceph': True, 'objects_ceph': True, 'ceilometer': True, 'volumes_lvm': False}) self.show_step(2) plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 7) conf_no_compute = { 'slave-01': ['controller', 'mongo'], 'slave-02': ['compute', 'ceph-osd'], 'slave-03': ['compute', 'ceph-osd'], 'slave-04': ['compute', 'ceph-osd'], 'slave-05': ['contrail-controller'], 'slave-06': ['contrail-analytics', 'contrail-analytics-db'], # Here slave-7 } conf_compute = {'slave-07': ['compute']} plugin.show_range(self, 7, 9) openstack.update_deploy_check(self, conf_no_compute, is_vsrx=vsrx_setup_result) plugin.show_range(self, 9, 12) openstack.update_deploy_check(self, conf_compute, is_vsrx=vsrx_setup_result) plugin.show_range(self, 12, 15) openstack.update_deploy_check( self, conf_compute, delete=True, is_vsrx=vsrx_setup_result)
def contrail_bvt(self): """BVT test for contrail plugin. Deploy cluster with 1 controller, 1 compute, 3 contrail-config, contrail-control, contrail-db roles and install contrail plugin Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable Contrail plugin 3. Add 2 nodes with contrail-controller role 4. Add 2 nodes with contrail-analytics-db role. 5. Add a node with contrail-analytics + contrail-analytics-db roles 6. Add a node with contrail-analytics + contrail-controller roles 7. Add a node with contrail-analytics role 8. Add a node with with controller role 9. Add a node with compute + cinder role 10. Deploy cluster with plugin 11. Run contrail health check tests 12. Run OSTF tests Duration 110 min """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=9) self.show_step(2) plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 10) self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['contrail-controller'], 'slave-02': ['contrail-controller'], 'slave-03': ['contrail-controller', 'contrail-analytics'], 'slave-04': ['contrail-analytics-db', 'contrail-analytics'], 'slave-05': ['contrail-analytics-db'], 'slave-06': ['contrail-analytics-db'], 'slave-07': ['contrail-analytics'], 'slave-08': ['controller'], 'slave-09': ['compute', 'cinder'] }) self.show_step(10) openstack.deploy_cluster(self) self.show_step(11) TestContrailCheck(self).cloud_check(['contrail']) self.show_step(12) if vsrx_setup_result: self.fuel_web.run_ostf(cluster_id=self.cluster_id, timeout=OSTF_RUN_TIMEOUT)
def contrail_add_ha_analytics_db(self): """Verify that 2 Analytics DB nodes can be added to exist Analytics DB. Scenario: 1. Create an environment 2. Enable and configure Contrail plugin 3. Add a node with controller and cinder role 4. Add 2 nodes with compute role 5. Add 3 nodes with contrail-controller and contrail-analytics roles 6. Add a node with contrail-analytics-db role 7. Deploy cluster 8. Run OSTF tests 9. Run contrail health check tests 10. Add 2 nodes contrail-analytics-db role 11. Deploy cluster 12. Run OSTF tests 13. Run contrail health check tests """ conf_env = { 'slave-01': ['controller', 'cinder'], 'slave-02': ['compute'], 'slave-03': ['compute'], 'slave-04': ['contrail-controller', 'contrail-analytics'], 'slave-05': ['contrail-controller', 'contrail-analytics'], 'slave-06': ['contrail-controller', 'contrail-analytics'], 'slave-07': ['contrail-analytics-db'] } add_analytics_db = { 'slave-08': ['contrail-analytics-db'], 'slave-09': ['contrail-analytics-db'] } self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=9) self.show_step(2) plugin.activate_plugin(self) vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 10) openstack.update_deploy_check(self, conf_env, is_vsrx=vsrx_setup_result) self.show_step(10) TestContrailCheck(self).cloud_check(['contrail']) plugin.show_range(self, 11, 14) openstack.update_deploy_check(self, add_analytics_db, is_vsrx=vsrx_setup_result) self.show_step(14) TestContrailCheck(self).cloud_check(['contrail'])
def contrail_vlan(self): """Check deploy contrail on an environment with vlan-tagging. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Configure VLAN on network interfaces 4. Add 3 nodes with controller role 5. Add 2 nodes with "compute" and "Storage-cinder" roles 6. Add 2 nodes with 'contrail-controller' role 7. Add a node with "contrail-analytics" role 8. Add a node with 'contrail-analytics-db' role 9. Deploy cluster with plugin 10. Run contrail health check tests 11. Run OSTF tests Duration 120 min """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=9) self.show_step(2) plugin.activate_plugin(self) self.show_step(3) openstack.assign_vlan(self, storage=101, management=102) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 4, 9) self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller'], 'slave-02': ['controller'], 'slave-03': ['controller'], 'slave-04': ['compute', 'cinder'], 'slave-05': ['compute', 'cinder'], 'slave-06': ['contrail-controller'], 'slave-07': ['contrail-controller'], 'slave-08': ['contrail-analytics'], 'slave-09': ['contrail-analytics-db'] }) self.show_step(9) openstack.deploy_cluster(self) self.show_step(10) TestContrailCheck(self).cloud_check(['contrail']) self.show_step(11) if vsrx_setup_result: self.fuel_web.run_ostf( cluster_id=self.cluster_id, test_sets=['smoke', 'sanity', 'ha'])
def contrail_plugin_add_delete_controller_node(self): """Verify that Controller node can be deleted and added after deploying. Scenario: 1. Create an environment 2. Enable and configure Contrail plugin 3. Add 3 controllers, a compute and a storage nodes 4. Add node with "contrail-analytics" role 5. Add a node with "contrail-controller" role 6. Add a node with "contrail-analytics-db" role 7. Deploy cluster 8. Run OSTF tests 9. Run contrail health check test 10. Delete a Controller node and deploy changes 11. Run OSTF tests 12. Run contrail health check test 13. Add a node with "Controller" role and deploy changes 14. Run OSTF tests 15. Run contrail health check test """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=9) self.show_step(2) plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 7) conf_no_controller = { 'slave-01': ['controller'], 'slave-02': ['controller'], # Here slave-03 'slave-04': ['cinder'], 'slave-05': ['compute'], 'slave-06': ['contrail-controller'], 'slave-07': ['contrail-analytics'], 'slave-08': ['contrail-analytics-db'], } conf_ctrl = {'slave-03': ['controller']} plugin.show_range(self, 7, 10) openstack.update_deploy_check(self, dict(conf_no_controller, **conf_ctrl), is_vsrx=vsrx_setup_result) plugin.show_range(self, 10, 13) openstack.update_deploy_check(self, conf_ctrl, delete=True, is_vsrx=vsrx_setup_result) plugin.show_range(self, 13, 16) openstack.update_deploy_check(self, conf_ctrl, is_vsrx=vsrx_setup_result)
def contrail_cinder_ceph_multirole(self): """Check deploy contrail with Controller + Cinder + Ceph multirole Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration and CEPH storage 2. Enable and configure Contrail plugin 3. Add 1 node with "controller" + "storage-cinder" + "Ceph-OSD" multirole 4. Add 1 node with "controller" + "storage-cinder" and 1 node with "controller" + "Ceph-OSD" multiroles 5. Add 2 nodes with "compute" role 6. Add 3 nodes with "contrail-config", "contrail-control" and "contrail-db" roles 7. Deploy cluster with plugin 8. Run OSTF tests """ plugin.prepare_contrail_plugin( self, slaves=9, options={'images_ceph': True} ) # enable plugin in contrail settings plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = plugin.activate_vsrx() self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller', 'cinder', 'ceph-osd'], 'slave-02': ['controller', 'cinder'], 'slave-03': ['controller', 'ceph-osd'], 'slave-04': ['compute'], 'slave-05': ['compute'], 'slave-06': ['contrail-config', 'contrail-control', 'contrail-db'], 'slave-07': ['contrail-config', 'contrail-control', 'contrail-db'], 'slave-08': ['contrail-config', 'contrail-control', 'contrail-db'] }) # deploy cluster openstack.deploy_cluster(self) # run OSTF tests if vsrx_setup_result: self.fuel_web.run_ostf(cluster_id=self.cluster_id)
def contrail_ceilometer(self): """Check deploy environment with Contrail and Ceilometer Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration and CEPH storage 2. Enable and configure Contrail plugin 3. Add 2 nodes with "controller" role 4. Add a node with "controller" + "MongoDB" multirole 5. Add a node with "compute"+"ceph-OSD"+"cinder" multiroles 6. Add node with "compute" + "ceph-OSD" + " MongoDB" multiroles 7. Add a node with "MongoDB" role 8. Add a node with "contrail-config", "contrail-control" and "contrail-db" roles 9. Deploy cluster with plugin 10. Run OSTF tests Duration 120 min """ plugin.prepare_contrail_plugin( self, slaves=9, options={'images_ceph': True, 'ceilometer': True}) # enable plugin in contrail settings plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = plugin.activate_vsrx() self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller'], 'slave-02': ['controller'], 'slave-03': ['controller', 'mongo'], 'slave-04': ['compute', 'ceph-osd', 'mongo'], 'slave-05': ['compute', 'ceph-osd', 'cinder'], 'slave-06': ['mongo'], 'slave-07': ['contrail-config', 'contrail-control', 'contrail-db'], }) # deploy cluster openstack.deploy_cluster(self) if vsrx_setup_result: self.fuel_web.run_ostf( cluster_id=self.cluster_id, test_sets=['smoke', 'sanity', 'ha', 'tests_platform'],)
def contrail_ostf_net_provisioning_disable(self): """Check gateway in private network for single nodegroup deployment Scenario: 1. Create an environment 2. Enable and configure Contrail plugin 3. Create new netwotk between vSRX ana private network 4. Deploy cluster with following node configuration: * 3 controller+ceph-osd * 2 compute * Contrail-controller + contrail-analytics * Contrail-analytics + contrail-analytics-db 5. Run OSTF tests 6. Run contrail health check tests """ conf_contrail = { 'contrail_single_gateway': '10.109.4.1', 'contrail_gateways': '10.109.5.250' } conf_env = { 'slave-01': ['controller', 'ceph-osd'], 'slave-02': ['controller', 'ceph-osd'], 'slave-03': ['controller', 'ceph-osd'], 'slave-04': ['compute'], 'slave-05': ['compute'], 'slave-06': ['contrail-controller', 'contrail-analytics'], 'slave-07': ['contrail-analytics', 'contrail-analytics-db'], } self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=9, options={ 'images_ceph': True, 'volumes_ceph': True, 'ephemeral_ceph': True, 'objects_ceph': True, 'volumes_lvm': False }) self.show_step(2) plugin.activate_plugin(self, **conf_contrail) self.show_step(3) vsrx_setup_result = vsrx.activate(separate_net=True) plugin.show_range(self, 4, 7) openstack.update_deploy_check(self, conf_env, is_vsrx=vsrx_setup_result)
def contrail_update_core_repos(self): """Check updating core repos with Contrail plugin. Scenario: 1. Deploy cluster with Contrail plugin 2. Run 'fuel-mirror create -P ubuntu -G mos ubuntu' on the master node 3. Run 'fuel-mirror apply -P ubuntu -G mos ubuntu --env <env_id> --replace' on the master node 4. Update repos for all deployed nodes with command "fuel --env <env_id> node --node-id 1,2,3,4,5,6,7,9,10 --tasks setup_repositories" on the master node 5. Run OSTF and check Contrail node status. """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=5) plugin.activate_plugin(self) vsrx_setup_result = vsrx.activate() conf_nodes = { 'slave-01': ['controller'], 'slave-02': ['compute', 'cinder'], 'slave-03': ['contrail-controller'], 'slave-04': ['contrail-analytics'], 'slave-05': ['contrail-analytics-db'] } self.fuel_web.update_nodes(self.cluster_id, conf_nodes) openstack.deploy_cluster(self) plugin.show_range(self, 2, 5) nodes = self.fuel_web.client.list_cluster_nodes(self.cluster_id) node_ids = ','.join([str(node['id']) for node in nodes]) commands = [ 'fuel-mirror create -P ubuntu -G mos ubuntu', ('fuel-mirror apply -P ubuntu -G mos ubuntu ' '--env {0} --replace'.format(self.cluster_id)), ('fuel --env {0} node --node-id {1} ' '--tasks setup_repositories'.format(self.cluster_id, node_ids)) ] for cmd in commands: logger.info("Execute commmand: '{0}' om master node.".format(cmd)) result = self.env.d_env.get_admin_remote().execute(cmd) asserts.assert_equal( result['exit_code'], 0, 'Command "{0}" fails with message: "{1}".'.format( cmd, result['stderr'])) if vsrx_setup_result: self.show_step(5) self.fuel_web.run_ostf(cluster_id=self.cluster_id) TestContrailCheck(self).cloud_check(['contrail'])
def contrail_plugin_add_delete_compute_node(self): """Verify that Compute node can be deleted and added after deploying Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration and CEPH storage 2. Enable and configure Contrail plugin 3. Add some controller, compute + storage (at least 4) nodes 4. Add a node with "contrail-db", "contarail-config" and "contrail-control" roles 5. Deploy cluster 6. Run OSTF tests 7. Delete a compute node and deploy changes 8. Run OSTF tests 9. Add a node with "compute" role and deploy changes 10. Run OSTF tests """ plugin.prepare_contrail_plugin(self, slaves=9) # enable plugin in contrail settings plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = plugin.activate_vsrx() conf_no_controller = { 'slave-01': ['controller'], 'slave-02': ['controller'], 'slave-03': ['controller'], 'slave-04': ['controller'], 'slave-05': ['compute', 'cinder'], 'slave-06': ['compute', 'cinder'], 'slave-07': ['compute', 'cinder'], # Here slave-8 'slave-09': ['contrail-db', 'contrail-config', 'contrail-control'], } conf_compute = {'slave-08': ['compute', 'cinder']} openstack.update_deploy_check(self, dict(conf_no_controller, **conf_compute), is_vsrx=vsrx_setup_result) openstack.update_deploy_check(self, conf_compute, delete=True, is_vsrx=vsrx_setup_result) openstack.update_deploy_check(self, conf_compute, is_vsrx=vsrx_setup_result)
def contrail_plugin_add_delete_controller_node(self): """Verify that Controller node can be deleted and added after deploying Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Add some controller (at least 3), compute and storage nodes 4. Add 3 nodes with "contrail-db", "contarail-config" and "contrail-control" roles on all nodes 5. Deploy cluster 6. Run OSTF tests 7. Delete a Controller node and deploy changes 8. Run OSTF tests 9. Add a node with "Controller" role and deploy changes 10. Run OSTF tests. All steps must be completed successfully, without any errors. """ plugin.prepare_contrail_plugin(self, slaves=9) # enable plugin in contrail settings plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = plugin.activate_vsrx() conf_no_controller = { 'slave-01': ['controller'], 'slave-02': ['controller'], # Here slave-03 'slave-04': ['compute'], 'slave-05': ['cinder'], 'slave-06': ['contrail-db', 'contrail-config', 'contrail-control'], 'slave-07': ['contrail-db', 'contrail-config', 'contrail-control'], 'slave-08': ['contrail-db', 'contrail-config', 'contrail-control'], } conf_ctrl = {'slave-03': ['controller']} openstack.update_deploy_check(self, dict(conf_no_controller, **conf_ctrl), is_vsrx=vsrx_setup_result) openstack.update_deploy_check(self, conf_ctrl, delete=True, is_vsrx=vsrx_setup_result) openstack.update_deploy_check(self, conf_ctrl, is_vsrx=vsrx_setup_result)
def contrail_ostf_net_provisioning_off(self): """Verify that we can disable OSTF networks provisioning. Scenario: 1. Create an environment 2. Enable and configure Contrail plugin without OSTF network provisioning 3. Add a controller and a compute+cinder nodes 4. Add a node with "contrail-controller" role 5. Add a "contrail-analytics-db"+"contrail-analytics" node 6. Deploy cluster 7. Run OSTF tests 8. Check Controller and Contrail nodes status """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=5) self.show_step(2) # Disable OSTF networks provisioning opts = { 'provision_networks': False, } plugin.activate_plugin(self, **opts) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 6) conf_nodes = { 'slave-01': ['controller'], 'slave-02': ['compute', 'cinder'], 'slave-03': ['contrail-controller'], 'slave-04': ['contrail-analytics-db', 'contrail-analytics'] } plugin.show_range(self, 6, 8) should_fails = [ 'Create volume and boot instance from it', 'Launch instance, create snapshot, launch instance from snapshot', 'Launch instance with file injection', 'Launch instance', 'Create volume and attach it to instance', 'Check network connectivity from instance via floating IP'] openstack.update_deploy_check( self, conf_nodes, is_vsrx=vsrx_setup_result, ostf_fail_tests=should_fails)
def contrail_vlan(self): """Check deploy contrail on an environment with vlan-tagging Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Add 3 nodes with controller role 4. Add 2 nodes with "compute" and "Storage-cinder" roles 5. Add a node with "contrail-config" and "contrail-db" roles 6. Add a node with "contrail-db", "contrail-control" roles 7. Add a node with "contrail-db" role 8. Configure VLAN on network interfaces 9. Deploy cluster with plugin 10. Run OSTF tests Duration 120 min """ plugin.prepare_contrail_plugin(self, slaves=9) # enable plugin in contrail settings plugin.activate_plugin(self) # configure vlan on storage and management interfaces openstack.assign_vlan(self, storage=101, management=102) # activate vSRX image vsrx_setup_result = plugin.activate_vsrx() self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller'], 'slave-02': ['controller'], 'slave-03': ['controller'], 'slave-04': ['compute', 'cinder'], 'slave-05': ['compute', 'cinder'], 'slave-06': ['contrail-config', 'contrail-db'], 'slave-07': ['contrail-control', 'contrail-db'], 'slave-08': ['contrail-db'], }) # deploy cluster openstack.deploy_cluster(self) if vsrx_setup_result: self.fuel_web.run_ostf( cluster_id=self.cluster_id, test_sets=['smoke', 'sanity', 'ha'])
def systest_setup(self): """Setup for system test suite. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable Contrail plugin 3. Add 1 node with contrail-controller, contrail-analytic roles 4. Add a node with controller, mongo roles 5. Add a node with compute role 6. Add a node contrail-analytics-db role 7. Deploy cluster with plugin 8. Run OSTF. Duration 90 min """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=5, options={'ceilometer': True}) # activate vSRX image vsrx_setup_result = vsrx.activate() self.show_step(2) plugin.activate_plugin(self) plugin.show_range(self, 3, 7) self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['contrail-controller', 'contrail-analytics'], 'slave-02': ['controller', 'mongo'], 'slave-03': ['compute'], 'slave-04': ['compute'], 'slave-05': ['contrail-analytics-db'], }) self.show_step(7) openstack.deploy_cluster(self) self.show_step(8) if vsrx_setup_result: self.fuel_web.run_ostf( cluster_id=self.cluster_id, test_sets=['smoke', 'sanity', 'tests_platform'], timeout=OSTF_RUN_TIMEOUT) TestContrailCheck(self).cloud_check(['contrail']) self.env.make_snapshot("systest_setup", is_make=True)
def contrail_delete_analytics(self): """Verify that Contrail analytics role can be deleted after deploying. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Add a controller and a compute+cinder nodes 4. Add a node with "contrail-controller" role 5. Add a node with "contrail-analytics" and "contrail-analytics-db" roles 6. Add a node with "contrail-analytics" role 7. Deploy cluster 8. Run OSTF tests 9. Run contrail health check tests 10. Delete one "contrail-analytics" role 11. Deploy changes 12. Run OSTF tests 13. Run contrail health check tests """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=5) self.show_step(2) plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 7) conf_no_config = { 'slave-01': ['controller'], 'slave-02': ['compute', 'cinder'], 'slave-03': ['contrail-controller'], # Here slave-4 'slave-05': ['contrail-analytics', 'contrail-analytics-db'], } conf_config = {'slave-04': ['contrail-analytics']} plugin.show_range(self, 7, 10) openstack.update_deploy_check(self, dict(conf_no_config, **conf_config), is_vsrx=vsrx_setup_result) plugin.show_range(self, 10, 14) openstack.update_deploy_check(self, conf_config, delete=True, is_vsrx=vsrx_setup_result)
def contrail_cinder_multirole(self): """Check deploy contrail with Controller + Cinder multirole. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Add 3 nodes with "controller" + "storage-cinder" multirole 4. Add 2 nodes with "compute" role 5. Add 2 node with 'contrail-controller', "contrail-analytics" roles 6. Add a node with 'contrail-analytics-db' role 7. Deploy cluster with plugin 8. Run contrail health check tests 9. Run OSTF tests """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=9) self.show_step(2) plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 7) self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller', 'cinder'], 'slave-02': ['controller', 'cinder'], 'slave-03': ['controller', 'cinder'], 'slave-04': ['compute'], 'slave-05': ['compute'], 'slave-06': ['contrail-controller', 'contrail-analytics'], 'slave-07': ['contrail-analytics', 'contrail-controller'], 'slave-08': ['contrail-analytics-db'] }) self.show_step(7) openstack.deploy_cluster(self) self.show_step(8) TestContrailCheck(self).cloud_check(['contrail']) self.show_step(9) if vsrx_setup_result: self.fuel_web.run_ostf(cluster_id=self.cluster_id, test_sets=['smoke', 'sanity', 'ha'])
def contrail_ha_baseos(self): """Check deploy HA-contrail on an environment with a base-os node Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Add a node with controller role 4. Add 2 nodes with "compute" and "Storage-cinder" roles 5. Add a node with Base-OS role 6. Add 3 nodes with "contrail-config", "contrail-control" and "contrail-db" roles 7. Deploy cluster with plugin 8. Run OSTF tests Duration 120 min """ plugin.prepare_contrail_plugin(self, slaves=9) # enable plugin in contrail settings plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = plugin.activate_vsrx() self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller'], 'slave-02': ['compute', 'cinder'], 'slave-03': ['compute', 'cinder'], 'slave-04': ['base-os'], 'slave-05': ['contrail-config', 'contrail-control', 'contrail-db'], 'slave-06': ['contrail-config', 'contrail-control', 'contrail-db'], 'slave-07': ['contrail-config', 'contrail-control', 'contrail-db'], }) # deploy cluster openstack.deploy_cluster(self) if vsrx_setup_result: self.fuel_web.run_ostf(cluster_id=self.cluster_id)
def contrail_ha_baseos(self): """Check deploy HA-contrail on an environment with a base-os node. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Add a node with controller role 4. Add 2 nodes with "compute" and "Storage-cinder" roles 5. Add a node with Base-OS role 6. Add a node with 'contrail-controller', "contrail-analytics" roles 7. Add a node with "contrail-analytics","contrail-analytics-db" role 8. Deploy cluster with plugin 9. Run contrail health check tests 10. Run OSTF tests Duration 120 min """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=9) self.show_step(2) plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 8) self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller'], 'slave-02': ['compute', 'cinder'], 'slave-03': ['compute', 'cinder'], 'slave-04': ['base-os'], 'slave-05': ['contrail-controller', 'contrail-analytics'], 'slave-06': ['contrail-analytics-db', 'contrail-analytics'], }) self.show_step(8) openstack.deploy_cluster(self) self.show_step(9) TestContrailCheck(self).cloud_check(['contrail']) self.show_step(10) if vsrx_setup_result: self.fuel_web.run_ostf(cluster_id=self.cluster_id)
def contrail_bvt(self): """BVT test for contrail plugin Deploy cluster with 1 controller, 1 compute, 3 contrail-config, contrail-control, contrail-db roles and install contrail plugin Scenario: 1. Revert snapshot "ready_with_9_slaves" 2. Create cluster 3. Add 3 nodes with contrail-db role 4. Add a node with contrail-config role 5. Add a node with contrail-control role 6. Add a node with with controller role 7. Add a node with compute + cinder role 8. Enable Contrail plugin 9. Deploy cluster with plugin 10. Create net and subnet 11. Run OSTF tests Duration 110 min """ plugin.prepare_contrail_plugin(self, slaves=9) # enable plugin in contrail settings plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = plugin.activate_vsrx() self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['contrail-config'], 'slave-02': ['contrail-control'], 'slave-03': ['contrail-db'], 'slave-04': ['contrail-db'], 'slave-05': ['contrail-db'], 'slave-06': ['controller'], 'slave-07': ['compute', 'cinder'], }) # deploy cluster openstack.deploy_cluster(self) if vsrx_setup_result: self.fuel_web.run_ostf(cluster_id=self.cluster_id)
def contrail_add_analytics(self): """Verify that Contrail-Analytics role can be added after deploy. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Add a controller and a compute+cinder nodes 4. Add a node with "contrail-controller" role 5. Add a "contrail-analytics-db"+"contrail-analytics" node 6. Deploy cluster 7. Run OSTF tests 8. Run contrail health check tests 9. Add one node with "contrail-analytics" role 10. Deploy changes 11. Run OSTF tests 12. Run contrail health check tests """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=5) self.show_step(2) plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 6) conf_nodes = { 'slave-01': ['controller'], 'slave-02': ['compute', 'cinder'], 'slave-03': ['contrail-controller'], 'slave-04': ['contrail-analytics-db', 'contrail-analytics'], } conf_config = {'slave-05': ['contrail-analytics']} plugin.show_range(self, 6, 9) openstack.update_deploy_check(self, conf_nodes, is_vsrx=vsrx_setup_result) plugin.show_range(self, 9, 13) openstack.update_deploy_check(self, conf_config, is_vsrx=vsrx_setup_result)
def contrail_ha(self): """Check Contrail deploy on HA environment Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration and CEPH storage 2. Enable and configure Contrail plugin 3. Add 3 nodes with controller role 4. Add 2 nodes with "compute" and "Ceph-OSD" roles 5. Add a node with contrail-config role 6. Add a node with contrail-control role 7. Add a node with contrail-db role 8. Deploy cluster with plugin 9. Run OSTF tests Duration 120 min """ plugin.prepare_contrail_plugin( self, slaves=9, options={'images_ceph': True} ) # enable plugin in contrail settings plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = plugin.activate_vsrx() self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller'], 'slave-02': ['controller'], 'slave-03': ['controller'], 'slave-04': ['compute', 'ceph-osd'], 'slave-05': ['compute', 'ceph-osd'], 'slave-06': ['contrail-config'], 'slave-07': ['contrail-control'], 'slave-08': ['contrail-db'], }) # deploy cluster openstack.deploy_cluster(self) if vsrx_setup_result: self.fuel_web.run_ostf(cluster_id=self.cluster_id)
def contrail_add_config(self): """Verify that Contrail config role can be added after deploying Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Add some controller, compute nodes 4. Add 1 node with "contrail-control", "contrail-config" and "contrail-db" roles 5. Deploy cluster 6. Run OSTF tests 7. Check Controller and Contrail nodes status 8. Add one node with "contrail-config" role 9. Deploy changes 10. Run OSTF tests 11. Check Controller and Contrail nodes status """ plugin.prepare_contrail_plugin(self, slaves=5) # enable plugin in contrail settings plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = plugin.activate_vsrx() conf_nodes = { 'slave-01': ['controller'], 'slave-02': ['compute'], 'slave-03': ['contrail-control', 'contrail-config', 'contrail-db'], } conf_config = {'slave-04': ['contrail-config']} openstack.update_deploy_check(self, conf_nodes, is_vsrx=vsrx_setup_result) openstack.update_deploy_check(self, conf_config, is_vsrx=vsrx_setup_result)
def contrail_sriov_update_core_repos(self): """Check updating core repos with Contrail plugin and SRIOV. Scenario: 1. Deploy cluster with with following node configuration: node-01: 'controller'; node-02: 'compute', 'cinder'; node-03: 'contrail-controller'; node-04: 'contrail-analytics'; node-05: 'contrail-analytics-db'; 2. Run 'fuel-mirror create -P ubuntu -G mos ubuntu' on the master node 3. Run 'fuel-mirror apply -P ubuntu -G mos ubuntu --env <env_id> --replace' on the master node 4. Update repos for all deployed nodes with command "fuel --env <env_id> node --node-id 1,2,3,4,5,6,7,9,10 --tasks setup_repositories" on the master node 5. Run OSTF and check Contrail node status. """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=5) self.bm_drv.host_prepare() # enable plugin plugin.activate_plugin(self) vsrx_setup_result = vsrx.activate() self.bm_drv.setup_fuel_node(self, cluster_id=self.cluster_id, roles=['compute']) conf_nodes = { 'slave-01': ['controller'], 'slave-02': ['compute', 'cinder'], 'slave-03': ['contrail-controller'], 'slave-04': ['contrail-analytics'], 'slave-05': ['contrail-analytics-db'], } self.fuel_web.update_nodes(self.cluster_id, conf_nodes) self.bm_drv.update_vm_node_interfaces(self, self.cluster_id) # Enable SRIOV on interface openstack.enable_sriov(self) openstack.deploy_cluster(self) plugin.show_range(self, 2, 5) nodes = self.fuel_web.client.list_cluster_nodes(self.cluster_id) node_ids = ','.join([str(node['id']) for node in nodes]) commands = [ 'fuel-mirror create -P ubuntu -G mos ubuntu', ('fuel-mirror apply -P ubuntu -G mos ubuntu ' '--env {0} --replace'.format(self.cluster_id)), ('fuel --env {0} node --node-id {1} ' '--tasks setup_repositories'.format(self.cluster_id, node_ids)) ] for cmd in commands: logger.info("Execute commmand: '{0}' om master node.".format(cmd)) result = self.env.d_env.get_admin_remote().execute(cmd) asserts.assert_equal( result['exit_code'], 0, 'Command "{0}" fails with message: "{1}".'.format( cmd, result['stderr'])) if vsrx_setup_result: self.show_step(5) self.fuel_web.run_ostf( cluster_id=self.cluster_id, should_fail=1, failed_test_name=[ 'Check network connectivity from SRIOV ' 'instance via floating IP']) TestContrailCheck(self).cloud_check(['contrail'])
def contrail_sriov_delete_sriov(self): """Verify that SRiOV role can be deleted after deploying. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Deploy cluster with following node configuration: node-01: 'controller'; node-02: 'controller'; node-03: 'controller', 'cinder'; node-04: 'contrail-controller'; node-05: 'contrail-analytics'; node-06: 'contrail-analytics-db'; node-07: 'compute'; node-08: 'compute'; node-09: 'contrail-analytics-db'; node-bm: 'compute'(sriov); 4. Run OSTF tests 5. Run contrail health check tests 6. Delete node-bm with 'compute'(sriov) role 7. Deploy changes 8. Run OSTF tests 9. Run contrail health check tests """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=9) self.bm_drv.host_prepare() self.show_step(2) # enable plugin plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = vsrx.activate() self.show_step(3) self.bm_drv.setup_fuel_node(self, cluster_id=self.cluster_id, roles=['compute']) conf_no_dpdk = { 'slave-01': ['controller'], 'slave-02': ['controller'], 'slave-03': ['controller', 'cinder'], 'slave-04': ['contrail-controller'], 'slave-05': ['contrail-analytics'], 'slave-06': ['contrail-analytics-db'], 'slave-07': ['compute'], 'slave-08': ['compute'], 'slave-09': ['contrail-analytics-db'], } self.fuel_web.update_nodes( self.cluster_id, nodes_dict=conf_no_dpdk, update_interfaces=False) self.bm_drv.update_vm_node_interfaces(self, self.cluster_id) # Enable SRIOV on interface openstack.enable_sriov(self) # Deploy cluster openstack.deploy_cluster(self) # Run OSTF tests self.show_step(4) if vsrx_setup_result: self.fuel_web.run_ostf( cluster_id=self.cluster_id, should_fail=1, failed_test_name=[ 'Check network connectivity from SRIOV ' 'instance via floating IP']) self.show_step(5) TestContrailCheck(self).cloud_check(['sriov', 'contrail']) self.show_step(6) self.bm_drv.setup_fuel_node(self, cluster_id=self.cluster_id, roles=['compute'], pending_deletion=True, pending_addition=False) self.show_step(7) openstack.deploy_cluster(self) self.show_step(8) if vsrx_setup_result: self.fuel_web.run_ostf( cluster_id=self.cluster_id, should_fail=1, failed_test_name=['Check that required services are running'] ) self.show_step(9) TestContrailCheck(self).cloud_check(['contrail'])
def contrail_sriov_add_sriov(self): """Verify that SRiOV role can be added after deploying. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Deploy cluster with following node configuration: node-01: 'controller', 'ceph-osd'; node-02: 'contrail-controller'; node-03: 'contrail-analytics', 'contrail-analytics-db'; node-04: 'compute', 'ceph-osd'; node-05: 'compute', 'ceph-osd'; 4. Run OSTF tests 5. Run contrail health check tests 6. Add one node with following configuration: node-bm: "compute"(sriov); 7. Deploy changes 8. Run OSTF tests 9. Run contrail health check tests """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=9, options={'images_ceph': True}) self.bm_drv.host_prepare() self.show_step(2) # enable plugin plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 5) conf_nodes = { 'slave-01': ['controller', 'ceph-osd'], 'slave-02': ['contrail-controller'], 'slave-03': ['contrail-analytics-db', 'contrail-analytics'], 'slave-04': ['compute', 'ceph-osd'], 'slave-05': ['compute', 'ceph-osd'], } self.fuel_web.update_nodes( self.cluster_id, nodes_dict=conf_nodes, update_interfaces=False) self.bm_drv.update_vm_node_interfaces(self, self.cluster_id) openstack.assign_vlan(self, storage=102, management=101) # Deploy cluster openstack.deploy_cluster(self) # Run OSTF tests if vsrx_setup_result: self.fuel_web.run_ostf(cluster_id=self.cluster_id) TestContrailCheck(self).cloud_check(['contrail']) self.show_step(6) self.bm_drv.setup_fuel_node(self, cluster_id=self.cluster_id, roles=['compute']) # Enable SRIOV on interface openstack.enable_sriov(self) self.show_step(7) openstack.deploy_cluster(self) self.show_step(8) if vsrx_setup_result: self.fuel_web.run_ostf( cluster_id=self.cluster_id, should_fail=1, failed_test_name=[ 'Check network connectivity from SRIOV ' 'instance via floating IP']) self.show_step(9) TestContrailCheck(self).cloud_check(['sriov', 'contrail'])
def contrail_ha_sriov(self): """Check Contrail deploy on HA environment. Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration and CEPH storage 2. Enable and configure Contrail plugin 3. Deploy cluster with following node configuration: node-01: 'controller'; node-02: 'controller'; node-03: 'controller', 'ceph-osd'; node-04: 'compute', 'ceph-osd'; node-05: 'compute', 'ceph-osd'; node-06: 'contrail-controller'; node-07: 'contrail-analytics'; node-08: 'contrail-analytics-db'; node-sriov: 'compute'; 4. Run OSTF tests 5. Run contrail health check tests Duration 120 min """ self.show_step(1) plugin.prepare_contrail_plugin(self, slaves=9, options={'images_ceph': True, 'volumes_ceph': True, 'ephemeral_ceph': True, 'objects_ceph': True, 'volumes_lvm': False}) self.bm_drv.host_prepare() self.show_step(2) # enable plugin plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = vsrx.activate() plugin.show_range(self, 3, 4) self.bm_drv.setup_fuel_node(self, cluster_id=self.cluster_id, roles=['compute']) conf_nodes = { 'slave-01': ['controller'], 'slave-02': ['controller'], 'slave-03': ['controller', 'ceph-osd'], 'slave-04': ['compute', 'ceph-osd'], 'slave-05': ['compute', 'ceph-osd'], 'slave-06': ['contrail-controller'], 'slave-07': ['contrail-analytics'], 'slave-08': ['contrail-analytics-db'], } # Cluster configuration self.fuel_web.update_nodes(self.cluster_id, nodes_dict=conf_nodes, update_interfaces=False) self.bm_drv.update_vm_node_interfaces(self, self.cluster_id) # Enable SRIOV on interface openstack.enable_sriov(self) # Deploy cluster openstack.deploy_cluster(self) # Run OSTF tests if vsrx_setup_result: self.fuel_web.run_ostf( cluster_id=self.cluster_id, test_sets=['smoke', 'sanity', 'ha'], should_fail=2, failed_test_name=[ 'Instance live migration', 'Check network connectivity from SRIOV instance via' ' floating IP']) self.show_step(5) TestContrailCheck(self).cloud_check(['sriov', 'contrail'])
def contrail_jumbo(self): """Check deploy contrail on an environment with jumbo-frames support Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Add a node with controller role 4. Add 2 nodes with "compute" and "Storage-Ceph OSD" roles 5. Add a node with "contrail-config", "contrail-control" and "contrail-db" roles 6. Add 2 nodes with "contrail-config", "contrail-control" roles 7. Configure MTU on network interfaces (Jumbo-frames) 8. Deploy cluster with plugin 9. Run OSTF tests Duration 120 min """ plugin.prepare_contrail_plugin( self, slaves=9, options={'images_ceph': True} ) jumbo = TestJumboFrames() devops_env = self.env.d_env private_bridge = devops_env.get_network(name='private').bridge_name() logger.info("Search for {0} interfaces for update". format(private_bridge)) # find private bridge interface bridge_interfaces = jumbo.get_host_bridge_ifaces(private_bridge) logger.info("Found {0} interfaces for update: {1}" .format(len(bridge_interfaces), bridge_interfaces)) # set MTU 9000 to private bridge interface for iface in bridge_interfaces: jumbo.set_host_iface_mtu(iface, 9000) logger.info("MTU of {0} was changed to 9000".format(iface)) logger.debug("New {0} interface properties:\n{1}" .format(iface, jumbo.get_host_iface(iface))) # enable plugin in contrail settings plugin.activate_plugin(self) interfaces = { 'eth0': ['fuelweb_admin'], 'eth1': ['public'], 'eth2': ['management'], 'eth3': ['private'], 'eth4': ['storage'], } interfaces_update = [{ 'name': 'eth3', 'interface_properties': { 'mtu': 9000, 'disable_offloading': False }, }] # activate vSRX image vsrx_setup_result = plugin.activate_vsrx() self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller'], 'slave-02': ['compute', 'ceph-osd'], 'slave-03': ['compute', 'ceph-osd'], 'slave-04': ['contrail-config', 'contrail-control', 'contrail-db'], 'slave-05': ['contrail-config', 'contrail-control'], 'slave-06': ['contrail-config', 'contrail-control'], }) slave_nodes = \ self.fuel_web.client.list_cluster_nodes(self.cluster_id) for node in slave_nodes: self.fuel_web.update_node_networks( node['id'], interfaces, override_ifaces_params=interfaces_update) # deploy cluster openstack.deploy_cluster(self) if vsrx_setup_result: self.fuel_web.run_ostf(cluster_id=self.cluster_id) for node_name in ['slave-01', 'slave-02', 'slave-03', 'slave-04', 'slave-05', 'slave-06']: node = self.fuel_web.get_nailgun_node_by_name(node_name) with self.env.d_env.get_ssh_to_remote(node['ip']) as remote: asserts.assert_true( jumbo.check_node_iface_mtu(remote, "eth3", 9000), "MTU on {0} is not 9000. Actual value: {1}" .format(remote.host, jumbo.get_node_iface(remote, "eth3")))
def contrail_bonding(self): """Check deploy contrail with aggregation of network interfaces Scenario: 1. Create an environment with "Neutron with tunneling segmentation" as a network configuration 2. Enable and configure Contrail plugin 3. Add 3 nodes with controller role 4. Add 2 nodes with "compute" roles 5. Add 3 nodes with "contrail-config", "contrail-control" and "contrail-db" roles 6. Bond network interfaces with balance-rr mode 7. Deploy cluster with plugin 8. Run OSTF tests Duration 120 min """ plugin.prepare_contrail_plugin(self, slaves=9) # enable plugin in contrail settings plugin.activate_plugin(self) # configure vlan on storage and management interfaces openstack.assign_vlan(self, private=101, storage=102) self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller'], 'slave-02': ['controller'], 'slave-03': ['controller'], 'slave-04': ['compute'], 'slave-05': ['compute'], 'slave-06': ['contrail-config', 'contrail-control', 'contrail-db'], 'slave-07': ['contrail-config', 'contrail-control', 'contrail-db'], 'slave-08': ['contrail-config', 'contrail-control', 'contrail-db'], }, ) cluster_nodes = self.fuel_web.client.list_cluster_nodes(self.cluster_id) for node in cluster_nodes: self.fuel_web.update_node_networks( node['id'], interfaces_dict=deepcopy(plugin.INTERFACES), raw_data=deepcopy(plugin.BOND_CONFIG)) openstack.deploy_cluster(self) # TODO # Tests using north-south connectivity are expected to fail because # they require additional gateway nodes, and specific contrail # settings. This mark is a workaround until it's verified # and tested manually. # When it will be done 'should_fail=2' and # 'failed_test_name' parameter should be removed. self.fuel_web.run_ostf( cluster_id=self.cluster_id, test_sets=['smoke', 'sanity', 'ha'], timeout=45*60, should_fail=2, failed_test_name=[('Check network connectivity ' 'from instance via floating IP'), ('Launch instance with file injection')] )
def contrail_net_template(self): """Deploy cluster with Contrail plugin and network template Scenario: 1. Configure interfaces 2. Next we need to set gateway for private network with Fuel CLI: * Login with ssh to Fuel master node. * List existing network-groups fuel network-group --env 1 3. Remove and create again network-group *private* to set a gateway fuel network-group --delete --network 5 fuel network-group --create --name / private --cidr 10.109.3.0/24 --gateway 10.109.3.1 --nodegroup 1 4. Set the ``render_addr_mask`` parameter to `internal` for this network by typing: fuel network-group --set --network 6 --meta '{"name": "private", "notation": "cidr", "render_type": null, "map_priority": 2, "configurable": true, "use_gateway": true, "render_addr_mask": "internal", "vlan_start": null, "cidr": "10.109.3.0/24"}' 5. Save sample :download: `network template<examples/network_template_1.yaml>` 6. Upload the network template by typing: fuel --env 1 network-template --upload --dir /root/ 7. Start deploy, pressing "Deploy changes" button. """ plugin.prepare_contrail_plugin(self, slaves=5) # enable plugin in contrail settings plugin.activate_plugin(self) # activate vSRX image vsrx_setup_result = plugin.activate_vsrx() self.fuel_web.update_nodes( self.cluster_id, { 'slave-01': ['controller'], 'slave-02': ['compute'], 'slave-03': ['contrail-config', 'contrail-control', 'contrail-db'], 'slave-04': ['contrail-config', 'contrail-control', 'contrail-db'], 'slave-05': ['contrail-config', 'contrail-control', 'contrail-db'], }, ) plugin.net_group_preparation(self) network_template = self.get_network_templ('network_template_1') self.fuel_web.client.upload_network_template( cluster_id=self.cluster_id, network_template=network_template) openstack.deploy_cluster(self) # run OSTF tests if vsrx_setup_result: self.fuel_web.run_ostf(cluster_id=self.cluster_id)