Ejemplo n.º 1
0
    def deploy_ha_one_controller_flat_master_node_fail(self):
        """Deploy HA cluster with nova-network and check it without master node

        Scenario:
            1. Create cluster in ha mode with 1 controller
            2. Add 1 node with controller role
            3. Add 1 node with compute role
            4. Deploy the cluster
            5. Validate cluster was set up correctly, there are no dead
            services, there are no errors in logs
            6. Verify networks
            7. Verify network configuration on controller
            8. Run OSTF
            9. Shut down master node
            10. Run openstack verification

        Duration 1000m

        """
        self.env.revert_snapshot("ready_with_3_slaves")

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__, mode=settings.DEPLOYMENT_MODE)
        self.fuel_web.update_nodes(cluster_id, {
            'slave-01': ['controller'],
            'slave-02': ['compute']
        })
        self.fuel_web.deploy_cluster_wait(cluster_id)
        controller_ip = self.fuel_web.get_public_vip(cluster_id)
        os_conn = os_actions.OpenStackActions(controller_ip)
        self.fuel_web.assert_cluster_ready(os_conn,
                                           smiles_count=6,
                                           networks_count=1,
                                           timeout=300)

        self.fuel_web.verify_network(cluster_id)
        logger.info('PASS DEPLOYMENT')
        self.fuel_web.run_ostf(cluster_id=cluster_id)
        logger.info('PASS OSTF')

        logger.info('Destroy admin node...')
        self.env.nodes().admin.destroy()
        logger.info('Admin node destroyed')

        common_func = common.Common(controller_ip, settings.SERVTEST_USERNAME,
                                    settings.SERVTEST_PASSWORD,
                                    settings.SERVTEST_TENANT)

        # create instance
        server = common_func.create_instance()

        # get_instance details
        details = common_func.get_instance_detail(server)
        assert_equal(details.name, 'test_instance')

        # Check if instacne active
        common_func.verify_instance_status(server, 'ACTIVE')

        # delete instance
        common_func.delete_instance(server)
    def deploy_ha_one_controller_neutron_master_node_fail(self):
        """Deploy HA cluster with neutron and check it without master node

        Scenario:
            1. Create cluster in ha mode with 1 controller
            2. Add 1 node with controller role
            3. Add 1 node with compute role
            4. Deploy the cluster
            5. Validate cluster was set up correctly, there are no dead
               services, there are no errors in logs
            6. Verify networks
            7. Verify network configuration on controller
            8. Run OSTF
            9. Shut down master node
            10. Run OpenStack verification

        Duration 1000m
        """
        self.env.revert_snapshot("ready_with_3_slaves")

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

        os_conn = os_actions.OpenStackActions(controller_ip)
        self.fuel_web.assert_cluster_ready(os_conn, smiles_count=5)
        net_name = self.fuel_web.get_cluster_predefined_networks_name(
            cluster_id)['private_net']

        self.fuel_web.verify_network(cluster_id)
        logger.info('PASS DEPLOYMENT')
        self.fuel_web.run_ostf(cluster_id=cluster_id)
        logger.info('PASS OSTF')

        logger.info('Destroy admin node...')
        try:
            self.env.d_env.nodes().admin.destroy()
            logger.info('Admin node destroyed')

            common_func = common.Common(controller_ip,
                                        settings.SERVTEST_USERNAME,
                                        settings.SERVTEST_PASSWORD,
                                        settings.SERVTEST_TENANT)

            # create instance
            server = common_func.create_instance(neutron_network=True,
                                                 label=net_name)

            # get_instance details
            details = common_func.get_instance_detail(server)
            assert_equal(details.name, 'test_instance')

            # Check if instance active
            common_func.verify_instance_status(server, 'ACTIVE')

            # delete instance
            common_func.delete_instance(server)
        except Exception:
            logger.error(
                'Failed to operate with cluster after master node destroy')
            logger.error(traceback.format_exc())
            raise
        finally:
            self.resume_admin_node()

        self.env.make_snapshot(
            "deploy_ha_one_controller_neutron_master_node_fail")
Ejemplo n.º 3
0
    def deploy_simple_flat_master_node_fail(self):
        """Deploy cluster in simple mode with flat nova-network

        Scenario:
            1. Create cluster
            2. Add 1 node with controller role
            3. Add 1 node with compute role
            4. Deploy the cluster
            5. Validate cluster was set up correctly, there are no dead
            services, there are no errors in logs
            6. Verify networks
            7. Verify network configuration on controller
            8. Run OSTF
            9. Shut down master node
            10. Run openstack verification

        """
        self.env.revert_snapshot("ready_with_3_slaves")

        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE_SIMPLE
        )
        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)

        task = self.fuel_web.run_network_verify(cluster_id)
        self.fuel_web.assert_task_success(task, 60 * 2, interval=10)
        logger.info('PASS DEPLOYMENT')
        self.fuel_web.run_ostf(
            cluster_id=cluster_id,
            should_fail=1,
            failed_test_name=['Create volume and attach it to instance'])
        logger.info('PASS OSTF')
        logger.info('Get controller ip')
        controller_ip = self.fuel_web.get_nailgun_node_by_name(
            'slave-01')['ip']
        logger.info('Destroy admin node...')
        self.env.nodes().admin.destroy()
        logger.info('Admin node destroyed')

        common_func = common.Common(
            controller_ip,
            settings.SERVTEST_USERNAME,
            settings.SERVTEST_PASSWORD,
            settings.SERVTEST_TENANT)

        # create instance
        server = common_func.create_instance()

        # get_instance details
        details = common_func.get_instance_detail(server)
        assert_equal(details.name, 'test_instance')

        # Check if instacne active
        common_func.verify_instance_status(server, 'ACTIVE')

        # delete instance
        common_func.delete_instance(server)