Beispiel #1
0
    def _load_config(self):
        config = load_yaml(self.config_file)
        self.full_config = config
        self.env_config = config['template']['cluster_template']
        self.env_settings = config['template']['cluster_template']['settings']
        self.config_name = config['template']['name']

        if 'devops_settings' in config['template']:
            self._devops_config = config
Beispiel #2
0
    def _load_config(self):
        config = load_yaml(self.config_file)
        self.full_config = config
        self.env_config = config[
            'template']['cluster_template']
        self.env_settings = config[
            'template']['cluster_template']['settings']
        self.config_name = config['template']['name']

        if 'devops_settings' in config['template']:
            self._devops_config = config
Beispiel #3
0
    def _load_config(self):
        """Read cluster config from yaml file."""

        config = load_yaml(self.config_file)
        self.full_config = config
        self.env_config = config["template"]["cluster_template"]
        self.env_settings = config["template"]["cluster_template"]["settings"]
        self.config_name = config["template"]["name"]

        if "devops_settings" in config["template"]:
            self._devops_config = config
    def setup_master(self):
        """Create environment and set up master node

        Snapshot: empty

        """
        # TODO: remove this code when fuel-devops will be ready to
        # describe all required network parameters (gateway, CIDR, IP range)
        # inside 'address_pool', so we can use 'network_pools' section
        # for L3 configuration in tests for multi racks
        if MULTIPLE_NETWORKS:
            from system_test.core.discover import load_yaml
            self._devops_config = load_yaml(MULTIPLE_NETWORKS_TEMPLATE)
        if USE_HAPROXY_TEMPLATE and SEPARATE_SERVICE_HAPROXY_PLUGIN_PATH:
            from system_test.core.discover import load_yaml
            self._devops_config = load_yaml(EXTERNAL_HAPROXY_TEMPLATE)
        if ENABLE_DMZ:
            from system_test.core.discover import load_yaml
            self._devops_config = load_yaml(ENABLE_DMZ_TEMPLATE)

        self.check_run("empty")

        with TimeStat("setup_environment", is_uniq=True):

            if list(self.env.d_env.get_nodes(role='fuel_master')):
                self.env.setup_environment()
                self.fuel_post_install_actions()

            elif list(self.env.d_env.get_nodes(role='centos_master')):
                # need to use centos_master.yaml devops template
                hostname = ''.join((settings.FUEL_MASTER_HOSTNAME,
                                    settings.DNS_SUFFIX))
                self.centos_setup_fuel(hostname)

            else:
                raise SkipTest(
                    "No Fuel master nodes found!")

        self.env.make_snapshot("empty", is_make=True)
        self.current_log_step = 0
 def config_plugins(self):
     """Config plugins for Fuel"""
     configs = {}
     for plugin_name, plugin_config in self.fuel_plugins.items():
         plugin_path_prefix = '/*/{0}'.format(plugin_name)
         # Enable plugin
         configs['{0}/metadata/enabled'.format(plugin_path_prefix)] = True
         if plugin_config is not None and 'config_file' in plugin_config:
             config_data = load_yaml(plugin_config['config_file'])
             for k, v in config_data.items():
                 configs['{0}/**/{1}/value'.format(plugin_path_prefix,
                                                   k)] = v
         logger.info("{} plugin has been enabled.".format(plugin_name))
     self._apply_cluster_attributes(configs)
Beispiel #6
0
    def setup_master(self):
        """Create environment and set up master node

        Snapshot: empty

        """
        # TODO: remove this code when fuel-devops will be ready to
        # describe all required network parameters (gateway, CIDR, IP range)
        # inside 'address_pool', so we can use 'network_pools' section
        # for L3 configuration in tests for multi racks
        if MULTIPLE_NETWORKS:
            from system_test.core.discover import load_yaml
            self._devops_config = load_yaml(MULTIPLE_NETWORKS_TEMPLATE)
        if USE_HAPROXY_TEMPLATE and SEPARATE_SERVICE_HAPROXY_PLUGIN_PATH:
            from system_test.core.discover import load_yaml
            self._devops_config = load_yaml(EXTERNAL_HAPROXY_TEMPLATE)

        self.check_run("empty")

        with TimeStat("setup_environment", is_uniq=True):
            self.env.setup_environment()
            self.fuel_post_install_actions()
        self.env.make_snapshot("empty", is_make=True)
        self.current_log_step = 0
