Example #1
0
    def deploy_neutron_vlan_ha(self):
        """Deploy cluster in HA mode with Neutron VLAN

        Scenario:
            1. Create cluster
            2. Add 3 nodes with controller role
            3. Add 2 nodes with compute role
            4. Deploy the cluster
            5. Run network verification
            6. Check Swift ring and rebalance it if needed
            7. Run OSTF

        Duration 80m
        Snapshot deploy_neutron_vlan_ha

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": NEUTRON_SEGMENT['vlan']
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            }
        )
        self.fuel_web.update_internal_network(cluster_id, '192.168.196.0/22',
                                              '192.168.196.1')
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')
        os_conn = os_actions.OpenStackActions(
            self.fuel_web.get_public_vip(cluster_id))
        self.fuel_web.check_fixed_network_cidr(
            cluster_id, os_conn)

        self.fuel_web.verify_network(cluster_id)
        devops_node = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])
        logger.debug("devops node name is {0}".format(devops_node.name))
        ip = self.fuel_web.get_nailgun_node_by_name(devops_node.name)['ip']
        Common.rebalance_swift_ring(ip)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id, test_sets=['ha', 'smoke', 'sanity'])

        self.env.make_snapshot("deploy_neutron_vlan_ha")
Example #2
0
    def deploy_neutron_gre_ha(self):
        """Deploy cluster in HA mode with Neutron GRE (DEPRECATED)

        Scenario:
            1. Create cluster
            2. Add 3 nodes with controller role
            3. Add 2 nodes with compute role
            4. Deploy the cluster
            5. Run network verification
            6. Check Swift ring and rebalance it if needed
            7. Run OSTF

        Duration 80m
        Snapshot deploy_neutron_gre_ha

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  mode=DEPLOYMENT_MODE,
                                                  settings={
                                                      "net_provider":
                                                      'neutron',
                                                      "net_segment_type":
                                                      NEUTRON_SEGMENT['gre'],
                                                      'tenant':
                                                      'haGre',
                                                      'user':
                                                      '******',
                                                      'password':
                                                      '******'
                                                  })
        self.fuel_web.update_nodes(
            cluster_id, {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            })
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')

        self.fuel_web.verify_network(cluster_id)
        devops_node = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])
        logger.debug("devops node name is {0}".format(devops_node.name))
        ip = self.fuel_web.get_nailgun_node_by_name(devops_node.name)['ip']
        Common.rebalance_swift_ring(ip)

        self.fuel_web.run_ostf(cluster_id=cluster_id,
                               test_sets=['ha', 'smoke', 'sanity'])

        self.env.make_snapshot("deploy_neutron_gre_ha")
Example #3
0
    def deploy_neutron_gre_ha(self):
        """Deploy cluster in HA mode with Neutron GRE (DEPRECATED)

        Scenario:
            1. Create cluster
            2. Add 3 nodes with controller role
            3. Add 2 nodes with compute role
            4. Deploy the cluster
            5. Run network verification
            6. Check Swift ring and rebalance it if needed
            7. Run OSTF

        Duration 80m
        Snapshot deploy_neutron_gre_ha

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": NEUTRON_SEGMENT['gre'],
                'tenant': 'haGre',
                'user': '******',
                'password': '******'
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')

        self.fuel_web.verify_network(cluster_id)
        devops_node = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])
        logger.debug("devops node name is {0}".format(devops_node.name))
        ip = self.fuel_web.get_nailgun_node_by_name(devops_node.name)['ip']
        Common.rebalance_swift_ring(ip)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id,
            test_sets=['ha', 'smoke', 'sanity'])

        self.env.make_snapshot("deploy_neutron_gre_ha")
Example #4
0
    def deploy_neutron_vlan_ha(self):
        """Deploy cluster in HA mode with Neutron VLAN

        Scenario:
            1. Create cluster
            2. Add 3 nodes with controller role
            3. Add 2 nodes with compute role
            4. Deploy the cluster
            5. Run network verification
            6. Check Swift ring and rebalance it if needed
            7. Run OSTF

        Duration 80m
        Snapshot deploy_neutron_vlan_ha

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  mode=DEPLOYMENT_MODE,
                                                  settings={
                                                      "net_provider":
                                                      'neutron',
                                                      "net_segment_type":
                                                      NEUTRON_SEGMENT['vlan']
                                                  })
        self.fuel_web.update_nodes(
            cluster_id, {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            })
        self.fuel_web.update_internal_network(cluster_id, '192.168.196.0/22',
                                              '192.168.196.1')
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')
        os_conn = os_actions.OpenStackActions(
            self.fuel_web.get_public_vip(cluster_id))
        self.fuel_web.check_fixed_network_cidr(cluster_id, os_conn)

        self.fuel_web.verify_network(cluster_id)
        devops_node = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])
        logger.debug("devops node name is {0}".format(devops_node.name))
        ip = self.fuel_web.get_nailgun_node_by_name(devops_node.name)['ip']
        Common.rebalance_swift_ring(ip)

        self.fuel_web.run_ostf(cluster_id=cluster_id,
                               test_sets=['ha', 'smoke', 'sanity'])

        self.env.make_snapshot("deploy_neutron_vlan_ha")
    def _create_net_subnet(self, cluster):
        """Create net and subnet"""
        contrail_ip = self.fuel_web.get_public_vip(cluster)
        logger.info('The ip is %s', contrail_ip)
        net = Common(
            controller_ip=contrail_ip, user='******',
            password='******', tenant='admin'
        )

        net.neutron.create_network(body={
            'network': {
                'name': 'net04',
                'admin_state_up': True,
            }
        })

        network_id = ''
        network_dic = net.neutron.list_networks()
        for dd in network_dic['networks']:
            if dd.get("name") == "net04":
                network_id = dd.get("id")

        if network_id == "":
            logger.error('Network id empty')

        logger.debug("id {0} to master node".format(network_id))

        net.neutron.create_subnet(body={
            'subnet': {
                'network_id': network_id,
                'ip_version': 4,
                'cidr': '10.100.0.0/24',
                'name': 'subnet04',
            }
        })
    def deploy_neutron_tun_ha_base(self, snapshot_name):
        self.check_run(snapshot_name)
        self.env.revert_snapshot("ready_with_5_slaves")

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": NEUTRON_SEGMENT['tun'],
                'tenant': 'haTun',
                'user': '******',
                'password': '******'
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')

        self.fuel_web.verify_network(cluster_id)
        devops_node = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])
        logger.debug("devops node name is {0}".format(devops_node.name))
        ip = self.fuel_web.get_nailgun_node_by_name(devops_node
                                                    .name)['ip']
        Common.rebalance_swift_ring(ip)

        self.fuel_web.run_ostf(
            cluster_id=cluster_id,
            test_sets=['ha', 'smoke', 'sanity'])

        self.env.make_snapshot(snapshot_name, is_make=True)
Example #7
0
    def deploy_neutron_tun_ha_base(self, snapshot_name):
        self.check_run(snapshot_name)
        self.env.revert_snapshot("ready_with_5_slaves")

        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  mode=DEPLOYMENT_MODE,
                                                  settings={
                                                      "net_provider":
                                                      'neutron',
                                                      "net_segment_type":
                                                      NEUTRON_SEGMENT['tun'],
                                                      'tenant':
                                                      'haTun',
                                                      'user':
                                                      '******',
                                                      'password':
                                                      '******'
                                                  })
        self.fuel_web.update_nodes(
            cluster_id, {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute'],
                'slave-05': ['compute']
            })
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster = self.fuel_web.client.get_cluster(cluster_id)
        assert_equal(str(cluster['net_provider']), 'neutron')

        self.fuel_web.verify_network(cluster_id)
        devops_node = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])
        logger.debug("devops node name is {0}".format(devops_node.name))
        ip = self.fuel_web.get_nailgun_node_by_name(devops_node.name)['ip']
        Common.rebalance_swift_ring(ip)

        self.fuel_web.run_ostf(cluster_id=cluster_id,
                               test_sets=['ha', 'smoke', 'sanity'])

        self.env.make_snapshot(snapshot_name, is_make=True)
