Exemple #1
0
    def _stop_vitrage_processes():
        text_out = utils.get_from_terminal("pgrep vitrage-api")
        if text_out != '':
            LOG.debug("The vitrage-api process exist")
            utils.run_from_terminal("kill -9 " + text_out)

        text_out2 = utils.get_from_terminal("pgrep vitrage-graph")
        if text_out2 != '':
            LOG.debug("The vitrage-graph process exist")
            utils.run_from_terminal("kill -9 " + text_out2)
Exemple #2
0
    def _stop_vitrage_processes():
        text_out = utils.get_from_terminal("pgrep vitrage-api")
        if text_out != '':
            LOG.debug("The vitrage-api process exist")
            utils.run_from_terminal("kill -9 " + text_out)

        text_out2 = utils.get_from_terminal("pgrep vitrage-graph")
        if text_out2 != '':
            LOG.debug("The vitrage-graph process exist")
            utils.run_from_terminal("kill -9 " + text_out2)
Exemple #3
0
    def test_run_env(self):
        if self._show_vitrage_processes() is True:
            LOG.debug('The vitrage processed existed and should be removed')
            self._stop_vitrage_processes()

        self._get_env_params()

        utils.change_terminal_dir('/home/stack/devstack')
        utils.run_vitrage_command(". openrc " + self.user + " " +
                                  self.user)
        utils.run_from_terminal("openstack service create rca" +
                                " --name vitrage")
        utils.run_from_terminal("openstack endpoint create rca" +
                                # " --os-username " + self.user +
                                # " --os-username " + self.user +
                                # " --os-password " + self.password +
                                # " --os-auth-url " + self.url +
                                # " --os-project-name admin" +
                                " --adminurl http://" + self.host +
                                ":" + str(self.port) +
                                " --internalurl http://" + self.host +
                                ":" + str(self.port) +
                                " --publicurl http://" + self.host +
                                ":" + str(self.port) +
                                " --region RegionOne")

        utils.run_from_terminal("nohup vitrage-graph > /tmp/nohup-graph.out &")
        utils.run_from_terminal("nohup vitrage-api > /tmp/nohup-api.out &")

        if self._show_vitrage_processes() is False:
            LOG.error("No vitrage processes founded")
            raise ValueError("No vitrage processes founded")
        else:
            LOG.info('The vitrage processes exists')

        if self._validate_vitrage_processes() is False:
            LOG.error("The vitrage processes are not correct")
            self._stop_vitrage_processes()
            raise ValueError("The vitrage processes are not correct")
Exemple #4
0
    def test_run_env(self):
        if self._show_vitrage_processes() is True:
            LOG.debug('The vitrage processed existed and should be removed')
            self._stop_vitrage_processes()

        self._get_env_params()

        utils.change_terminal_dir('/home/stack/devstack')
        utils.run_vitrage_command(". openrc " + self.user + " " + self.user)
        utils.run_from_terminal("openstack service create rca" +
                                " --name vitrage")
        utils.run_from_terminal(
            "openstack endpoint create rca" +
            # " --os-username " + self.user +
            # " --os-username " + self.user +
            # " --os-password " + self.password +
            # " --os-auth-url " + self.url +
            # " --os-project-name admin" +
            " --adminurl http://" + self.host + ":" + str(self.port) +
            " --internalurl http://" + self.host + ":" + str(self.port) +
            " --publicurl http://" + self.host + ":" + str(self.port) +
            " --region RegionOne")

        utils.run_from_terminal("nohup vitrage-graph > /tmp/nohup-graph.out &")
        utils.run_from_terminal("nohup vitrage-api > /tmp/nohup-api.out &")

        if self._show_vitrage_processes() is False:
            LOG.error("No vitrage processes founded")
            raise ValueError("No vitrage processes founded")
        else:
            LOG.info('The vitrage processes exists')

        if self._validate_vitrage_processes() is False:
            LOG.error("The vitrage processes are not correct")
            self._stop_vitrage_processes()
            raise ValueError("The vitrage processes are not correct")
Exemple #5
0
 def test_stop_vitrage_processes():
     LOG.debug("Stop vitrage processes")
     utils.run_from_terminal("pkill vitrage")
Exemple #6
0
 def delete_alarms_templates_files():
     utils.run_from_terminal("rm /etc/vitrage/templates/*_alarm*")
Exemple #7
0
 def copy_alarms_templates_files():
     utils.run_from_terminal(
         "cp " + "vitrage_tempest_tests/tests/resources/templates/" +
         "*_alarm* /etc/vitrage/templates/.")
Exemple #8
0
 def delete_alarms_templates_files():
     utils.run_from_terminal(
         "rm /etc/vitrage/templates/*_alarm*")
Exemple #9
0
 def copy_alarms_templates_files():
     utils.run_from_terminal(
         "cp " +
         "vitrage_tempest_tests/tests/resources/templates/"
         + "*_alarm* /etc/vitrage/templates/.")
Exemple #10
0
 def test_stop_vitrage_processes():
     LOG.debug("Stop vitrage processes")
     utils.run_from_terminal("pkill vitrage")