Exemple #1
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")
Exemple #2
0
    def deploy_sahara_ha_gre(self):
        """Deploy cluster in HA mode with Sahara and Neutron GRE

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

        Duration 130m
        Snapshot: deploy_sahara_ha_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_5_slaves")

        LOGGER.debug('Create Fuel 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,
            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)

        LOGGER.debug('Verify Sahara service on all controllers')
        for slave in ["slave-01", "slave-02", "slave-03"]:
            _ip = self.fuel_web.get_nailgun_node_by_name(slave)['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(cluster_vip,
                             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_gre")
Exemple #3
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")
Exemple #4
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")
    def deploy_rh_based_compute(self):
        """Deploy RH-based compute in HA mode with Neutron VXLAN

        Scenario:
            1. Check required image.
            2. Revert snapshot 'ready_with_5_slaves'.
            3. Create a Fuel cluster.
            4. Update cluster nodes with required roles.
            5. Deploy the Fuel cluster.
            6. Run OSTF.
            7. Backup astute.yaml and ssh keys from compute.
            8. Boot compute with RH image.
            9. Prepare node for Puppet run.
            10. Execute modular tasks for compute.
            11. Run OSTF.

        Duration: 150m
        Snapshot: deploy_rh_compute_ha_tun

        """
        self.show_step(1, initialize=True)
        LOGGER.debug("Check MD5 sum of RH 7 image")
        check_image = checkers.check_image(settings.RH_IMAGE, settings.RH_IMAGE_MD5, settings.RH_IMAGE_PATH)
        asserts.assert_true(check_image, "Provided image is incorrect. " "Please, check image path and md5 sum of it.")

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

        self.show_step(3)
        LOGGER.debug("Create Fuel cluster RH-based compute tests")
        data = {
            "net_provider": "neutron",
            "net_segment_type": settings.NEUTRON_SEGMENT["tun"],
            "tenant": "RhHA",
            "user": "******",
            "password": "******",
        }
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__, mode=settings.DEPLOYMENT_MODE, settings=data
        )

        self.show_step(4)
        self.fuel_web.update_nodes(
            cluster_id,
            {
                "slave-01": ["controller"],
                "slave-02": ["controller"],
                "slave-03": ["controller"],
                "slave-04": ["compute"],
            },
        )

        self.show_step(5)
        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.show_step(6)
        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=["ha", "smoke", "sanity"])

        self.show_step(7)
        compute = self.fuel_web.get_nailgun_cluster_nodes_by_roles(cluster_id, ["compute"])[0]
        controller_name = "slave-01"
        controller_ip = self.fuel_web.get_nailgun_node_by_name(controller_name)["ip"]
        LOGGER.debug("Got node: {0}".format(compute))
        target_node_name = compute["name"].split("_")[0]
        LOGGER.debug("Target node name: {0}".format(target_node_name))
        target_node = self.env.d_env.get_node(name=target_node_name)
        LOGGER.debug("DevOps Node: {0}".format(target_node))
        target_node_ip = self.fuel_web.get_nailgun_node_by_name(target_node_name)["ip"]
        LOGGER.debug("Acquired ip: {0} for node: {1}".format(target_node_ip, target_node_name))

        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            old_hostname = self.save_node_hostname(remote)

        with self.env.d_env.get_admin_remote() as remote:
            self.backup_required_information(remote, target_node_ip)

        self.show_step(8)

        target_node.destroy()
        asserts.assert_false(target_node.driver.node_active(node=target_node), "Target node still active")
        self.connect_rh_image(target_node)
        target_node.start()
        asserts.assert_true(target_node.driver.node_active(node=target_node), "Target node did not start")
        self.wait_for_slave_provision(target_node_ip)
        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            self.verify_image_connected(remote)

        self.show_step(9)

        with self.env.d_env.get_admin_remote() as remote_admin:
            with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote_slave:
                self.restore_information(target_node_ip, remote_admin, remote_slave)

        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            self.set_hostname(remote)
            if not settings.CENTOS_DUMMY_DEPLOY:
                self.register_rh_subscription(remote)
            self.install_yum_components(remote)
            if not settings.CENTOS_DUMMY_DEPLOY:
                self.enable_rh_repos(remote)
            self.set_repo_for_perestroika(remote)
            self.check_hiera_installation(remote)
            self.install_ruby_puppet(remote)
            self.check_rsync_installation(remote)

        with self.env.d_env.get_admin_remote() as remote:
            self.rsync_puppet_modules(remote, target_node_ip)

        self.show_step(10)
        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            self.apply_first_part_puppet(remote)

        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            self.apply_networking_puppet(remote)

        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            self.check_netconfig_success(remote)
            self.apply_last_part_puppet(remote)

        with self.env.d_env.get_ssh_to_remote(controller_ip) as remote:
            self.remove_old_compute_services(remote, old_hostname)

        self.fuel_web.assert_cluster_ready(os_conn, smiles_count=13)

        self.show_step(11)
        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=["ha", "smoke", "sanity"])

        self.env.make_snapshot("ready_ha_with_rh_compute", is_make=True)
Exemple #6
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")
    def deploy_sahara_ha_one_controller_tun(self):
        """Deploy cluster in ha mode with 1 controller Sahara and Neutron VXLAN

        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_tun
        """
        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": settings.NEUTRON_SEGMENT["tun"],
            "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)

        LOGGER.debug("Verify Sahara service on controller")
        _ip = self.fuel_web.get_nailgun_node_by_name("slave-01")["ip"]
        with self.env.d_env.get_ssh_to_remote(_ip) as remote:
            checkers.verify_service(remote, service_name="sahara-api")
            checkers.verify_service(remote, service_name="sahara-engine")

        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")

        with open("{0}/{1}".format(settings.SERVTEST_LOCAL_PATH, settings.SERVTEST_SAHARA_VANILLA_2_IMAGE)) as data:
            os_conn.create_image(
                name=settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_NAME,
                properties=settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_META,
                data=data,
                is_public=True,
                disk_format="qcow2",
                container_format="bare",
            )

        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_tun")
Exemple #8
0
    def deploy_rhel_based_compute(self):
        """Deploy RHEL-based compute in HA mode with Neutron VXLAN

        Scenario:
            1. Check required image.
            2. Revert snapshot 'ready_with_5_slaves'.
            3. Create a Fuel cluster.
            4. Update cluster nodes with required roles.
            5. Deploy the Fuel cluster.
            6. Run OSTF.
            7. Backup astute.yaml and ssh keys from compute.
            8. Boot compute with RHEL image.
            9. Prepare node for Puppet run.
            10. Execute modular tasks for compute.
            11. Run OSTF.

        Duration: 150m
        Snapshot: deploy_rhel_compute_ha_tun

        """
        self.show_step(1, initialize=True)
        LOGGER.debug('Check MD5 sum of RHEL 7 image')
        check_image = checkers.check_image(
            settings.RHEL_IMAGE,
            settings.RHEL_IMAGE_MD5,
            settings.RHEL_IMAGE_PATH)
        asserts.assert_true(check_image,
                            'Provided image is incorrect. '
                            'Please, check image path and md5 sum of it.')

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

        self.show_step(3)
        LOGGER.debug('Create Fuel cluster RHEL-based compute tests')
        data = {
            'net_provider': 'neutron',
            'net_segment_type': settings.NEUTRON_SEGMENT['tun'],
            'tenant': 'RhelHA',
            'user': '******',
            'password': '******'
        }
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE,
            settings=data
        )

        self.show_step(4)
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['controller'],
                'slave-03': ['controller'],
                'slave-04': ['compute']
            }
        )

        self.show_step(5)
        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.show_step(6)
        self.fuel_web.run_ostf(cluster_id=cluster_id,
                               test_sets=['ha', 'smoke', 'sanity'])

        self.show_step(7)
        compute = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['compute'])[0]
        controller_name = 'slave-01'
        controller_ip = self.fuel_web.get_nailgun_node_by_name(
            controller_name)['ip']
        LOGGER.debug('Got node: {0}'.format(compute))
        target_node_name = compute['name'].split('_')[0]
        LOGGER.debug('Target node name: {0}'.format(target_node_name))
        target_node = self.env.d_env.get_node(name=target_node_name)
        LOGGER.debug('DevOps Node: {0}'.format(target_node))
        target_node_ip = self.fuel_web.get_nailgun_node_by_name(
            target_node_name)['ip']
        LOGGER.debug('Acquired ip: {0} for node: {1}'.format(
            target_node_ip, target_node_name))

        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            old_hostname = self.save_node_hostname(remote)

        with self.env.d_env.get_admin_remote() as remote:
            self.backup_required_information(remote, target_node_ip)

        self.show_step(8)

        target_node.destroy()
        asserts.assert_false(target_node.driver.node_active(node=target_node),
                             'Target node still active')
        self.connect_rhel_image(target_node)
        target_node.start()
        asserts.assert_true(target_node.driver.node_active(node=target_node),
                            'Target node did not start')
        self.wait_for_slave_provision(target_node_ip)
        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            self.verify_image_connected(remote)

        self.show_step(9)

        with self.env.d_env.get_admin_remote() as remote_admin:
            with self.env.d_env.get_ssh_to_remote(target_node_ip) as \
                    remote_slave:
                self.restore_information(target_node_ip,
                                         remote_admin, remote_slave)

        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            self.set_hostname(remote)
            if not settings.CENTOS_DUMMY_DEPLOY:
                self.register_rhel_subscription(remote)
            self.install_yum_components(remote)
            if not settings.CENTOS_DUMMY_DEPLOY:
                self.enable_rhel_repos(remote)
            self.set_repo_for_perestroika(remote)
            self.check_hiera_installation(remote)
            self.install_ruby_puppet(remote)
            self.disable_selinux(remote)
            self.check_rsync_installation(remote)

        with self.env.d_env.get_admin_remote() as remote:
            self.rsync_puppet_modules(remote, target_node_ip)

        self.show_step(10)
        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            self.apply_first_part_puppet(remote)

        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            self.apply_networking_puppet(remote)

        with self.env.d_env.get_ssh_to_remote(target_node_ip) as remote:
            self.check_netconfig_success(remote)
            self.apply_last_part_puppet(remote)

        with self.env.d_env.get_ssh_to_remote(controller_ip) as remote:
            self.remove_old_compute_services(remote, old_hostname)

        self.fuel_web.assert_cluster_ready(os_conn, smiles_count=13)

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

        self.env.make_snapshot("ready_ha_with_rhel_compute", is_make=True)
Exemple #9
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")
Exemple #10
0
    def check_vm_migration_rh_ha_one_controller_tun(self):
        """Deploy environment with RH and Ubuntu computes in HA mode with
           neutron VXLAN

        Scenario:
            1. Check required image.
            2. Revert snapshot 'ready_with_5_slaves'.
            3. Create a Fuel cluster.
            4. Update cluster nodes with required roles.
            5. Deploy the Fuel cluster.
            6. Run OSTF.
            7. Backup astute.yaml and ssh keys from one of computes.
            8. Boot compute with RH image.
            9. Prepare node for Puppet run.
            10. Execute modular tasks for compute.
            11. Run OSTF.


        Duration: 150m
        Snapshot: check_vm_migration_rh_ha_one_controller_tun

        """
        self.show_step(1, initialize=True)
        logger.debug('Check MD5 sum of RH 7 image')
        check_image = checkers.check_image(
            settings.RH_IMAGE,
            settings.RH_IMAGE_MD5,
            settings.RH_IMAGE_PATH)
        asserts.assert_true(check_image,
                            'Provided image is incorrect. '
                            'Please, check image path and md5 sum of it.')

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

        self.show_step(3)
        logger.debug('Create Fuel cluster RH-based compute tests')
        data = {
            'net_provider': 'neutron',
            'net_segment_type': settings.NEUTRON_SEGMENT['tun'],
            'tenant': 'RhHAMigration',
            'user': '******',
            'password': '******',
            'volumes_ceph': True,
            'ephemeral_ceph': True,
            'images_ceph': True,
            'objects_ceph': True,
            'osd_pool_size': "1"
        }

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

        self.show_step(4)
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute'],
                'slave-03': ['compute'],
                'slave-04': ['ceph-osd'],
            }
        )

        self.show_step(5)
        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.show_step(6)
        self.fuel_web.run_ostf(cluster_id=cluster_id,
                               test_sets=['smoke', 'sanity'])

        self.show_step(7)
        compute_one = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['compute'])[0]
        controller_ip = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['controller'])[0]['ip']
        logger.debug('Got node: {0}'.format(compute_one))
        target_node_one = self.fuel_web.get_devops_node_by_nailgun_node(
            compute_one)
        logger.debug('DevOps Node: {0}'.format(target_node_one))
        target_node_one_ip = compute_one['ip']
        logger.debug('Acquired ip: {0} for node: {1}'.format(
            target_node_one_ip, target_node_one.name))

        compute_two = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['compute'])[1]
        logger.debug('Got node: {0}'.format(compute_two))
        target_node_two = self.fuel_web.get_devops_node_by_nailgun_node(
            compute_two)
        logger.debug('DevOps Node: {0}'.format(target_node_two))
        target_node_two_ip = compute_two['ip']
        logger.debug('Acquired ip: {0} for node: {1}'.format(
            target_node_two_ip, target_node_two.name))

        old_hostname_one = self.save_node_hostname(target_node_one_ip)
        old_hostname_two = self.save_node_hostname(target_node_two_ip)

        self.backup_required_information(self.ssh_manager.admin_ip,
                                         target_node_one_ip, ceph=True)
        self.backup_required_information(self.ssh_manager.admin_ip,
                                         target_node_two_ip, ceph=True,
                                         node=2)
        self.backup_hosts_file(self.ssh_manager.admin_ip, controller_ip)

        self.show_step(8)

        target_node_one.destroy()
        target_node_two.destroy()
        asserts.assert_false(
            target_node_one.driver.node_active(node=target_node_one),
            'Target node still active')
        asserts.assert_false(
            target_node_two.driver.node_active(node=target_node_two),
            'Target node still active')
        self.connect_rh_image(target_node_one)
        self.connect_rh_image(target_node_two)
        target_node_one.start()
        asserts.assert_true(
            target_node_one.driver.node_active(node=target_node_one),
            'Target node did not start')
        self.wait_for_slave_provision(target_node_one_ip)
        target_node_two.start()
        asserts.assert_true(
            target_node_two.driver.node_active(node=target_node_two),
            'Target node did not start')
        self.wait_for_slave_provision(target_node_two_ip)
        self.verify_image_connected(target_node_one_ip)
        self.verify_image_connected(target_node_two_ip)

        self.show_step(9)

        self.restore_information(target_node_one_ip,
                                 self.ssh_manager.admin_ip, ceph=True)
        self.restore_information(target_node_two_ip,
                                 self.ssh_manager.admin_ip, ceph=True, node=2)

        new_host_one = self.set_hostname(target_node_one_ip)
        if not settings.CENTOS_DUMMY_DEPLOY:
            self.register_rh_subscription(target_node_one_ip)
        self.install_yum_components(target_node_one_ip)
        if not settings.CENTOS_DUMMY_DEPLOY:
            self.enable_rh_repos(target_node_one_ip)
        self.set_repo_for_perestroika(target_node_one_ip)
        self.check_hiera_installation(target_node_one_ip)
        self.install_ruby_puppet(target_node_one_ip)
        self.check_rsync_installation(target_node_one_ip)

        new_host_two = self.set_hostname(target_node_two_ip, host_number=2)
        if not settings.CENTOS_DUMMY_DEPLOY:
            self.register_rh_subscription(target_node_two_ip)
        self.install_yum_components(target_node_two_ip)
        if not settings.CENTOS_DUMMY_DEPLOY:
            self.enable_rh_repos(target_node_two_ip)
        self.set_repo_for_perestroika(target_node_two_ip)
        self.check_hiera_installation(target_node_two_ip)
        self.install_ruby_puppet(target_node_two_ip)
        self.check_rsync_installation(target_node_two_ip)

        self.rsync_puppet_modules(self.ssh_manager.admin_ip,
                                  target_node_one_ip)
        self.rsync_puppet_modules(self.ssh_manager.admin_ip,
                                  target_node_two_ip)
        self.prepare_hosts_file(self.ssh_manager.admin_ip, old_hostname_one,
                                new_host_one)
        self.prepare_hosts_file(self.ssh_manager.admin_ip, old_hostname_two,
                                new_host_two)
        self.restore_hosts_file(self.ssh_manager.admin_ip, target_node_one_ip)
        self.restore_hosts_file(self.ssh_manager.admin_ip, target_node_two_ip)

        self.show_step(10)
        self.apply_first_part_puppet(target_node_one_ip)
        self.apply_first_part_puppet(target_node_two_ip)
        self.apply_networking_puppet(target_node_one_ip)
        self.apply_networking_puppet(target_node_two_ip)
        self.check_netconfig_success(target_node_one_ip)
        self.apply_last_part_puppet(target_node_one_ip, ceph=True)
        self.check_netconfig_success(target_node_two_ip)
        self.apply_last_part_puppet(target_node_two_ip, ceph=True)

        self.remove_old_compute_services(controller_ip, old_hostname_one)
        self.remove_old_compute_services(controller_ip, old_hostname_two)

        self.fuel_web.assert_cluster_ready(os_conn, smiles_count=6)

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

        self.env.make_snapshot("ready_ha_one_controller_with_rh_computes")
Exemple #11
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")
Exemple #12
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")
Exemple #13
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")
Exemple #14
0
    def deploy_sahara_ha_one_controller_tun(self):
        """Deploy cluster in ha mode with 1 controller Sahara and Neutron VXLAN

        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_tun
        """

        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': settings.NEUTRON_SEGMENT['tun'],
            '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)

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

        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)

        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')

        with open('{0}/{1}'.format(
                settings.SERVTEST_LOCAL_PATH,
                settings.SERVTEST_SAHARA_VANILLA_2_IMAGE)) as data:
            os_conn.create_image(
                name=settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_NAME,
                properties=settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_META,
                data=data,
                is_public=True,
                disk_format='qcow2',
                container_format='bare')

        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_tun")
    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")
Exemple #16
0
    def check_vm_migration_rh_ha_one_controller_tun(self):
        """Deploy environment with RH and Ubuntu computes in HA mode with
           neutron VXLAN

        Scenario:
            1. Check required image.
            2. Revert snapshot 'ready_with_5_slaves'.
            3. Create a Fuel cluster.
            4. Update cluster nodes with required roles.
            5. Deploy the Fuel cluster.
            6. Run OSTF.
            7. Backup astute.yaml and ssh keys from one of computes.
            8. Boot compute with RH image.
            9. Prepare node for Puppet run.
            10. Execute modular tasks for compute.
            11. Run OSTF.


        Duration: 150m
        Snapshot: check_vm_migration_rh_ha_one_controller_tun

        """
        self.show_step(1, initialize=True)
        logger.debug('Check MD5 sum of RH 7 image')
        check_image = checkers.check_image(settings.RH_IMAGE,
                                           settings.RH_IMAGE_MD5,
                                           settings.RH_IMAGE_PATH)
        asserts.assert_true(
            check_image, 'Provided image is incorrect. '
            'Please, check image path and md5 sum of it.')

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

        self.show_step(3)
        logger.debug('Create Fuel cluster RH-based compute tests')
        data = {
            'net_provider': 'neutron',
            'net_segment_type': settings.NEUTRON_SEGMENT['tun'],
            'tenant': 'RhHAMigration',
            'user': '******',
            'password': '******',
            'volumes_ceph': True,
            'ephemeral_ceph': True,
            'images_ceph': True,
            'objects_ceph': True,
            'osd_pool_size': "1"
        }

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

        self.show_step(4)
        self.fuel_web.update_nodes(
            cluster_id, {
                'slave-01': ['controller'],
                'slave-02': ['compute'],
                'slave-03': ['compute'],
                'slave-04': ['ceph-osd'],
            })

        self.show_step(5)
        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.show_step(6)
        self.fuel_web.run_ostf(cluster_id=cluster_id,
                               test_sets=['smoke', 'sanity'])

        self.show_step(7)
        compute_one = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['compute'])[0]
        controller_ip = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['controller'])[0]['ip']
        logger.debug('Got node: {0}'.format(compute_one))
        target_node_one = self.fuel_web.get_devops_node_by_nailgun_node(
            compute_one)
        logger.debug('DevOps Node: {0}'.format(target_node_one))
        target_node_one_ip = compute_one['ip']
        logger.debug('Acquired ip: {0} for node: {1}'.format(
            target_node_one_ip, target_node_one.name))

        compute_two = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['compute'])[1]
        logger.debug('Got node: {0}'.format(compute_two))
        target_node_two = self.fuel_web.get_devops_node_by_nailgun_node(
            compute_two)
        logger.debug('DevOps Node: {0}'.format(target_node_two))
        target_node_two_ip = compute_two['ip']
        logger.debug('Acquired ip: {0} for node: {1}'.format(
            target_node_two_ip, target_node_two.name))

        old_hostname_one = self.save_node_hostname(target_node_one_ip)
        old_hostname_two = self.save_node_hostname(target_node_two_ip)

        self.backup_required_information(self.ssh_manager.admin_ip,
                                         target_node_one_ip,
                                         ceph=True)
        self.backup_required_information(self.ssh_manager.admin_ip,
                                         target_node_two_ip,
                                         ceph=True,
                                         node=2)
        self.backup_hosts_file(self.ssh_manager.admin_ip, controller_ip)

        self.show_step(8)

        target_node_one.destroy()
        target_node_two.destroy()
        asserts.assert_false(
            target_node_one.driver.node_active(node=target_node_one),
            'Target node still active')
        asserts.assert_false(
            target_node_two.driver.node_active(node=target_node_two),
            'Target node still active')
        self.connect_rh_image(target_node_one)
        self.connect_rh_image(target_node_two)
        target_node_one.start()
        asserts.assert_true(
            target_node_one.driver.node_active(node=target_node_one),
            'Target node did not start')
        self.wait_for_slave_provision(target_node_one_ip)
        target_node_two.start()
        asserts.assert_true(
            target_node_two.driver.node_active(node=target_node_two),
            'Target node did not start')
        self.wait_for_slave_provision(target_node_two_ip)
        self.verify_image_connected(target_node_one_ip)
        self.verify_image_connected(target_node_two_ip)

        self.show_step(9)

        self.restore_information(target_node_one_ip,
                                 self.ssh_manager.admin_ip,
                                 ceph=True)
        self.restore_information(target_node_two_ip,
                                 self.ssh_manager.admin_ip,
                                 ceph=True,
                                 node=2)

        new_host_one = self.set_hostname(target_node_one_ip)
        if not settings.CENTOS_DUMMY_DEPLOY:
            self.register_rh_subscription(target_node_one_ip)
        self.install_yum_components(target_node_one_ip)
        if not settings.CENTOS_DUMMY_DEPLOY:
            self.enable_rh_repos(target_node_one_ip)
        self.set_repo_for_perestroika(target_node_one_ip)
        self.check_hiera_installation(target_node_one_ip)
        self.install_ruby_puppet(target_node_one_ip)
        self.check_rsync_installation(target_node_one_ip)

        new_host_two = self.set_hostname(target_node_two_ip, host_number=2)
        if not settings.CENTOS_DUMMY_DEPLOY:
            self.register_rh_subscription(target_node_two_ip)
        self.install_yum_components(target_node_two_ip)
        if not settings.CENTOS_DUMMY_DEPLOY:
            self.enable_rh_repos(target_node_two_ip)
        self.set_repo_for_perestroika(target_node_two_ip)
        self.check_hiera_installation(target_node_two_ip)
        self.install_ruby_puppet(target_node_two_ip)
        self.check_rsync_installation(target_node_two_ip)

        self.rsync_puppet_modules(self.ssh_manager.admin_ip,
                                  target_node_one_ip)
        self.rsync_puppet_modules(self.ssh_manager.admin_ip,
                                  target_node_two_ip)
        self.prepare_hosts_file(self.ssh_manager.admin_ip, old_hostname_one,
                                new_host_one)
        self.prepare_hosts_file(self.ssh_manager.admin_ip, old_hostname_two,
                                new_host_two)
        self.restore_hosts_file(self.ssh_manager.admin_ip, target_node_one_ip)
        self.restore_hosts_file(self.ssh_manager.admin_ip, target_node_two_ip)

        self.show_step(10)
        self.apply_first_part_puppet(target_node_one_ip)
        self.apply_first_part_puppet(target_node_two_ip)
        self.apply_networking_puppet(target_node_one_ip)
        self.apply_networking_puppet(target_node_two_ip)
        self.check_netconfig_success(target_node_one_ip)
        self.apply_last_part_puppet(target_node_one_ip, ceph=True)
        self.check_netconfig_success(target_node_two_ip)
        self.apply_last_part_puppet(target_node_two_ip, ceph=True)

        self.remove_old_compute_services(controller_ip, old_hostname_one)
        self.remove_old_compute_services(controller_ip, old_hostname_two)

        self.fuel_web.assert_cluster_ready(os_conn, smiles_count=6)

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

        self.env.make_snapshot("ready_ha_one_controller_with_rh_computes")
    def deploy_ol_compute_ha_one_controller_tun(self):
        """Deploy OL-based compute in HA One Controller mode
        with Neutron VXLAN

        Scenario:
            1. Check required image.
            2. Revert snapshot 'ready_with_3_slaves'.
            3. Create a Fuel cluster.
            4. Update cluster nodes with required roles.
            5. Deploy the Fuel cluster.
            6. Run OSTF.
            7. Backup astute.yaml and ssh keys from compute.
            8. Boot compute with OL image.
            9. Prepare node for Puppet run.
            10. Execute modular tasks for compute.
            11. Run OSTF.

        Duration: 150m
        Snapshot: deploy_ol_compute_ha_one_controller_tun

        """
        self.show_step(1, initialize=True)
        logger.debug('Check MD5 sum of OL 7 image')
        check_image = checkers.check_image(
            settings.EXTRA_COMP_IMAGE,
            settings.EXTRA_COMP_IMAGE_MD5,
            settings.EXTRA_COMP_IMAGE_PATH)
        asserts.assert_true(check_image,
                            'Provided image is incorrect. '
                            'Please, check image path and md5 sum of it.')

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

        self.show_step(3)
        logger.debug('Create Fuel cluster OL-based compute tests')
        data = {
            'volumes_lvm': True,
            'net_provider': 'neutron',
            'net_segment_type': settings.NEUTRON_SEGMENT['tun'],
            'tenant': 'admin',
            'user': '******',
            'password': '******'
        }
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE,
            settings=data
        )

        self.show_step(4)
        self.fuel_web.update_nodes(
            cluster_id,
            {
                'slave-01': ['controller'],
                'slave-02': ['compute'],
                'slave-03': ['cinder']
            }
        )

        self.show_step(5)
        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.show_step(6)
        self.fuel_web.run_ostf(cluster_id=cluster_id,
                               test_sets=['smoke', 'sanity'])

        self.show_step(7)
        compute = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['compute'])[0]
        controller = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['controller'])[0]
        logger.debug('Got node: {0}'.format(compute))
        target_node = self.fuel_web.get_devops_node_by_nailgun_node(
            compute)
        logger.debug('DevOps Node: {0}'.format(target_node))
        target_node_ip = compute['ip']
        controller_ip = controller['ip']
        logger.debug('Acquired ip: {0} for node: {1}'.format(
            target_node_ip, target_node.name))

        old_hostname = self.save_node_hostname(target_node_ip)

        self.backup_required_information(self.ssh_manager.admin_ip,
                                         target_node_ip)

        self.show_step(8)

        target_node.destroy()
        asserts.assert_false(target_node.driver.node_active(node=target_node),
                             'Target node still active')
        self.connect_extra_compute_image(target_node)
        target_node.start()
        asserts.assert_true(target_node.driver.node_active(node=target_node),
                            'Target node did not start')
        self.wait_for_slave_provision(target_node_ip)
        self.verify_image_connected(target_node_ip, types='ol')

        self.show_step(9)

        self.restore_information(target_node_ip, self.ssh_manager.admin_ip)

        self.set_hostname(target_node_ip, types='ol')
        self.clean_custom_repos(target_node_ip)
        self.install_yum_components(target_node_ip)
        self.enable_extra_compute_repos(target_node_ip, types='ol')
        self.set_repo_for_perestroika(target_node_ip)
        self.check_hiera_installation(target_node_ip)
        self.install_ruby_puppet(target_node_ip)
        self.check_rsync_installation(target_node_ip)

        self.rsync_puppet_modules(self.ssh_manager.admin_ip, target_node_ip)

        self.show_step(10)
        self.apply_first_part_puppet(target_node_ip)
        self.apply_networking_puppet(target_node_ip)
        self.check_netconfig_success(target_node_ip)
        self.apply_last_part_puppet(target_node_ip)

        self.remove_old_compute_services(controller_ip, old_hostname)
        self.fuel_web.assert_cluster_ready(os_conn, smiles_count=5)

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

        self.env.make_snapshot("ready_ha_one_controller_with_ol_compute",
                               is_make=True)
Exemple #18
0
    def deploy_sahara_ha_one_controller_tun(self):
        """Deploy cluster in ha mode with 1 controller Sahara and Neutron VXLAN

        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_tun
        """

        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': settings.NEUTRON_SEGMENT['tun'],
            '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)

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

        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)

        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')

        with open('{0}/{1}'.format(
                settings.SERVTEST_LOCAL_PATH,
                settings.SERVTEST_SAHARA_VANILLA_2_IMAGE)) as data:
            os_conn.create_image(
                name=settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_NAME,
                properties=settings.SERVTEST_SAHARA_VANILLA_2_IMAGE_META,
                data=data,
                is_public=True,
                disk_format='qcow2',
                container_format='bare')

        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_tun")
Exemple #19
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_ol_compute_ha_one_controller_tun(self):
        """Deploy OL-based compute in HA One Controller mode
        with Neutron VXLAN

        Scenario:
            1. Check required image.
            2. Revert snapshot 'ready_with_3_slaves'.
            3. Create a Fuel cluster.
            4. Update cluster nodes with required roles.
            5. Deploy the Fuel cluster.
            6. Run OSTF.
            7. Backup astute.yaml and ssh keys from compute.
            8. Boot compute with OL image.
            9. Prepare node for Puppet run.
            10. Execute modular tasks for compute.
            11. Run OSTF.

        Duration: 150m
        Snapshot: deploy_ol_compute_ha_one_controller_tun

        """
        self.show_step(1, initialize=True)
        logger.debug('Check MD5 sum of OL 7 image')
        check_image = checkers.check_image(settings.EXTRA_COMP_IMAGE,
                                           settings.EXTRA_COMP_IMAGE_MD5,
                                           settings.EXTRA_COMP_IMAGE_PATH)
        asserts.assert_true(
            check_image, 'Provided image is incorrect. '
            'Please, check image path and md5 sum of it.')

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

        self.show_step(3)
        logger.debug('Create Fuel cluster OL-based compute tests')
        data = {
            'volumes_lvm': True,
            'net_provider': 'neutron',
            'net_segment_type': settings.NEUTRON_SEGMENT['tun'],
            'tenant': 'admin',
            'user': '******',
            'password': '******'
        }
        cluster_id = self.fuel_web.create_cluster(
            name=self.__class__.__name__,
            mode=settings.DEPLOYMENT_MODE,
            settings=data)

        self.show_step(4)
        self.fuel_web.update_nodes(
            cluster_id, {
                'slave-01': ['controller'],
                'slave-02': ['compute'],
                'slave-03': ['cinder']
            })

        self.show_step(5)
        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.show_step(6)
        self.fuel_web.run_ostf(cluster_id=cluster_id,
                               test_sets=['smoke', 'sanity'])

        self.show_step(7)
        compute = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['compute'])[0]
        controller = self.fuel_web.get_nailgun_cluster_nodes_by_roles(
            cluster_id, ['controller'])[0]
        logger.debug('Got node: {0}'.format(compute))
        target_node = self.fuel_web.get_devops_node_by_nailgun_node(compute)
        logger.debug('DevOps Node: {0}'.format(target_node))
        target_node_ip = compute['ip']
        controller_ip = controller['ip']
        logger.debug('Acquired ip: {0} for node: {1}'.format(
            target_node_ip, target_node.name))

        old_hostname = self.save_node_hostname(target_node_ip)

        self.backup_required_information(self.ssh_manager.admin_ip,
                                         target_node_ip)

        self.show_step(8)

        target_node.destroy()
        asserts.assert_false(target_node.driver.node_active(node=target_node),
                             'Target node still active')
        self.connect_extra_compute_image(target_node)
        target_node.start()
        asserts.assert_true(target_node.driver.node_active(node=target_node),
                            'Target node did not start')
        self.wait_for_slave_provision(target_node_ip)
        self.verify_image_connected(target_node_ip, types='ol')

        self.show_step(9)

        self.restore_information(target_node_ip, self.ssh_manager.admin_ip)

        self.set_hostname(target_node_ip, types='ol')
        self.clean_custom_repos(target_node_ip)
        self.install_yum_components(target_node_ip)
        self.enable_extra_compute_repos(target_node_ip, types='ol')
        self.set_repo_for_perestroika(target_node_ip)
        self.check_hiera_installation(target_node_ip)
        self.install_ruby_puppet(target_node_ip)
        self.check_rsync_installation(target_node_ip)

        self.rsync_puppet_modules(self.ssh_manager.admin_ip, target_node_ip)

        self.show_step(10)
        self.apply_first_part_puppet(target_node_ip)
        self.apply_networking_puppet(target_node_ip)
        self.check_netconfig_success(target_node_ip)
        self.apply_last_part_puppet(target_node_ip)

        self.remove_old_compute_services(controller_ip, old_hostname)
        self.fuel_web.assert_cluster_ready(os_conn, smiles_count=5)

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

        self.env.make_snapshot("ready_ha_one_controller_with_ol_compute",
                               is_make=True)
Exemple #21
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")
Exemple #22
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")
Exemple #23
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")