Example #8
0
    def __init__(self, nsxv_ip, user=None, password=None, tenant=None):
        """Init Common.

        :param nsxv_ip: controller ip
        """
        user = user or fw_settings.SERVTEST_USERNAME
        password = password or fw_settings.SERVTEST_PASSWORD
        tenant = tenant or fw_settings.SERVTEST_TENANT
        self._common = Common(controller_ip=nsxv_ip,
                              user=user,
                              password=password,
                              tenant=tenant)
    def neutron_tun_scalability(self):
        """Check HA mode on scalability

        Scenario:
            1. Create cluster
            2. Add 1 controller node
            3. Deploy the cluster
            4. Check swift, and invoke swift-rings-rebalance.sh
               on primary controller if check failed
            5. Add 2 controller nodes
            6. Deploy changes
            7. Check swift, and invoke swift-rings-rebalance.sh
               on primary controller if check failed
            8. Run OSTF
            9. Add 2 controller 1 compute nodes
            10. Deploy changes
            11. Check swift, and invoke swift-rings-rebalance.sh
                on all the controllers
            12. Run OSTF
            13. Delete the primary and the last added controller.
            14. Deploy changes
            15. Check swift, and invoke swift-rings-rebalance.sh
                on all the controllers
            16. Run OSTF

        Duration 160m
        Snapshot neutron_tun_scalability

        """

        def _check_pacemaker(devops_nodes):
            for devops_node in devops_nodes:
                with QuietLogger():
                    self.fuel_web.assert_pacemaker(
                        devops_node.name,
                        devops_nodes, [])
                ret = self.fuel_web.get_pacemaker_status(devops_node.name)
                assert_true(
                    re.search('vip__management\s+\(ocf::fuel:ns_IPaddr2\):'
                              '\s+Started node', ret),
                    'vip management started')
                assert_true(
                    re.search('vip__public\s+\(ocf::fuel:ns_IPaddr2\):'
                              '\s+Started node', ret),
                    'vip public started')

        self.env.revert_snapshot("ready_with_9_slaves")
        # Step 1  Create cluster with 1 controller
        logger.info("STEP1: Create new cluster {0}".format(
            self.__class__.__name__))
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=DEPLOYMENT_MODE,
            settings={
                "net_provider": 'neutron',
                "net_segment_type": NEUTRON_SEGMENT['tun']
            }
        )

        nodes = {'slave-01': ['controller']}
        logger.info("Adding new node to the cluster: {0}".format(nodes))
        self.fuel_web.update_nodes(
            cluster_id, nodes)
        self.fuel_web.deploy_cluster_wait(cluster_id)

        logger.info("STEP3: Deploy 1 node cluster finishes")
        primary_node = self.env.d_env.get_node(name='slave-01')

        # Step 4. Check swift
        logger.info("STEP4: Check swift on primary controller {0}".format(
            primary_node))
        ip = self.fuel_web.get_nailgun_node_by_name(primary_node.name)['ip']
        Common.rebalance_swift_ring(ip)

        nodes = {'slave-02': ['controller'],
                 'slave-03': ['controller']}
        logger.info("STEP 4: Adding new nodes "
                    "to the cluster: {0}".format(nodes))
        self.fuel_web.update_nodes(
            cluster_id, nodes,
            True, False
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)

        logger.info("STEP6: Deploy 3 ctrl node cluster has finished")
        controllers = ['slave-01', 'slave-02', 'slave-03']
        _check_pacemaker(self.env.d_env.get_nodes(name__in=controllers))

        primary_node_s3 = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])

        logger.info("Primary controller after STEP6 is {0}".format(
            primary_node_s3.name))
        logger.info("STEP7: Check swift on primary controller {0}".format(
            primary_node_s3))
        ip = self.fuel_web.get_nailgun_node_by_name(primary_node_s3
                                                    .name)['ip']
        Common.rebalance_swift_ring(ip)

        # Run smoke tests only according to ha and
        # sanity executed in scope of deploy_cluster_wait()

        self.fuel_web.run_ostf(
            cluster_id=cluster_id,
            test_sets=['smoke'])

        nodes = {'slave-04': ['controller'],
                 'slave-05': ['controller'],
                 'slave-06': ['compute']}
        logger.info("Adding new nodes to the cluster: {0}".format(nodes))
        self.fuel_web.update_nodes(
            cluster_id, nodes,
            True, False
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)

        logger.info("STEP10: Deploy 5 ctrl node cluster has finished")
        controllers = ['slave-01', 'slave-02', 'slave-03', 'slave-04',
                       'slave-05']
        _check_pacemaker(self.env.d_env.get_nodes(name__in=controllers))

        primary_node_s9 = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])

        logger.info("Primary controller after STEP10 is {0}".format(
            primary_node_s9.name))

        logger.info("STEP11: Check swift on primary controller {0}".format(
            primary_node_s9))

        ip = self.fuel_web.get_nailgun_node_by_name(primary_node_s9
                                                    .name)['ip']
        Common.rebalance_swift_ring(ip)

        # Run smoke tests only according to ha and
        # sanity executed in scope of deploy_cluster_wait()

        # Step 12. Run OSTF
        self.fuel_web.run_ostf(
            cluster_id=cluster_id,
            test_sets=['smoke'])

        nodes = {primary_node_s9.name: ['controller'],
                 'slave-05': ['controller']}
        logger.info("STEP13: Deleting nodes from the cluster: {0}".format(
            nodes))
        self.fuel_web.update_nodes(
            cluster_id, nodes,
            False, True
        )

        # Step 14. Deploy changes
        self.fuel_web.deploy_cluster_wait(cluster_id)

        nodes = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['controller'])
        devops_nodes = [self.fuel_web.get_devops_node_by_nailgun_node(node)
                        for node in nodes]
        _check_pacemaker(devops_nodes)

        logger.info("STEP13-14: Scale down happened. "
                    "3 controller should be now")
        primary_node_s14 = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.get_node(name=devops_nodes[0].name))

        logger.info("Primary controller after STEP15 is {0}".format(
            primary_node_s14.name))

        logger.info("STEP15: Check swift on primary controller {0}".format(
            primary_node_s14))

        ip = self.fuel_web.get_nailgun_node_by_name(primary_node_s14
                                                    .name)['ip']
        Common.rebalance_swift_ring(ip)

        # Step 16. Run OSTF
        self.fuel_web.run_ostf(
            cluster_id=cluster_id,
            test_sets=['sanity', 'smoke', 'ha'])
        self.env.make_snapshot("neutron_vlan_ha_scalability")
