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_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_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_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)
Exemple #5
0
    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'])
Exemple #6
0
    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'])
Exemple #8
0
    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_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 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_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)
Exemple #12
0
    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)
Exemple #13
0
    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)
Exemple #14
0
    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)
Exemple #15
0
    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)
Exemple #16
0
    def contrail_dpdk_on_vf_add_controller(self):
        """Verify that Contrail controller 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. Enable DPDK on VF feature
            4. Deploy cluster with following node configuration:
               node-1: 'controller', 'ceph-osd';
               node-2: 'contrail-controller';
               node-3: 'compute', 'ceph-osd';
               node-4: 'compute', 'ceph-osd';
               node-5: 'contrail-analytics', 'contrail-analytics-db';
               node-6: 'contrail-analytics';
            5. Run OSTF tests
            6. Run contrail health check tests
            7. Add one node with following configuration:
               node-7: 'controller', 'ceph-osd';
            8. Deploy changes
            9. Run OSTF tests
            10. Run contrail health check tests

        """
        conf_contrail = {
            "dpdk_on_vf": True,
        }
        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()

        plugin.show_range(self, 2, 4)
        # activate plugin with DPDK feature
        plugin.activate_dpdk(self, **conf_contrail)
        # activate vSRX image
        vsrx_setup_result = vsrx.activate()

        self.show_step(4)
        self.bm_drv.setup_fuel_node(self,
                                    cluster_id=self.cluster_id,
                                    roles=['compute', 'dpdk', 'dpdk-on-vf'])
        openstack.setup_hugepages(self)
        conf_nodes = {
            'slave-01': ['controller', 'ceph-osd'],
            'slave-02': ['contrail-controller'],
            'slave-03': ['compute', 'ceph-osd'],
            'slave-04': ['compute', 'ceph-osd'],
            'slave-05': ['contrail-analytics', 'contrail-analytics-db'],
            'slave-06': ['contrail-analytics'],
        }
        conf_controller = {'slave-07': ['controller', 'ceph-osd']}

        # 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)
        # add mandatory kernel parameters for DPDK on VK
        fuel.add_kernel_params(self)
        # Deploy cluster
        openstack.deploy_cluster(self)
        # Run OSTF tests
        self.show_step(5)
        # FIXME: remove shouldfail, when livemigration+DPDK works
        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'
                ])
            TestContrailCheck(self).cloud_check(
                ['dpdk', 'sriov', 'contrail'],
                should_fail=[
                    "test_dpdk_boot_snapshot_vm",
                    "test_dpdk_check_public_connectivity_from_instance"
                ])

        # Add Compute node and check again
        self.show_step(6)
        # Cluster configuration
        self.fuel_web.update_nodes(self.cluster_id,
                                   nodes_dict=conf_controller,
                                   update_interfaces=False)
        self.bm_drv.update_vm_node_interfaces(self, self.cluster_id)
        # Enable SRIOV on interface
        openstack.enable_sriov(self)
        # Deploy cluster
        self.show_step(7)
        openstack.deploy_cluster(self)
        # Run OSTF tests
        self.show_step(8)
        # FIXME: remove shouldfail, when livemigration+DPDK works
        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(9)
            TestContrailCheck(self).cloud_check(
                ['dpdk', 'sriov', 'contrail'],
                should_fail=[
                    "test_dpdk_boot_snapshot_vm",
                    "test_dpdk_check_public_connectivity_from_instance"
                ])
    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_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_sriov_delete_controller(self):
        """Verify that Contrail controller 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: 'contrail-analytics', 'contrail-controller';
               node-03: 'compute', 'cinder';
               node-04: 'controller';
               node-05: 'contrail-analytics-db';
               node-bm: 'compute'(sriov);
            4. Run OSTF tests
            5. Delete node-04 with "controller" role
            6. Deploy changes
            7. Run OSTF tests
            8. Run contrail health check tests

        """
        self.show_step(1)
        plugin.prepare_contrail_plugin(self, slaves=5)
        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_no_compute = {
            'slave-01': ['controller'],
            'slave-02': ['contrail-controller', 'contrail-analytics'],
            'slave-03': ['compute', 'cinder'],
            'slave-04': ['controller'],
            'slave-05': ['contrail-analytics-db'],
        }
        conf_controller = {'slave-04': ['controller']}

        self.fuel_web.update_nodes(
            self.cluster_id,
            nodes_dict=dict(conf_no_compute, **conf_controller),
            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, should_fail=1,
                failed_test_name=[
                    'Check network connectivity from SRIOV'
                    ' instance via floating IP'])
            TestContrailCheck(self).cloud_check(['sriov', 'contrail'])

        # Delete Compute node and check again
        plugin.show_range(self, 5, 7)
        self.fuel_web.update_nodes(
            self.cluster_id,
            nodes_dict=conf_controller,
            pending_addition=False, pending_deletion=True,
            update_interfaces=False)

        # 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'], should_fail=2,
                failed_test_name=[
                    'Check that required  services are running',
                    'Check network connectivity from SRIOV '
                    'instance via floating IP'])
            self.show_step(8)
            TestContrailCheck(self).cloud_check(['sriov', 'contrail'])
    def contrail_sriov_add_controller(self):
        """Verify that Contrail controller 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-1: 'controller', 'ceph-osd';
                node-2: 'contrail-controller';
                node-3: 'compute', 'ceph-osd';
                node-4: 'compute', 'ceph-osd';
                node-6: 'contrail-analytics', 'contrail-analytics-db';
                node-bm: 'compute'(sriov);
            4. Run OSTF tests
            5. Add one node with following configuration:
                node-5: "controller", "ceph-osd";
            6. Deploy changes
            7. Run OSTF tests
            8. 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,
                                                'volumes_lvm': False})
        self.bm_drv.host_prepare()

        plugin.show_range(self, 2, 4)
        # enable plugin
        plugin.activate_plugin(self)
        # activate vSRX image
        vsrx_setup_result = vsrx.activate()

        self.bm_drv.setup_fuel_node(self,
                                    cluster_id=self.cluster_id,
                                    roles=['compute'])
        conf_nodes = {
            'slave-01': ['controller', 'ceph-osd'],
            'slave-02': ['contrail-controller'],
            'slave-03': ['compute', 'ceph-osd'],
            'slave-04': ['compute', 'ceph-osd'],
            # slave-05 controlle, ceph-osd here
            'slave-06': ['contrail-analytics-db', 'contrail-analytics'],
        }
        conf_controller = {'slave-05': ['controller', 'ceph-osd']}

        # 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
        self.show_step(4)
        # FIXME: remove shouldfail, when livemigration+DPDK works
        if vsrx_setup_result:
            self.fuel_web.run_ostf(
                cluster_id=self.cluster_id, should_fail=2,
                failed_test_name=[
                    'Instance live migration',
                    'Check network connectivity from SRIOV instance via'
                    ' floating IP'])
            TestContrailCheck(self).cloud_check(['sriov', 'contrail'])

        # Add Compute node and check again
        self.show_step(5)
        # Cluster configuration
        self.fuel_web.update_nodes(self.cluster_id,
                                   nodes_dict=conf_controller,
                                   update_interfaces=False)
        self.bm_drv.update_vm_node_interfaces(self, self.cluster_id)
        # Deploy cluster
        self.show_step(6)
        openstack.deploy_cluster(self)
        # Run OSTF tests
        self.show_step(7)
        # FIXME: remove shouldfail, when livemigration+DPDK works
        if vsrx_setup_result:
            self.fuel_web.run_ostf(
                cluster_id=self.cluster_id, should_fail=2,
                failed_test_name=[
                    'Instance live migration',
                    'Check network connectivity from SRIOV instance via'
                    ' floating IP'])
            self.show_step(8)
            TestContrailCheck(self).cloud_check(['sriov', 'contrail'])
    def contrail_murano(self):
        """Check deploy contrail with murano.

        Scenario:
            1. Create an environment with "Neutron with tunneling
               segmentation" as a network configuration
            2. Enable murano
            3. Enable and configure Contrail plugin
            4. Add a node with controller role
            5. Add a node with "compute" and "Storage-cinder" roles
            6. Add a node 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

        """
        min_slave_ram = 10000

        plugin.show_range(self, 1, 3)
        plugin.prepare_contrail_plugin(self, slaves=5,
                                       options={'murano': True})

        self.show_step(3)
        plugin.activate_plugin(self, contrail_api_public_port="8098")

        # 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': ['compute', 'cinder'],
                'slave-03': ['contrail-controller'],
                'slave-04': ['contrail-analytics'],
                'slave-05': ['contrail-analytics-db']
            })

        self.show_step(9)
        openstack.deploy_cluster(self)
        self.show_step(10)
        TestContrailCheck(self).cloud_check(['contrail'])

        self.show_step(11)
        check_ram_result = openstack.check_slave_memory(min_slave_ram)
        if vsrx_setup_result and check_ram_result:
            self.fuel_web.run_ostf(
                cluster_id=self.cluster_id,
                test_sets=['smoke', 'sanity', 'tests_platform'],
                timeout=settings.OSTF_RUN_TIMEOUT
                )
        elif vsrx_setup_result:
            logger.warning('Ostf tests will be run without platform tests')
            self.fuel_web.run_ostf(
                cluster_id=self.cluster_id,
                test_sets=['smoke', 'sanity'],
                timeout=settings.OSTF_RUN_TIMEOUT
                )
Exemple #23
0
    def contrail_ha_with_shutdown_contrail_node(self):
        """Verify HA with deleting Contrail roles.

        Scenario:
            1. Create an environment
            2. Enable and configure Contrail plugin
            3. Add some controller, compute and storage nodes
            4. Add 3 nodes with "contrail-controller" and
               "contrail-analytics" roles
            5. Add a node with "contrail-analytics-db" role
            6. Deploy cluster
            7. Run OSTF tests
            8. Check Controller and Contrail nodes status
            9. Shutdown node with "contrail-controller" and
                "contrail-analytics" roles
            10. Run OSTF tests
            11. Check Controller and Contrail nodes status
        """
        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, 6)
        conf_no_contrail = {
            'slave-01': ['controller'],
            'slave-02': ['controller'],
            'slave-03': ['controller'],
            'slave-04': ['compute'],
            'slave-05': ['cinder'],
            # Here slave-06 with contrail
            'slave-07': ['contrail-controller', 'contrail-analytics'],
            'slave-08': ['contrail-controller', 'contrail-analytics'],
            'slave-09': ['contrail-analytics-db'],
        }
        conf_contrail = {
            'slave-06': ['contrail-controller', 'contrail-analytics']
        }

        def check_node_state(cluster_id, node_name, node_state):
            """Check node state by it's name."""
            for node in self.fuel_web.client.list_cluster_nodes(cluster_id):
                if node_name in node['name']:
                    assert_equal(
                        node['status'], node_state,
                        'Nailgun node status is not %s but %s' %
                        (node_state, node['status']))

        plugin.show_range(self, 6, 8)
        openstack.update_deploy_check(self,
                                      dict(conf_no_contrail, **conf_contrail),
                                      is_vsrx=vsrx_setup_result,
                                      ostf_suites=['smoke', 'sanity', 'ha'])

        self.show_step(8)
        for node_name in dict(conf_no_contrail, **conf_contrail):
            check_node_state(self.cluster_id, node_name, 'ready')

        self.show_step(9)
        for node in self.fuel_web.client.list_cluster_nodes(self.cluster_id):
            if 'slave-06' in node['name']:
                logger.info('Shutdown node "%s"' % node['name'])
                self.fuel_web.warm_shutdown_nodes(
                    self.fuel_web.get_devops_nodes_by_nailgun_nodes([node]))
                break

        self.show_step(10)
        if vsrx_setup_result:
            self.fuel_web.run_ostf(
                cluster_id=self.cluster_id,
                test_sets=['smoke', 'sanity', 'ha'],
                should_fail=1,
                failed_test_name=[
                    'Check state of haproxy backends on controllers'
                ])

        self.show_step(11)
        node_roles = {'controller', 'contrail-config'}
        for node_name, roles in conf_no_contrail.items():
            if node_roles & set(roles):
                check_node_state(self.cluster_id, node_name, 'ready')