Beispiel #7
0
    def setup_master(self):
        """Create environment and set up master node

        Snapshot: empty

        """
        # TODO: remove this code when fuel-devops will be ready to
        # describe all required network parameters (gateway, CIDR, IP range)
        # inside 'address_pool', so we can use 'network_pools' section
        # for L3 configuration in tests for multi racks
        if MULTIPLE_NETWORKS:
            from system_test.core.discover import load_yaml
            self._devops_config = load_yaml(MULTIPLE_NETWORKS_TEMPLATE)
        if USE_HAPROXY_TEMPLATE and SEPARATE_SERVICE_HAPROXY_PLUGIN_PATH:
            from system_test.core.discover import load_yaml
            self._devops_config = load_yaml(EXTERNAL_HAPROXY_TEMPLATE)

        self.check_run("empty")

        with TimeStat("setup_environment", is_uniq=True):
            self.env.setup_environment()
            self.fuel_post_install_actions()
        self.env.make_snapshot("empty", is_make=True)
        self.current_log_step = 0
    def bootstrap_multipath(self):
        """Bootstrap node with multipath devices

        Scenario:
            1. Setup environment
            2. Bootstrap slave nodes
            3. Verify multipath devices on the nodes

        Duration 30m

        """
        if not MULTIPATH:
            raise exceptions.FuelQAVariableNotSet(
                'MULTIPATH', 'true')
        if not MULTIPATH_TEMPLATE:
            raise exceptions.FuelQAVariableNotSet(
                'MULTIPATH_TEMPLATE',
                'system_test/tests_templates/tests_configs/'
                'multipath_3_nodes.yaml')
        if int(SLAVE_MULTIPATH_DISKS_COUNT) < 1:
            raise exceptions.FuelQAVariableNotSet(
                'SLAVE_MULTIPATH_DISKS_COUNT', '2')

        self.show_step(1)
        self._devops_config = load_yaml(MULTIPATH_TEMPLATE)
        with TimeStat("setup_environment", is_uniq=True):
            self.env.setup_environment()
            self.fuel_post_install_actions()
            if REPLACE_DEFAULT_REPOS and REPLACE_DEFAULT_REPOS_ONLY_ONCE:
                self.fuel_web.replace_default_repos()
        self.fuel_web.get_nailgun_version()
        self.fuel_web.change_default_network_settings()

        self.show_step(2)
        self.env.bootstrap_nodes(self.env.d_env.nodes().slaves[:3],
                                 skip_timesync=True)

        self.show_step(3)
        for ip in [node['ip'] for node in self.fuel_web.client.list_nodes()]:
            self.check_multipath_devices(ip, SLAVE_MULTIPATH_DISKS_COUNT)
    def bootstrap_multipath(self):
        """Bootstrap node with multipath devices

        Scenario:
            1. Setup environment
            2. Bootstrap slave nodes
            3. Verify multipath devices on the nodes

        Duration 30m

        """
        if not MULTIPATH:
            raise exceptions.FuelQAVariableNotSet('MULTIPATH', 'true')
        if not MULTIPATH_TEMPLATE:
            raise exceptions.FuelQAVariableNotSet(
                'MULTIPATH_TEMPLATE',
                'system_test/tests_templates/tests_configs/'
                'multipath_3_nodes.yaml')
        if int(SLAVE_MULTIPATH_DISKS_COUNT) < 1:
            raise exceptions.FuelQAVariableNotSet(
                'SLAVE_MULTIPATH_DISKS_COUNT', '2')

        self.show_step(1)
        self._devops_config = load_yaml(MULTIPATH_TEMPLATE)
        with TimeStat("setup_environment", is_uniq=True):
            self.env.setup_environment()
            self.fuel_post_install_actions()
            if REPLACE_DEFAULT_REPOS and REPLACE_DEFAULT_REPOS_ONLY_ONCE:
                self.fuel_web.replace_default_repos()
        self.fuel_web.get_nailgun_version()
        self.fuel_web.change_default_network_settings()

        self.show_step(2)
        self.env.bootstrap_nodes(self.env.d_env.nodes().slaves[:3],
                                 skip_timesync=True)

        self.show_step(3)
        for ip in [node['ip'] for node in self.fuel_web.client.list_nodes()]:
            self.check_multipath_devices(ip, SLAVE_MULTIPATH_DISKS_COUNT)