Example #10
0
    def deploy_sahara_ha_one_controller_gre(self):
        """Deploy cluster in ha mode with 1 controller Sahara and Neutron GRE

        Scenario:
            1. Create a Fuel cluster. Set the option for Sahara installation
            2. Add 1 node with "controller" role
            3. Add 1 node with "compute" role
            4. Deploy the Fuel cluster
            5. Verify Sahara service on controller
            6. Run all sanity and smoke tests
            7. Register Vanilla2 image for Sahara
            8. Run platform Vanilla2 test for Sahara

        Duration 65m
        Snapshot: deploy_sahara_ha_one_controller_gre
        """
        if settings.OPENSTACK_RELEASE == settings.OPENSTACK_RELEASE_REDHAT:
            raise SkipTest()

        LOGGER.debug('Check MD5 sum of Vanilla2 image')
        check_image = checkers.check_image(
            settings.SERVTEST_SAHARA_VANILLA_2_IMAGE,
            settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image)

        self.env.revert_snapshot("ready_with_3_slaves")

        LOGGER.debug('Create Fuel cluster for Sahara tests')
        data = {
            'sahara': True,
            'net_provider': 'neutron',
            'net_segment_type': 'gre',
            'tenant': 'saharaSimple',
            'user': '******',
            'password': '******'
        }
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE,
            settings=data
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)
        os_conn = os_actions.OpenStackActions(
            self.fuel_web.get_public_vip(cluster_id),
            data['user'], data['password'], data['tenant'])
        self.fuel_web.assert_cluster_ready(
            os_conn, smiles_count=5, networks_count=2, timeout=300)

        LOGGER.debug('Verify Sahara service on controller')
        _ip = self.fuel_web.get_nailgun_node_by_name("slave-01")['ip']
        checkers.verify_service(
            self.env.d_env.get_ssh_to_remote(_ip),
            service_name='sahara-all')

        LOGGER.debug('Run all sanity and smoke tests')
        path_to_tests = 'fuel_health.tests.sanity.test_sanity_sahara.'
        test_names = ['VanillaTwoTemplatesTest.test_vanilla_two_templates',
                      'HDPTwoTemplatesTest.test_hdp_two_templates']
        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=[path_to_tests + test_name
                                  for test_name in test_names]
        )

        LOGGER.debug('Import Vanilla2 image for Sahara')
        common_func = Common(
            self.fuel_web.get_public_vip(cluster_id),
            data['user'], data['password'], data['tenant'])
        common_func.image_import(
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_SAHARA_VANILLA_2_IMAGE,
            settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_NAME,
            settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_META)

        path_to_tests = 'fuel_health.tests.tests_platform.test_sahara.'
        test_names = ['VanillaTwoClusterTest.test_vanilla_two_cluster']
        for test_name in test_names:
            LOGGER.debug('Run platform test {0} for Sahara'.format(test_name))
            self.fuel_web.run_single_ostf_test(
                cluster_id=cluster_id, test_sets=['tests_platform'],
                test_name=path_to_tests + test_name, timeout=60 * 200)

        self.env.make_snapshot("deploy_sahara_ha_one_controller_gre")
Example #11
0
    def deploy_sahara_ha_one_controller_gre(self):
        """Deploy cluster in ha mode with 1 controller Sahara and Neutron GRE

        Scenario:
            1. Create a Fuel cluster. Set the option for Sahara installation
            2. Add 1 node with "controller" role
            3. Add 1 node with "compute" role
            4. Deploy the Fuel cluster
            5. Verify Sahara service on controller
            6. Run all sanity and smoke tests
            7. Register Vanilla2 image for Sahara
            8. Run platform Vanilla2 test for Sahara

        Duration 65m
        Snapshot: deploy_sahara_ha_one_controller_gre
        """
        if settings.OPENSTACK_RELEASE == settings.OPENSTACK_RELEASE_REDHAT:
            raise SkipTest()

        LOGGER.debug('Check MD5 sum of Vanilla2 image')
        check_image = checkers.check_image(
            settings.SERVTEST_SAHARA_VANILLA_2_IMAGE,
            settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image)

        self.env.revert_snapshot("ready_with_3_slaves")

        LOGGER.debug('Create Fuel cluster for Sahara tests')
        data = {
            'sahara': True,
            'net_provider': 'neutron',
            'net_segment_type': 'gre',
            'tenant': 'saharaSimple',
            'user': '******',
            'password': '******'
        }
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE,
            settings=data
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)
        os_conn = os_actions.OpenStackActions(
            self.fuel_web.get_public_vip(cluster_id),
            data['user'], data['password'], data['tenant'])
        self.fuel_web.assert_cluster_ready(
            os_conn, smiles_count=5, networks_count=2, timeout=300)

        LOGGER.debug('Verify Sahara service on controller')
        checkers.verify_service(
            self.env.get_ssh_to_remote_by_name("slave-01"),
            service_name='sahara-all')

        LOGGER.debug('Run all sanity and smoke tests')
        path_to_tests = 'fuel_health.tests.sanity.test_sanity_sahara.'
        test_names = ['VanillaTwoTemplatesTest.test_vanilla_two_templates',
                      'HDPTwoTemplatesTest.test_hdp_two_templates']
        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=[path_to_tests + test_name
                                  for test_name in test_names]
        )

        LOGGER.debug('Import Vanilla2 image for Sahara')
        common_func = Common(
            self.fuel_web.get_public_vip(cluster_id),
            data['user'], data['password'], data['tenant'])
        common_func.image_import(
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_SAHARA_VANILLA_2_IMAGE,
            settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_NAME,
            settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_META)

        path_to_tests = 'fuel_health.tests.platform_tests.test_sahara.'
        test_names = ['VanillaTwoClusterTest.test_vanilla_two_cluster']
        for test_name in test_names:
            LOGGER.debug('Run platform test {0} for Sahara'.format(test_name))
            self.fuel_web.run_single_ostf_test(
                cluster_id=cluster_id, test_sets=['platform_tests'],
                test_name=path_to_tests + test_name, timeout=60 * 200)

        self.env.make_snapshot("deploy_sahara_ha_one_controller_gre")
Example #12
0
    def deploy_murano_ha_with_gre(self):
        """Deploy cluster in ha mode with Murano and Neutron GRE

        Scenario:
            1. Create cluster. Set install Murano option
            2. Add 3 node with controller role
            3. Add 1 nodes with compute role
            4. Deploy the cluster
            5. Verify Murano services
            6. Run OSTF
            7. Register Murano image
            8. Run OSTF Murano platform tests

        Duration 100m
        Snapshot: deploy_murano_ha_with_gre

        """
        self.env.revert_snapshot("ready_with_5_slaves")

        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(
            settings.SERVTEST_MURANO_IMAGE,
            settings.SERVTEST_MURANO_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image, "Image verification failed")

        data = {
            'murano': True,
            'net_provider': 'neutron',
            'net_segment_type': 'gre',
            'tenant': 'muranoHA',
            'user': '******',
            'password': '******'
        }

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE,
            settings=data)

        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)
        cluster_vip = self.fuel_web.get_public_vip(cluster_id)
        os_conn = os_actions.OpenStackActions(
            cluster_vip, data['user'], data['password'], data['tenant'])
        self.fuel_web.assert_cluster_ready(
            os_conn, smiles_count=13, networks_count=2, timeout=300)
        for slave in ["slave-01", "slave-02", "slave-03"]:
            checkers.verify_service(
                self.env.get_ssh_to_remote_by_name(slave),
                service_name='murano-api')

        common_func = Common(cluster_vip, data['user'], data['password'],
                             data['tenant'])

        LOGGER.debug('Run sanity and functional Murano OSTF tests')
        self.fuel_web.run_single_ostf_test(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            test_sets=['sanity'],
            test_name=('fuel_health.tests.sanity.test_sanity_murano.'
                       'MuranoSanityTests.test_create_and_delete_service')
        )

        LOGGER.debug('Import Murano image')
        common_func.image_import(
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_MURANO_IMAGE,
            settings.SERVTEST_MURANO_IMAGE_NAME,
            settings.SERVTEST_MURANO_IMAGE_META)

        LOGGER.debug('Boot instance with Murano image')

        image_name = settings.SERVTEST_MURANO_IMAGE_NAME
        srv = common_func.create_instance(flavor_name='test_murano_flavor',
                                          ram=2048, vcpus=1, disk=20,
                                          server_name='murano_instance',
                                          image_name=image_name,
                                          neutron_network=True)

        wait(lambda: common_func.get_instance_detail(srv).status == 'ACTIVE',
             timeout=60 * 60)

        common_func.delete_instance(srv)

        LOGGER.debug('Run OSTF platform tests')

        test_class_main = ('fuel_health.tests.platform_tests'
                           '.test_murano_linux.MuranoDeployLinuxServicesTests')
        tests_names = ['test_deploy_apache_service', ]

        test_classes = []

        for test_name in tests_names:
            test_classes.append('{0}.{1}'.format(test_class_main,
                                                 test_name))

        for test_name in test_classes:
            self.fuel_web.run_single_ostf_test(
                cluster_id=cluster_id, test_sets=['platform_tests'],
                test_name=test_name, timeout=60 * 36)

        self.env.make_snapshot("deploy_murano_ha_with_gre")
