Ejemplo n.º 1
0
 def init_log_file(self):
     """
     reinitialize log file
     delete and create a new log file (empty)
     """
     myfab = FabricSupport(host=self.sth_host, user=self.fabric_user, password=self.fabric_password, cert_file=self.fabric_cert_file, retry=self.fabric_error_retry, hide=False, sudo=self.fabric_sudo)
     log = Remote_Log (file=self.log_file, fabric=myfab)
     log.delete_log_file()
     log.create_log_file(owner=self.log_owner, group=self.log_group, mod=self.log_mod)
Ejemplo n.º 2
0
    def verify_log(self, label, text):
        """
        Verify in log file if a label with a text exists
        :param label: label to find
        :param text: text to find (begin since the end)
        """
        myfab = FabricSupport(host=self.sth_host, user=self.fabric_user, password=self.fabric_password, cert_file=self.fabric_cert_file, retry=self.fabric_error_retry, hide=True, sudo=self.fabric_sudo)
        log = Remote_Log (fabric=myfab, file=self.log_file)
        line = log.find_line(label, text)

        #verify if a line with a level and a text exists in the log
        assert line != None, "ERROR  - label: \"%s\" and text: \"%s\" is not found.    \n       - %s" % (label, text, line)
        # verify if the new line in log has been wrote after the notification was sent
        assert self.date_time < log.get_line_time_in_log(line), "ERROR - the lines has not  been logged"
Ejemplo n.º 3
0
 def init_log_file(self):
     """
     reinitialize log file
     delete and create a new log file (empty)
     """
     myfab = FabricSupport(
         host=self.sth_host,
         user=self.fabric_user,
         password=self.fabric_password,
         cert_file=self.fabric_cert_file,
         retry=self.fabric_error_retry,
         hide=True,
         sudo=self.fabric_sudo,
     )
     log = Remote_Log(fabric=myfab)
     log.delete_log_file()
     log.create_log_file(owner="sysadmin", group="sysadmin", mod="777")
Ejemplo n.º 4
0
    def verify_log(self, label, text):
        """
        Verify in log file if a label with a text exists
        :param label: label to find
        :param text: text to find (begin since the end)
        """
        myfab = FabricSupport(host=self.sth_host,
                              user=self.fabric_user,
                              password=self.fabric_password,
                              cert_file=self.fabric_cert_file,
                              retry=self.fabric_error_retry,
                              hide=True,
                              sudo=self.fabric_sudo)
        log = Remote_Log(fabric=myfab, file=self.log_file)
        line = log.find_line(label, text)

        #verify if a line with a level and a text exists in the log
        assert line != None, "ERROR  - label: \"%s\" and text: \"%s\" is not found.    \n       - %s" % (
            label, text, line)
        # verify if the new line in log has been wrote after the notification was sent
        assert self.date_time < log.get_line_time_in_log(
            line), "ERROR - the lines has not  been logged"
Ejemplo n.º 5
0
 def init_log_file(self):
     """
     reinitialize log file
     delete and create a new log file (empty)
     """
     myfab = FabricSupport(host=self.sth_host,
                           user=self.fabric_user,
                           password=self.fabric_password,
                           cert_file=self.fabric_cert_file,
                           retry=self.fabric_error_retry,
                           hide=False,
                           sudo=self.fabric_sudo)
     log = Remote_Log(file=self.log_file, fabric=myfab)
     log.delete_log_file()
     log.create_log_file(owner=self.log_owner,
                         group=self.log_group,
                         mod=self.log_mod)