Exemple #24
0
    def contrail_plugin_add_delete_compute_node(self):
        """Verify that Compute node can be deleted and added after deploying.

        Scenario:
            1. Create an environment
            2. Enable and configure Contrail plugin
            3. Add a controller and 3 compute + storage nodes
            4. Add a node with "contrail-analytics" and
               "contrail-controller" roles
            5. Add a node with "contrail-analytics-db" role
            6. Add a node with "contrail-analytics" role
            7. Deploy cluster
            8. Run OSTF tests
            9. Run contrail health check test
            10. Delete a compute node and deploy changes
            11. Run OSTF tests
            12. Add a node with "compute" role and deploy changes
            13. 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)
        conf_no_controller = {
            'slave-01': ['controller'],
            'slave-02': ['compute', 'cinder'],
            'slave-03': ['compute', 'cinder'],
            # Here slave-4
            'slave-05': ['contrail-controller', 'contrail-analytics'],
            'slave-06': ['contrail-analytics'],
            'slave-07': ['contrail-analytics-db'],
        }
        conf_compute = {'slave-04': ['compute', 'cinder']}

        plugin.show_range(self, 7, 10)
        openstack.update_deploy_check(self,
                                      dict(conf_no_controller, **conf_compute),
                                      is_vsrx=vsrx_setup_result)
        self.show_step(10)
        openstack.update_deploy_check(self,
                                      conf_compute,
                                      delete=True,
                                      is_vsrx=False)
        self.show_step(11)
        if vsrx_setup_result:
            self.fuel_web.run_ostf(
                cluster_id=self.cluster_id,
                test_sets=['smoke', 'sanity', 'ha'],
                timeout=settings.OSTF_RUN_TIMEOUT,
                should_fail=1,
                failed_test_name=['Check that required services are running'])
        self.show_step(12)
        openstack.update_deploy_check(self, conf_compute, is_vsrx=False)
        self.show_step(13)
        if vsrx_setup_result:
            self.fuel_web.run_ostf(cluster_id=self.cluster_id,
                                   test_sets=['smoke', 'ha'],
                                   timeout=settings.OSTF_RUN_TIMEOUT)
    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 a node with 'contrail-controller' role
            6. Add a node with "contrail-analytics" role
            7. Add 2 nodes with "contrail-analytics-db" role
            8. Bond network interfaces with balance-rr mode
            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)

        # configure vlan on storage and private interfaces
        openstack.assign_vlan(self, private=101, storage=102)

        plugin.show_range(self, 3, 8)
        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-controller'],
                'slave-07': ['contrail-analytics'],
                'slave-08': ['contrail-analytics-db'],
                'slave-09': ['contrail-analytics-db'],
            },
        )

        cluster_nodes = self.fuel_web.client.list_cluster_nodes(
            self.cluster_id)

        self.show_step(8)
        for node in cluster_nodes:
            self.fuel_web.update_node_networks(
                node['id'],
                interfaces_dict=deepcopy(plugin.INTERFACES),
                raw_data=deepcopy(plugin.BOND_CONFIG))

        self.show_step(9)
        openstack.deploy_cluster(self)
        self.show_step(10)
        TestContrailCheck(self).cloud_check(['contrail'])

        # TODO(unknown)
        # 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.show_step(11)
        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')]
        )
Exemple #26
0
    def contrail_add_to_dpdk_sriov(self):
        """Verify that Contrail controller 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 dpdk+compute node
            4. Add nodes with following node configuration:
               node-1: 'controller';
               node-2: 'contrail-controller';
               node-3: 'compute', 'cinder',
               node-4: 'contrail-analytics', 'contrail-analytics-db';
            5. Enable sriov on interfaces of dpdk+compute node.
            6. Deploy cluster
            7. Run OSTF
            8. Run contrail health check tests
            9. Add nodes with configurations:
               node-5: 'contrail-controller';
               node-6: 'contrail-controller';
               node-7: 'contrail-analytics-db';
               node-8: 'contrail-analytics';
               node-9: 'contrail-analytics', 'contrail-analytics-db';
            10. Deploy changes
            11. Run OSTF
            12. 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)
        # activate plugin with DPDK feature
        plugin.activate_dpdk(self)
        # activate vSRX image
        vsrx_setup_result = vsrx.activate()

        plugin.show_range(self, 3, 5)
        self.bm_drv.setup_fuel_node(self,
                                    cluster_id=self.cluster_id,
                                    roles=['compute', 'dpdk'])
        openstack.setup_hugepages(self)
        conf_nodes = {
            'slave-01': ['controller'],
            'slave-02': ['contrail-controller'],
            'slave-03': ['compute', 'cinder'],
            'slave-04': ['contrail-analytics', 'contrail-analytics-db']
        }
        conf_controller = {
            'slave-05': ['contrail-controller'],
            'slave-06': ['contrail-controller'],
            'slave-07': ['contrail-analytics-db'],
            'slave-08': ['contrail-analytics'],
            'slave-09': ['contrail-analytics', '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)
        self.show_step(5)
        # Enable SRIOV on interface
        openstack.enable_sriov(self)
        # Deploy cluster
        self.show_step(6)
        openstack.deploy_cluster(self)
        # Run OSTF tests
        if vsrx_setup_result:
            self.show_step(7)
            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(8)
            TestContrailCheck(self).cloud_check(
                ['dpdk', 'contrail'],
                should_fail=[
                    "test_dpdk_boot_snapshot_vm",
                    "test_dpdk_check_public_connectivity_from_instance"
                ])

        # Add Contrail node and check again
        self.show_step(9)
        # Cluster configuration
        self.fuel_web.update_nodes(self.cluster_id,
                                   nodes_dict=conf_controller,
                                   update_interfaces=False)
        self.bm_drv.update_vm_node_interfaces(self, self.cluster_id)
        fuel.add_kernel_params()
        # Deploy cluster
        self.show_step(10)
        openstack.deploy_cluster(self)
        # Run OSTF tests
        if vsrx_setup_result:
            self.show_step(11)
            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(12)
            TestContrailCheck(self).cloud_check(
                ['dpdk', 'contrail'],
                should_fail=["test_dpdk_boot_snapshot_vm"])
Exemple #27
0
    def contrail_dpdk_on_vf_delete_controller(self):
        """Verify that Contrail controller 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. Enable DPDK on VF feature
            4. Deploy cluster with following node configuration:
               node-01: 'controller';
               node-02: 'contrail-controller';
               node-03: 'controller';
               node-04: 'compute', 'cinder';
               node-05: 'controller';
               node-06: 'contrail-analytics', 'contrail-analytics-db';
               node-07: 'contrail-analytics-db';
               node-08: 'contrail-analytics-db';
            5. Run OSTF tests
            6. Delete node-01 with "controller" 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)
        # activate plugin with DPDK on VF feature
        conf_contrail = {"dpdk_on_vf": True}
        plugin.activate_dpdk(self, **conf_contrail)
        # 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', 'dpdk', 'dpdk-on-vf'])
        openstack.setup_hugepages(self)

        conf_controller = {'slave-01': ['controller']}
        conf_no_controller = {
            # slave-01 here
            'slave-02': ['contrail-controller'],
            'slave-03': ['controller'],
            'slave-04': ['compute', 'cinder'],
            'slave-05': ['controller'],
            'slave-06': ['contrail-analytics', 'contrail-analytics-db'],
            'slave-07': ['contrail-analytics-db'],
            'slave-08': ['contrail-analytics-db'],
        }

        self.fuel_web.update_nodes(self.cluster_id,
                                   nodes_dict=dict(conf_no_controller,
                                                   **conf_controller),
                                   update_interfaces=False)
        self.bm_drv.update_vm_node_interfaces(self, self.cluster_id)
        # Enable SRIOV on interface
        openstack.enable_sriov(self)
        # add mandatory kernel parameters for DPDK on VK
        fuel.add_kernel_params(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'
                ])
            TestContrailCheck(self).cloud_check(
                ['dpdk', 'sriov', 'contrail'],
                should_fail=[
                    "test_dpdk_boot_snapshot_vm",
                    "test_dpdk_check_public_connectivity_from_instance"
                ])

        # Delete Compute node and check again
        plugin.show_range(self, 5, 7)
        self.fuel_web.update_nodes(self.cluster_id,
                                   nodes_dict=conf_controller,
                                   pending_addition=False,
                                   pending_deletion=True,
                                   update_interfaces=False)

        # 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'],
                                   should_fail=1,
                                   failed_test_name=[
                                       'Check that required '
                                       'services are running'
                                   ])
            self.show_step(8)
            TestContrailCheck(self).cloud_check(
                ['dpdk', 'sriov', 'contrail'],
                should_fail=[
                    "test_dpdk_boot_snapshot_vm",
                    "test_dpdk_check_public_connectivity_from_instance"
                ])
    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" and "Ceph OSD" roles
            4. Add 2 nodes with "compute" and "Storage-Ceph OSD" roles
            5. Add a node with "contrail-analytics",
               'contrail-controller' roles
            6. Add node with "contrail-analytics-db" role
            7. Configure MTU on network interfaces (Jumbo-frames)
            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=5, 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)))

        self.show_step(2)
        plugin.activate_plugin(self)

        interfaces = {
            'enp0s3': ['fuelweb_admin'],
            'enp0s4': ['public'],
            'enp0s5': ['management'],
            'enp0s6': ['private'],
            'enp0s7': ['storage'],
        }

        interfaces_update = [{
            'name': 'enp0s6',
            'interface_properties': {
                'mtu': 9000,
                'disable_offloading': False
            },
        }]

        # 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', 'ceph-osd'],
                'slave-02': ['compute', 'ceph-osd'],
                'slave-03': ['compute', 'ceph-osd'],
                'slave-04': ['contrail-controller', 'contrail-analytics'],
                'slave-05': ['contrail-analytics-db'],
            }
        )

        self.show_step(7)
        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)

        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)

        for node_name in ['slave-01', 'slave-02',
                          'slave-03', 'slave-04', 'slave-05']:
            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, "enp0s6", 9000),
                    "MTU on {0} is not 9000. Actual value: {1}"
                    .format(remote.host,
                            jumbo.get_node_iface(remote, "enp0s6")))
Exemple #29
0
    def contrail_dpdk_update_core_repos(self):
        """Check updating core repos with Contrail plugin and DPDK.

        Scenario:
            1. Deploy cluster with some
               controller+mongo,
               compute+ceph-osd,
               compute+dpdk and contrail-specified nodes
            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,
                                       options={
                                           'images_ceph': True,
                                           'volumes_ceph': True,
                                           'ephemeral_ceph': True,
                                           'objects_ceph': True,
                                           'volumes_lvm': False,
                                           'osd_pool_size': '1'
                                       })
        self.bm_drv.host_prepare()
        plugin.activate_dpdk(self)
        vsrx_setup_result = vsrx.activate()
        self.bm_drv.setup_fuel_node(self,
                                    cluster_id=self.cluster_id,
                                    roles=['compute', 'dpdk'])
        openstack.setup_hugepages(self)
        conf_nodes = {
            'slave-01': ['controller', 'mongo'],
            'slave-02': ['compute', 'ceph-osd'],
            'slave-03': ['contrail-controller'],
            'slave-04': ['contrail-analytics', 'contrail-analytics-db'],
            '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)
        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=['Instance live migration'])
            TestContrailCheck(self).cloud_check(
                ['contrail', 'dpdk'],
                should_fail=["test_dpdk_boot_snapshot_vm"])
    def contrail_sahara(self):
        """Check Contrail deploy with sahara.

        Scenario:
            1. Create an environment with "Neutron with tunneling
               segmentation" as a network configuration and CEPH storage
            2. Enable sahara
            3. Enable and configure Contrail plugin
            4. Add a node with controller role
            5. Add 3 nodes with "compute" and "Ceph-OSD" roles
            6. Add a node 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

        """
        min_slave_ram = 8138

        plugin.show_range(self, 1, 3)
        plugin.prepare_contrail_plugin(self, slaves=9,
                                       options={'images_ceph': True,
                                                'volumes_ceph': True,
                                                'ephemeral_ceph': True,
                                                'objects_ceph': True,
                                                'volumes_lvm': False,
                                                'sahara': True})

        self.show_step(3)
        plugin.activate_plugin(self)
        # 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': ['compute', 'ceph-osd'],
                'slave-03': ['compute', 'ceph-osd'],
                'slave-04': ['compute', 'ceph-osd'],
                'slave-05': ['contrail-controller'],
                'slave-06': ['contrail-analytics-db'],
                'slave-07': ['contrail-analytics']
            })

        self.show_step(9)
        openstack.deploy_cluster(self)
        self.show_step(10)
        TestContrailCheck(self).cloud_check(['contrail'])
        self.show_step(11)
        check_ram_result = openstack.check_slave_memory(min_slave_ram)
        if vsrx_setup_result and check_ram_result:
            self.fuel_web.run_ostf(
                cluster_id=self.cluster_id,
                test_sets=['smoke', 'sanity', 'tests_platform'],
                timeout=settings.OSTF_RUN_TIMEOUT
                )
        elif vsrx_setup_result:
            logger.warning('Ostf tests will be run without platform tests')
            self.fuel_web.run_ostf(
                cluster_id=self.cluster_id,
                test_sets=['smoke', 'sanity'],
                timeout=settings.OSTF_RUN_TIMEOUT
            )