Example #13
0
    def deploy_heat_ha(self):
        """Deploy Heat cluster in HA mode

        Scenario:
            1. Create cluster
            2. Add 3 node with controller role
            3. Add 1 nodes with compute role
            4. Deploy the cluster
            5. Verify heat services
            6. Run OSTF
            7. Register heat image
            8. Run OSTF platform tests

        Snapshot: deploy_heat_ha

        """

        self.env.revert_snapshot("ready_with_5_slaves")

        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(
            settings.SERVTEST_HEAT_IMAGE,
            settings.SERVTEST_HEAT_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image, "Image verification failed")

        data = {
            'net_provider': 'neutron',
            'net_segment_type': 'gre',
            'tenant': 'heatSimple',
            'user': '******',
            'password': '******'
        }

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE_HA,
            settings=data)

        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)
        self.fuel_web.assert_cluster_ready(
            'slave-01', smiles_count=13, networks_count=1, timeout=300)

        for slave in ["slave-01", "slave-02", "slave-03"]:
            checkers.verify_service(
                self.env.get_ssh_to_remote_by_name(slave),
                service_name='heat-api', count=3)

        cluster_vip = self.fuel_web.get_public_vip(cluster_id)

        common_func = Common(cluster_vip,
                             data['user'],
                             data['password'],
                             data['tenant'])

        LOGGER.debug('Import Heat image')
        common_func.image_import(
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_HEAT_IMAGE,
            settings.SERVTEST_HEAT_IMAGE_NAME,
            settings.SERVTEST_HEAT_IMAGE_META)

        LOGGER.debug('Run Heat OSTF platform tests')

        test_class_main = ('fuel_health.tests.platform_tests.'
                           'test_heat.'
                           'HeatSmokeTests')
        tests_names = ['test_actions',
                       'test_rollback']

        test_classes = []

        for test_name in tests_names:
            test_classes.append('{0}.{1}'.format(test_class_main,
                                                 test_name))

        for test_name in test_classes:
            self.fuel_web.run_single_ostf_test(
                cluster_id=cluster_id, test_sets=['platform_tests'],
                test_name=test_name, timeout=60 * 60)

        self.env.make_snapshot("deploy_heat_ha")
Example #14
0
    def deploy_sahara_ha_gre(self):
        """Deploy cluster in HA mode with Sahara and Neutron GRE

        Scenario:
            1. Create cluster. Set install Sahara option
            2. Add 3 node with controller role
            3. Add 1 node with compute role
            4. Deploy the cluster
            5. Verify Sahara services
            6. Run OSTF
            7. Register Sahara image
            8. Run OSTF platform Sahara test only

        Snapshot: deploy_sahara_ha_gre

        """
        if settings.OPENSTACK_RELEASE == settings.OPENSTACK_RELEASE_REDHAT:
            raise SkipTest()

        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(
            settings.SERVTEST_SAVANNA_IMAGE,
            settings.SERVTEST_SAVANNA_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image)

        self.env.revert_snapshot("ready_with_5_slaves")
        LOGGER.debug('Create cluster for sahara tests')
        data = {
            'sahara': True,
            'net_provider': 'neutron',
            'net_segment_type': 'gre',
            'tenant': 'saharaHA',
            'user': '******',
            'password': '******'
        }

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE_HA,
            settings=data
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)
        self.fuel_web.assert_cluster_ready(
            'slave-01', smiles_count=13, networks_count=1, timeout=300)

        for slave in ["slave-01", "slave-02", "slave-03"]:
            checkers.verify_service(
                self.env.get_ssh_to_remote_by_name(slave),
                service_name='sahara-api')

        cluster_vip = self.fuel_web.get_public_vip(cluster_id)
        common_func = Common(cluster_vip, data['user'], data['password'],
                             data['tenant'])

        test_classes = ['fuel_health.tests.sanity.test_sanity_savanna.'
                        'SanitySavannaTests.test_sanity_savanna']
        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=test_classes
        )

        LOGGER.debug('Import image')
        common_func.image_import(
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_SAVANNA_IMAGE,
            settings.SERVTEST_SAVANNA_IMAGE_NAME,
            settings.SERVTEST_SAVANNA_IMAGE_META)

        common_func.goodbye_security()

        LOGGER.debug('Run OSTF Sahara platform test')

        self.fuel_web.run_single_ostf_test(
            cluster_id=cluster_id, test_sets=['platform_tests'],
            test_name=('fuel_health.tests.platform_tests.'
                       'test_platform_savanna.PlatformSavannaTests.'
                       'test_platform_savanna'), timeout=60 * 200)

        self.env.make_snapshot("deploy_sahara_ha_gre")
    def deploy_scale_controller_ironic(self):
        """Test cluster scaling with Controller and Ironic

        Scenario:
            1. Create cluster with 5 slave nodes
            2. Bootstrap 1 additional slave node
            3. Add 2 Controller nodes
            4. Add 1 Compute node
            5. Add 1 Controller+Ironic node
            6. Deploy the cluster
            7. Run OSTF tests
            8. Boot, check connectivity, delete Ironic VM
            9. Rebalance Swift rings
            10. Add 1 Controller node
            11. Add 1 Controller+Ironic node
            12. Redeploy the cluster
            13. Run OSTF tests
            14. Boot, check connectivity, delete Ironic VM
            15. Rebalance Swift rings
            16. Remove 1 Controller node
            17. Remove 1 Controller+Ironic node
            18. Redeploy the cluster
            19. Run OSTF tests
            20. Boot, check connectivity, delete Ironic VM

        Duration 90m
        Snapshot deploy_scale_controller_ironic
        """

        self.env.revert_snapshot("ready_with_5_slaves")
        # Deploy 1st part
        data = {
            'net_segment_type': NEUTRON_SEGMENT['vlan'],
            'ironic': True}

        nodes = {
            'slave-01': ['controller'],
            'slave-02': ['controller'],
            'slave-03': ['controller', 'ironic'],
            'slave-04': ['compute']}

        self.show_step(1)
        self.show_step(2)
        self.env.bootstrap_nodes(self.env.d_env.nodes().slaves[5:6])
        self.show_step(3)
        self.show_step(4)
        self.show_step(5)
        self.show_step(6)
        self.show_step(7)
        cluster_id = self._deploy_ironic_cluster(settings=data, nodes=nodes)
        ironic_conn = ironic_actions.IronicActions(
            self.fuel_web.get_public_vip(cluster_id))
        self._create_os_resources(ironic_conn)
        self.show_step(8)
        self._boot_check_delete_vm(ironic_conn)

        # Rebalance swift rings, add nodes and redeploy
        self.show_step(9)
        primary_node = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])
        ip = self.fuel_web.get_nailgun_node_by_name(primary_node.name)['ip']
        Common.rebalance_swift_ring(ip)
        self.show_step(10)
        self.show_step(11)
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-05': ['controller'],
                'slave-06': ['controller', 'ironic']
            }
        )
        self.show_step(12)
        self.fuel_web.deploy_cluster_wait(cluster_id)
        self.show_step(13)
        self.fuel_web.run_ostf(cluster_id=cluster_id)
        self.show_step(14)
        ironic_conn = ironic_actions.IronicActions(
            self.fuel_web.get_public_vip(cluster_id))
        self._boot_check_delete_vm(ironic_conn)

        # Rebalance swift rings, remove nodes and redeploy
        self.show_step(15)
        primary_node = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])
        ip = self.fuel_web.get_nailgun_node_by_name(primary_node.name)['ip']
        Common.rebalance_swift_ring(ip)
        self.show_step(16)
        self.show_step(17)
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-05': ['controller'],
                'slave-06': ['controller', 'ironic']
            },
            pending_addition=False,
            pending_deletion=True
        )
        self.show_step(18)
        self.fuel_web.deploy_cluster_wait(cluster_id)
        self.show_step(19)
        self.fuel_web.run_ostf(cluster_id=cluster_id)
        self.show_step(20)
        ironic_conn = ironic_actions.IronicActions(
            self.fuel_web.get_public_vip(cluster_id))
        self._boot_check_delete_vm(ironic_conn)

        self.env.make_snapshot("deploy_scale_controller_ironic")
