Exemple #1
0
    def install_elliptics_packages(self):
        """Installs elliptics packages on all servers and clients."""
        base_setup_playbook = "test-env-prepare"
        inventory_path = self.get_inventory_path(base_setup_playbook)
        groups = ansible_manager._get_groups_names("setup")

        ansible_manager.generate_inventory(inventory_path=inventory_path,
                                           clients_count=len(self.inventory['clients']),
                                           servers_per_group=[len(self.inventory['servers'])],
                                           groups=groups,
                                           instances_names=self.inventory,
                                           ssh_user=self.user)

        playbook = self.abspath(base_setup_playbook)
        ansible_manager.run_playbook(playbook, inventory_path)
Exemple #2
0
    def prepare_ansible_test_files(self):
        """Prepares ansible inventory and vars files for the tests."""
        # set global params for test suite
        if self.testsuite_params.get("_global"):
            ansible_manager.set_vars(vars_path=self._get_vars_path('test'),
                                     params=self.testsuite_params["_global"])

        for name, cfg in self.tests.items():
            groups = ansible_manager._get_groups_names(name)
            inventory_path = self.get_inventory_path(name)
            env = cfg["test_env_cfg"]

            ansible_manager.generate_inventory(inventory_path=inventory_path,
                                               clients_count=env["clients"]["count"],
                                               servers_per_group=env["servers"]["count_per_group"],
                                               groups=groups,
                                               instances_names=self.inventory,
                                               ssh_user=self.user)

            params = cfg["params"]
            if name in self.testsuite_params:
                params.update(self.testsuite_params[name])
            vars_path = self._get_vars_path(groups['test'])
            ansible_manager.set_vars(vars_path=vars_path, params=params)