Example #16
0
    def deploy_sahara_ha_gre(self):
        """Deploy cluster in HA mode with Sahara and Neutron GRE

        Scenario:
            1. Create cluster. Set install Sahara option
            2. Add 3 node with controller role
            3. Add 1 node with compute role
            4. Deploy the cluster
            5. Verify Sahara services
            6. Run OSTF
            7. Register Sahara image
            8. Run OSTF platform Sahara test only

        Snapshot: deploy_sahara_ha_gre

        """
        if settings.OPENSTACK_RELEASE == settings.OPENSTACK_RELEASE_REDHAT:
            raise SkipTest()

        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(
            settings.SERVTEST_SAHARA_IMAGE,
            settings.SERVTEST_SAHARA_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image)

        self.env.revert_snapshot("ready_with_5_slaves")
        LOGGER.debug('Create cluster for sahara tests')
        data = {
            'sahara': True,
            'net_provider': 'neutron',
            'net_segment_type': 'gre',
            'tenant': 'saharaHA',
            'user': '******',
            'password': '******'
        }

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE_HA,
            settings=data
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)

        cluster_vip = self.fuel_web.get_public_vip(cluster_id)

        os_conn = os_actions.OpenStackActions(
            cluster_vip, data['user'], data['password'], data['tenant'])

        self.fuel_web.assert_cluster_ready(
            os_conn, smiles_count=13, networks_count=2, timeout=300)

        for slave in ["slave-01", "slave-02", "slave-03"]:
            checkers.verify_service(
                self.env.get_ssh_to_remote_by_name(slave),
                service_name='sahara-all')

        common_func = Common(cluster_vip, data['user'], data['password'],
                             data['tenant'])

        test_classes = ['fuel_health.tests.sanity.test_sanity_sahara.'
                        'SanitySaharaTests.test_sanity_sahara']
        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=test_classes
        )

        LOGGER.debug('Import image')
        common_func.image_import(
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_SAHARA_IMAGE,
            settings.SERVTEST_SAHARA_IMAGE_NAME,
            settings.SERVTEST_SAHARA_IMAGE_META)

        common_func.goodbye_security()

        LOGGER.debug('Run OSTF Sahara platform test')

        self.fuel_web.run_single_ostf_test(
            cluster_id=cluster_id, test_sets=['platform_tests'],
            test_name=('fuel_health.tests.platform_tests.'
                       'test_sahara.PlatformSaharaTests.'
                       'test_platform_sahara'), timeout=60 * 200)

        self.env.make_snapshot("deploy_sahara_ha_gre")
Example #17
0
    def deploy_murano_simple(self):
        """Deploy cluster in simple mode with Murano

        Scenario:
            1. Create cluster. Set install Murano option
            2. Add 1 node with controller role
            3. Add 1 nodes with compute role
            4. Deploy the cluster
            5. Verify murano services
            6. Run OSTF
            7. Register murano image
            8. Run OSTF platform tests

        Snapshot: deploy_murano_simple

        """
        if settings.OPENSTACK_RELEASE == settings.OPENSTACK_RELEASE_REDHAT:
            raise SkipTest()

        self.env.revert_snapshot("ready_with_3_slaves")

        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(
            settings.SERVTEST_MURANO_SERVER_URL,
            settings.SERVTEST_MURANO_IMAGE,
            settings.SERVTEST_MURANO_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image, "Image verification failed")

        data = {
            'murano': True,
            "net_provider": 'neutron',
            "net_segment_type": 'gre',
            'tenant': 'muranoSimple',
            'user': '******',
            'password': '******'
        }

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            settings=data)

        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)
        self.fuel_web.assert_cluster_ready(
            'slave-01', smiles_count=5, networks_count=1, timeout=300)
        checkers.verify_service(
            self.env.get_ssh_to_remote_by_name("slave-01"),
            service_name='murano-api')

        controller_ip = self.fuel_web.get_nailgun_node_by_name(
            'slave-01')['ip']
        common_func = Common(controller_ip,
                             data['user'],
                             data['password'],
                             data['tenant'])

        LOGGER.debug('Run sanity and functional oSTF tests')
        test_classes = ['fuel_health.tests.sanity.test_sanity_murano.'
                        'MuranoSanityTests.test_create_and_delete_service']
        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=test_classes
        )

        LOGGER.debug('Import image')
        common_func.image_import(
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_MURANO_IMAGE,
            settings.SERVTEST_MURANO_IMAGE_NAME,
            settings.SERVTEST_MURANO_IMAGE_META)

        LOGGER.debug('Run OSTF platform tests')

        test_class_main = ('fuel_health.tests.platform_tests'
                           '.test_platform_murano_linux.'
                           'MuranoDeployLinuxServicesTests')
        tests_names = ['test_deploy_telnet_service',
                       'test_deploy_apache_service']
        test_classes = []
        for test_name in tests_names:
            test_classes.append('{0}.{1}'.format(test_class_main,
                                                 test_name))

        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=test_classes, test_sets=['platform_tests'])
        self.env.make_snapshot("deploy_murano_simple")
Example #18
0
    def deploy_scale_controller_ironic(self):
        """Test cluster scaling with Controller and Ironic

        Scenario:
            1. Create cluster with 5 slave nodes
            2. Bootstrap 1 additional slave node
            3. Add 2 Controller nodes
            4. Add 1 Compute node
            5. Add 1 Controller+Ironic node
            6. Deploy the cluster
            7. Run OSTF tests
            8. Boot, check connectivity, delete Ironic VM
            9. Rebalance Swift rings
            10. Add 1 Controller node
            11. Add 1 Controller+Ironic node
            12. Redeploy the cluster
            13. Run OSTF tests
            14. Boot, check connectivity, delete Ironic VM
            15. Rebalance Swift rings
            16. Remove 1 Controller node
            17. Remove 1 Controller+Ironic node
            18. Redeploy the cluster
            19. Run OSTF tests
            20. Boot, check connectivity, delete Ironic VM

        Duration 90m
        Snapshot deploy_scale_controller_ironic
        """

        self.env.revert_snapshot("ready_with_5_slaves")
        # Deploy 1st part
        data = {'net_segment_type': NEUTRON_SEGMENT['vlan'], 'ironic': True}

        nodes = {
            'slave-01': ['controller'],
            'slave-02': ['controller'],
            'slave-03': ['controller', 'ironic'],
            'slave-04': ['compute']
        }

        self.show_step(1)
        self.show_step(2)
        self.env.bootstrap_nodes(self.env.d_env.nodes().slaves[5:6])
        self.show_step(3)
        self.show_step(4)
        self.show_step(5)
        self.show_step(6)
        self.show_step(7)
        cluster_id = self._deploy_ironic_cluster(settings=data, nodes=nodes)
        ironic_conn = ironic_actions.IronicActions(
            self.fuel_web.get_public_vip(cluster_id))
        self._create_os_resources(ironic_conn)
        self.show_step(8)
        self._boot_check_delete_vm(ironic_conn)

        # Rebalance swift rings, add nodes and redeploy
        self.show_step(9)
        primary_node = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])
        ip = self.fuel_web.get_nailgun_node_by_name(primary_node.name)['ip']
        Common.rebalance_swift_ring(ip)
        self.show_step(10)
        self.show_step(11)
        self.fuel_web.update_nodes(cluster_id, {
            'slave-05': ['controller'],
            'slave-06': ['controller', 'ironic']
        })
        self.show_step(12)
        self.fuel_web.deploy_cluster_wait(cluster_id)
        self.show_step(13)
        self.fuel_web.run_ostf(cluster_id=cluster_id)
        self.show_step(14)
        ironic_conn = ironic_actions.IronicActions(
            self.fuel_web.get_public_vip(cluster_id))
        self._boot_check_delete_vm(ironic_conn)

        # Rebalance swift rings, remove nodes and redeploy
        self.show_step(15)
        primary_node = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])
        ip = self.fuel_web.get_nailgun_node_by_name(primary_node.name)['ip']
        Common.rebalance_swift_ring(ip)
        self.show_step(16)
        self.show_step(17)
        self.fuel_web.update_nodes(cluster_id, {
            'slave-05': ['controller'],
            'slave-06': ['controller', 'ironic']
        },
                                   pending_addition=False,
                                   pending_deletion=True)
        self.show_step(18)
        self.fuel_web.deploy_cluster_wait(cluster_id)
        self.show_step(19)
        self.fuel_web.run_ostf(cluster_id=cluster_id)
        self.show_step(20)
        ironic_conn = ironic_actions.IronicActions(
            self.fuel_web.get_public_vip(cluster_id))
        self._boot_check_delete_vm(ironic_conn)

        self.env.make_snapshot("deploy_scale_controller_ironic")
Example #19
0
    def deploy_murano_simple(self):
        """Deploy cluster in simple mode with Murano

        Scenario:
            1. Create cluster. Set install Murano option
            2. Add 1 node with controller role
            3. Add 1 nodes with compute role
            4. Deploy the cluster
            5. Verify murano services
            6. Run OSTF
            7. Register murano image
            8. Run OSTF platform tests

        Snapshot: deploy_murano_simple

        """
        if settings.OPENSTACK_RELEASE == settings.OPENSTACK_RELEASE_REDHAT:
            raise SkipTest()

        self.env.revert_snapshot("ready_with_3_slaves")

        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(settings.SERVTEST_MURANO_SERVER_URL,
                                           settings.SERVTEST_MURANO_IMAGE,
                                           settings.SERVTEST_MURANO_IMAGE_MD5,
                                           settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image, "Image verification failed")

        data = {
            'murano': True,
            "net_provider": 'neutron',
            "net_segment_type": 'gre',
            'tenant': 'muranoSimple',
            'user': '******',
            'password': '******'
        }

        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  settings=data)

        self.fuel_web.update_nodes(cluster_id, {
            'slave-01': ['controller'],
            'slave-02': ['compute']
        })
        self.fuel_web.deploy_cluster_wait(cluster_id)
        self.fuel_web.assert_cluster_ready('slave-01',
                                           smiles_count=5,
                                           networks_count=1,
                                           timeout=300)
        checkers.verify_service(self.env.get_ssh_to_remote_by_name("slave-01"),
                                service_name='murano-api')

        controller_ip = self.fuel_web.get_nailgun_node_by_name(
            'slave-01')['ip']
        common_func = Common(controller_ip, data['user'], data['password'],
                             data['tenant'])

        LOGGER.debug('Run sanity and functional oSTF tests')
        test_classes = [
            'fuel_health.tests.sanity.test_sanity_murano.'
            'MuranoSanityTests.test_create_and_delete_service'
        ]
        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=test_classes)

        LOGGER.debug('Import image')
        common_func.image_import(settings.SERVTEST_LOCAL_PATH,
                                 settings.SERVTEST_MURANO_IMAGE,
                                 settings.SERVTEST_MURANO_IMAGE_NAME,
                                 settings.SERVTEST_MURANO_IMAGE_META)

        LOGGER.debug('Run OSTF platform tests')

        test_class_main = ('fuel_health.tests.platform_tests'
                           '.test_platform_murano_linux.'
                           'MuranoDeployLinuxServicesTests')
        tests_names = [
            'test_deploy_telnet_service', 'test_deploy_apache_service'
        ]
        test_classes = []
        for test_name in tests_names:
            test_classes.append('{0}.{1}'.format(test_class_main, test_name))

        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=test_classes,
            test_sets=['platform_tests'])
        self.env.make_snapshot("deploy_murano_simple")
Example #20
0
    def deploy_savanna_simple(self):
        """Deploy cluster in simple mode with Savanna

        Scenario:
            1. Create cluster. Set install Sahara option
            2. Add 1 node with controller role
            3. Add 1 node with compute role
            4. Deploy the cluster
            5. Verify sahara services
            6. Run OSTF
            7. Register sahara image
            8. Run OSTF platform sahara tests only

        Snapshot: deploy_sahara_simple

        """
        if settings.OPENSTACK_RELEASE == settings.OPENSTACK_RELEASE_REDHAT:
            raise SkipTest()

        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(
            settings.SERVTEST_SAVANNA_SERVER_URL,
            settings.SERVTEST_SAVANNA_IMAGE,
            settings.SERVTEST_SAVANNA_IMAGE_MD5, settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image)

        self.env.revert_snapshot("ready_with_3_slaves")
        LOGGER.debug('Create cluster for sahara tests')
        data = {
            'sahara': True,
            "net_provider": 'neutron',
            "net_segment_type": 'gre',
            'tenant': 'saharaSimple',
            'user': '******',
            'password': '******'
        }

        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  settings=data)
        self.fuel_web.update_nodes(cluster_id, {
            'slave-01': ['controller'],
            'slave-02': ['compute']
        })
        self.fuel_web.deploy_cluster_wait(cluster_id)
        self.fuel_web.assert_cluster_ready('slave-01',
                                           smiles_count=5,
                                           networks_count=1,
                                           timeout=300)
        checkers.verify_service(self.env.get_ssh_to_remote_by_name("slave-01"),
                                service_name='sahara-api')

        controller_ip = self.fuel_web.get_nailgun_node_by_name(
            'slave-01')['ip']
        common_func = Common(controller_ip, data['user'], data['password'],
                             data['tenant'])

        failed_test_name = ['Create volume and attach it to instance']

        test_classes = [
            'fuel_health.tests.sanity.test_sanity_savanna.'
            'SanitySavannaTests.test_sanity_savanna'
        ]
        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=test_classes)

        LOGGER.debug('Import image')
        common_func.image_import(settings.SERVTEST_LOCAL_PATH,
                                 settings.SERVTEST_SAVANNA_IMAGE,
                                 settings.SERVTEST_SAVANNA_IMAGE_NAME,
                                 settings.SERVTEST_SAVANNA_IMAGE_META)

        common_func.goodbye_security()

        LOGGER.debug('Run OSTF savanna platform tests')

        self.fuel_web.run_single_ostf_test(
            cluster_id=cluster_id,
            test_sets=['platform_tests'],
            test_name=('fuel_health.tests.platform_tests.'
                       'test_platform_savanna.PlatformSavannaTests.'
                       'test_platform_savanna'),
            should_fail=1,
            timeout=60 * 200,
            failed_test_name=failed_test_name)

        self.env.make_snapshot("deploy_sahara_simple")
Example #21
0
    def deploy_ceilometer_simple(self):
        """Deploy cluster in simple mode with Ceilometer

        Scenario:
            1. Create cluster. Set install Ceilometer option
            2. Add 1 node with controller role
            3. Add 1 nodes with compute role
            4. Add 1 node with cinder role
            4. Deploy the cluster
            5. Verify ceilometer api is running
            6. Run ostf

        Snapshot: deploy_ceilometer_simple

        """
        if settings.OPENSTACK_RELEASE == settings.OPENSTACK_RELEASE_REDHAT:
            raise SkipTest()

        self.env.revert_snapshot("ready_with_3_slaves")

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            settings={
                'ceilometer': True
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute'],
                'slave-03': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)

        checkers.verify_service(
            self.env.get_ssh_to_remote_by_name("slave-01"),
            service_name='ceilometer-api')

        # run ostf smoke and sanity
        self.fuel_web.run_ostf(
            cluster_id=cluster_id,
            should_fail=1,
            failed_test_name=['Create volume and attach it to instance'])

        # verify if needed image exists
        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(
            settings.SERVTEST_HEAT_SERVER_URL,
            settings.SERVTEST_HEAT_IMAGE,
            settings.SERVTEST_HEAT_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image)

        controller_ip = self.fuel_web.get_nailgun_node_by_name(
            'slave-01')['ip']
        common_func = Common(controller_ip,
                             settings.SERVTEST_USERNAME,
                             settings.SERVTEST_PASSWORD,
                             settings.SERVTEST_TENANT)

        LOGGER.debug('Import image')
        common_func.image_import(
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_HEAT_IMAGE,
            settings.SERVTEST_HEAT_IMAGE_NAME,
            settings.SERVTEST_HEAT_IMAGE_META)

        # run ostf platform tests for ceilometer and heat

        self.fuel_web.run_ostf(
            cluster_id=cluster_id, test_sets=['platform_tests'],
            should_fail=1, timeout=3500,
            failed_test_name=['Create volume and attach it to instance'])

        self.env.make_snapshot("deploy_ceilometer_simple")
Example #22
0
    def deploy_savanna_simple(self):
        """Deploy cluster in simple mode with Savanna

        Scenario:
            1. Create cluster. Set install Savanna option
            2. Add 1 node with controller role
            3. Add 1 node with compute role
            4. Deploy the cluster
            5. Verify savanna services
            6. Run OSTF
            7. Register savanna image
            8. Run OSTF platform tests

        Snapshot: deploy_savanna_simple

        """
        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(
            settings.SERVTEST_SAVANNA_SERVER_URL,
            settings.SERVTEST_SAVANNA_IMAGE,
            settings.SERVTEST_SAVANNA_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        assert_true(check_image)

        self.env.revert_snapshot("ready_with_3_slaves")
        LOGGER.debug('Create cluster for savanna tests')
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            settings={
                'savanna': True,
                "net_provider": 'neutron',
                "net_segment_type": 'gre'
            }
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)
        self.fuel_web.assert_cluster_ready(
            'slave-01', smiles_count=6, networks_count=1, timeout=300)
        checkers.verify_service(
            self.env.get_ssh_to_remote_by_name("slave-01"),
            service_name='savanna-api')

        controller_ip = self.fuel_web.get_nailgun_node_by_name(
            'slave-01')['ip']
        common_func = Common(controller_ip,
                             settings.SERVTEST_USERNAME,
                             settings.SERVTEST_PASSWORD,
                             settings.SERVTEST_TENANT)

        test_classes = ['fuel_health.tests.sanity.test_sanity_savanna.'
                        'SanitySavannaTests.test_sanity_savanna']
        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=test_classes
        )

        LOGGER.debug('Import image')
        common_func.image_import(
            settings.SERVTEST_SAVANNA_IMAGE_META,
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_SAVANNA_IMAGE,
            settings.SERVTEST_SAVANNA_IMAGE_NAME)

        common_func.goodbye_security()

        LOGGER.debug('Run OSTF platform tests')
        test_classes = ['fuel_health.tests.platform_tests'
                        '.test_platform_savanna.'
                        'PlatformSavannaTests.test_platform_savanna']
        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=test_classes, test_sets=['platform_tests'])
        self.env.make_snapshot("deploy_savanna_simple")
Example #23
0
    def neutron_tun_scalability(self):
        """Check HA mode on scalability

        Scenario:
            1. Create cluster
            2. Add 1 controller node
            3. Deploy the cluster
            4. Check swift, and invoke swift-rings-rebalance.sh
               on primary controller if check failed
            5. Add 2 controller nodes
            6. Deploy changes
            7. Check swift, and invoke swift-rings-rebalance.sh
               on primary controller if check failed
            8. Run OSTF
            9. Add 2 controller 1 compute nodes
            10. Deploy changes
            11. Check swift, and invoke swift-rings-rebalance.sh
                on all the controllers
            12. Run OSTF
            13. Delete the primary and the last added controller.
            14. Deploy changes
            15. Check swift, and invoke swift-rings-rebalance.sh
                on all the controllers
            16. Run OSTF

        Duration 160m
        Snapshot neutron_tun_scalability

        """
        def _check_pacemaker(devops_nodes):
            for devops_node in devops_nodes:
                with QuietLogger():
                    self.fuel_web.assert_pacemaker(devops_node.name,
                                                   devops_nodes, [])
                ret = self.fuel_web.get_pacemaker_status(devops_node.name)
                assert_true(
                    re.search(
                        'vip__management\s+\(ocf::fuel:ns_IPaddr2\):'
                        '\s+Started node', ret), 'vip management started')
                assert_true(
                    re.search(
                        'vip__public\s+\(ocf::fuel:ns_IPaddr2\):'
                        '\s+Started node', ret), 'vip public started')

        self.env.revert_snapshot("ready_with_9_slaves")
        # Step 1  Create cluster with 1 controller
        logger.info("STEP1: Create new cluster {0}".format(
            self.__class__.__name__))
        cluster_id = self.fuel_web.create_cluster(name=self.__class__.__name__,
                                                  mode=DEPLOYMENT_MODE,
                                                  settings={
                                                      "net_provider":
                                                      'neutron',
                                                      "net_segment_type":
                                                      NEUTRON_SEGMENT['tun']
                                                  })

        nodes = {'slave-01': ['controller']}
        logger.info("Adding new node to the cluster: {0}".format(nodes))
        self.fuel_web.update_nodes(cluster_id, nodes)
        self.fuel_web.deploy_cluster_wait(cluster_id)

        logger.info("STEP3: Deploy 1 node cluster finishes")
        primary_node = self.env.d_env.get_node(name='slave-01')

        # Step 4. Check swift
        logger.info("STEP4: Check swift on primary controller {0}".format(
            primary_node))
        ip = self.fuel_web.get_nailgun_node_by_name(primary_node.name)['ip']
        Common.rebalance_swift_ring(ip)

        nodes = {'slave-02': ['controller'], 'slave-03': ['controller']}
        logger.info("STEP 4: Adding new nodes "
                    "to the cluster: {0}".format(nodes))
        self.fuel_web.update_nodes(cluster_id, nodes, True, False)
        self.fuel_web.deploy_cluster_wait(cluster_id)

        logger.info("STEP6: Deploy 3 ctrl node cluster has finished")
        controllers = ['slave-01', 'slave-02', 'slave-03']
        _check_pacemaker(self.env.d_env.get_nodes(name__in=controllers))

        primary_node_s3 = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])

        logger.info("Primary controller after STEP6 is {0}".format(
            primary_node_s3.name))
        logger.info("STEP7: Check swift on primary controller {0}".format(
            primary_node_s3))
        ip = self.fuel_web.get_nailgun_node_by_name(primary_node_s3.name)['ip']
        Common.rebalance_swift_ring(ip)

        # Run smoke tests only according to ha and
        # sanity executed in scope of deploy_cluster_wait()

        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])

        nodes = {
            'slave-04': ['controller'],
            'slave-05': ['controller'],
            'slave-06': ['compute']
        }
        logger.info("Adding new nodes to the cluster: {0}".format(nodes))
        self.fuel_web.update_nodes(cluster_id, nodes, True, False)
        self.fuel_web.deploy_cluster_wait(cluster_id)

        logger.info("STEP10: Deploy 5 ctrl node cluster has finished")
        controllers = [
            'slave-01', 'slave-02', 'slave-03', 'slave-04', 'slave-05'
        ]
        _check_pacemaker(self.env.d_env.get_nodes(name__in=controllers))

        primary_node_s9 = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.nodes().slaves[0])

        logger.info("Primary controller after STEP10 is {0}".format(
            primary_node_s9.name))

        logger.info("STEP11: Check swift on primary controller {0}".format(
            primary_node_s9))

        ip = self.fuel_web.get_nailgun_node_by_name(primary_node_s9.name)['ip']
        Common.rebalance_swift_ring(ip)

        # Run smoke tests only according to ha and
        # sanity executed in scope of deploy_cluster_wait()

        # Step 12. Run OSTF
        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=['smoke'])

        nodes = {
            primary_node_s9.name: ['controller'],
            'slave-05': ['controller']
        }
        logger.info(
            "STEP13: Deleting nodes from the cluster: {0}".format(nodes))
        self.fuel_web.update_nodes(cluster_id, nodes, False, True)

        # Step 14. Deploy changes
        self.fuel_web.deploy_cluster_wait(cluster_id)

        nodes = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['controller'])
        devops_nodes = [
            self.fuel_web.get_devops_node_by_nailgun_node(node)
            for node in nodes
        ]
        _check_pacemaker(devops_nodes)

        logger.info("STEP13-14: Scale down happened. "
                    "3 controller should be now")
        primary_node_s14 = self.fuel_web.get_nailgun_primary_node(
            self.env.d_env.get_node(name=devops_nodes[0].name))

        logger.info("Primary controller after STEP15 is {0}".format(
            primary_node_s14.name))

        logger.info("STEP15: Check swift on primary controller {0}".format(
            primary_node_s14))

        ip = self.fuel_web.get_nailgun_node_by_name(
            primary_node_s14.name)['ip']
        Common.rebalance_swift_ring(ip)

        # Step 16. Run OSTF
        self.fuel_web.run_ostf(cluster_id=cluster_id,
                               test_sets=['sanity', 'smoke', 'ha'])
        self.env.make_snapshot("neutron_vlan_ha_scalability")
Example #24
0
    def deploy_heat_simple_nova(self):
        """Deploy Heat cluster in simple mode with Nova Network

        Scenario:
            1. Create cluster
            2. Add 1 node with controller role
            3. Add 1 nodes with compute role
            4. Deploy the cluster
            5. Verify heat services
            6. Run OSTF
            7. Register heat image
            8. Run OSTF platform tests

        Snapshot: deploy_heat_simple_nova

        """

        self.env.revert_snapshot("ready_with_3_slaves")

        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(
            settings.SERVTEST_HEAT_IMAGE,
            settings.SERVTEST_HEAT_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image, "Image verification failed")

        data = {
            'tenant': 'heatSimple',
            'user': '******',
            'password': '******'
        }

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            settings=data)

        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)
        controller = self.fuel_web.get_nailgun_node_by_name('slave-01')
        os_conn = os_actions.OpenStackActions(
            controller['ip'], data['user'], data['password'], data['tenant'])
        self.fuel_web.assert_cluster_ready(
            os_conn, smiles_count=6, networks_count=1, timeout=300)

        checkers.verify_service(
            self.env.get_ssh_to_remote_by_name("slave-01"),
            service_name='heat-api', count=3)

        common_func = Common(controller['ip'],
                             data['user'],
                             data['password'],
                             data['tenant'])

        LOGGER.debug('Import Heat image')
        common_func.image_import(
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_HEAT_IMAGE,
            settings.SERVTEST_HEAT_IMAGE_NAME,
            settings.SERVTEST_HEAT_IMAGE_META)

        LOGGER.debug('Run Heat OSTF platform tests')

        test_class_main = ('fuel_health.tests.platform_tests.'
                           'test_heat.'
                           'HeatSmokeTests')
        tests_names = ['test_actions',
                       'test_autoscaling',
                       'test_rollback']

        test_classes = []

        for test_name in tests_names:
            test_classes.append('{0}.{1}'.format(test_class_main,
                                                 test_name))

        for test_name in test_classes:
            self.fuel_web.run_single_ostf_test(
                cluster_id=cluster_id, test_sets=['platform_tests'],
                test_name=test_name, timeout=60 * 60)

        self.env.make_snapshot("deploy_heat_simple_nova")
Example #25
0
    def deploy_savanna_simple(self):
        """Deploy cluster in simple mode with Savanna

        Scenario:
            1. Create cluster. Set install Sahara option
            2. Add 1 node with controller role
            3. Add 1 node with compute role
            4. Deploy the cluster
            5. Verify sahara services
            6. Run OSTF
            7. Register sahara image
            8. Run OSTF platform sahara tests only

        Snapshot: deploy_sahara_simple

        """
        if settings.OPENSTACK_RELEASE == settings.OPENSTACK_RELEASE_REDHAT:
            raise SkipTest()

        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(
            settings.SERVTEST_SAVANNA_SERVER_URL,
            settings.SERVTEST_SAVANNA_IMAGE,
            settings.SERVTEST_SAVANNA_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image)

        self.env.revert_snapshot("ready_with_3_slaves")
        LOGGER.debug('Create cluster for sahara tests')
        data = {
            'sahara': True,
            "net_provider": 'neutron',
            "net_segment_type": 'gre',
            'tenant': 'saharaSimple',
            'user': '******',
            'password': '******'

        }

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            settings=data
        )
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)
        self.fuel_web.assert_cluster_ready(
            'slave-01', smiles_count=5, networks_count=1, timeout=300)
        checkers.verify_service(
            self.env.get_ssh_to_remote_by_name("slave-01"),
            service_name='sahara-api')

        controller_ip = self.fuel_web.get_nailgun_node_by_name(
            'slave-01')['ip']
        common_func = Common(controller_ip,
                             data['user'],
                             data['password'],
                             data['tenant'])

        failed_test_name = ['Create volume and attach it to instance']

        test_classes = ['fuel_health.tests.sanity.test_sanity_savanna.'
                        'SanitySavannaTests.test_sanity_savanna']
        self.fuel_web.run_ostf(
            cluster_id=self.fuel_web.get_last_created_cluster(),
            tests_must_be_passed=test_classes
        )

        LOGGER.debug('Import image')
        common_func.image_import(
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_SAVANNA_IMAGE,
            settings.SERVTEST_SAVANNA_IMAGE_NAME,
            settings.SERVTEST_SAVANNA_IMAGE_META)

        common_func.goodbye_security()

        LOGGER.debug('Run OSTF savanna platform tests')

        self.fuel_web.run_single_ostf_test(
            cluster_id=cluster_id, test_sets=['platform_tests'],
            test_name=('fuel_health.tests.platform_tests.'
                       'test_platform_savanna.PlatformSavannaTests.'
                       'test_platform_savanna'), should_fail=1,
            timeout=60 * 200, failed_test_name=failed_test_name)

        self.env.make_snapshot("deploy_sahara_simple")
Example #26
0
    def deploy_heat_ha(self):
        """Deploy Heat cluster in HA mode

        Scenario:
            1. Create cluster
            2. Add 3 node with controller role
            3. Add 1 nodes with compute role
            4. Deploy the cluster
            5. Verify heat services
            6. Run OSTF
            7. Register heat image
            8. Run OSTF platform tests

        Snapshot: deploy_heat_ha

        """

        self.env.revert_snapshot("ready_with_5_slaves")

        LOGGER.debug('Check MD5 of image')
        check_image = checkers.check_image(
            settings.SERVTEST_HEAT_IMAGE,
            settings.SERVTEST_HEAT_IMAGE_MD5,
            settings.SERVTEST_LOCAL_PATH)
        asserts.assert_true(check_image, "Image verification failed")

        data = {
            'net_provider': 'neutron',
            'net_segment_type': 'gre',
            'tenant': 'heatSimple',
            'user': '******',
            'password': '******'
        }

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE_HA,
            settings=data)

        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute']
            }
        )
        self.fuel_web.deploy_cluster_wait(cluster_id)
        cluster_vip = self.fuel_web.get_public_vip(cluster_id)
        os_conn = os_actions.OpenStackActions(
            cluster_vip, data['user'], data['password'], data['tenant'])
        self.fuel_web.assert_cluster_ready(
            os_conn, smiles_count=13, networks_count=2, timeout=300)

        for slave in ["slave-01", "slave-02", "slave-03"]:
            checkers.verify_service(
                self.env.get_ssh_to_remote_by_name(slave),
                service_name='heat-api', count=3)

        common_func = Common(cluster_vip,
                             data['user'],
                             data['password'],
                             data['tenant'])

        LOGGER.debug('Import Heat image')
        common_func.image_import(
            settings.SERVTEST_LOCAL_PATH,
            settings.SERVTEST_HEAT_IMAGE,
            settings.SERVTEST_HEAT_IMAGE_NAME,
            settings.SERVTEST_HEAT_IMAGE_META)

        LOGGER.debug('Run Heat OSTF platform tests')

        test_class_main = ('fuel_health.tests.platform_tests.'
                           'test_heat.'
                           'HeatSmokeTests')
        tests_names = ['test_actions',
                       'test_rollback']

        test_classes = []

        for test_name in tests_names:
            test_classes.append('{0}.{1}'.format(test_class_main,
                                                 test_name))

        for test_name in test_classes:
            self.fuel_web.run_single_ostf_test(
                cluster_id=cluster_id, test_sets=['platform_tests'],
                test_name=test_name, timeout=60 * 60)

        self.env.make_snapshot("deploy_heat_ha")