コード例 #1
0
 def sendPgElogFromMaster(self, msg, sendAlerts):
     """
     Send a message from the master database using select pg_elog ...
     """
     testOutput("Elog on master: " +
                ("(with alerts)" if sendAlerts else "(without alerts)") +
                msg)
コード例 #2
0
    def injectFaults(self, segments, messageText):

        inputFile = self.writeToTempFile(messageText)
        logger.info("Injecting fault on %d segment(s)", len(segments))
        testOutput("Injecting fault on %d segment(s)" % len(segments))

        # run the command in serial to each target
        for segment in segments:
            logger.info("Injecting fault on %s", segment)
            # if there is an error then an exception is raised by command execution
            cmd = gp.SendFilerepTransitionMessage("Fault Injector", inputFile.name, \
                                        segment.getSegmentPort(), base.LOCAL, segment.getSegmentHostName())
            cmd.run(validateAfter=False)

            # validate ourselves
            if cmd.results.rc != 0:
                raise ExceptionNoStackTraceNeeded("Injection Failed: %s" %
                                                  cmd.results.stderr)
            elif self.options.type == "status":
                # server side prints nice success messages on status...so print it
                str = cmd.results.stderr
                if str.startswith("Success: "):
                    str = str.replace("Success: ", "", 1)
                logger.info("%s", str)
        inputFile.close()
コード例 #3
0
ファイル: clsInjectFault.py プロジェクト: 50wu/gpdb
    def injectFaults(self, segments, messageText):

        inputFile = self.writeToTempFile(messageText)
        testOutput("Injecting fault on %d segment(s)" % len(segments))

        # run the command in serial to each target
        for segment in segments :
            logger.info("Injecting fault on content=%d:dbid=%d:mode=%s:status=%s", 
                segment.getSegmentContentId(), 
                segment.getSegmentDbId(), 
                segment.getSegmentMode(), 
                segment.getSegmentStatus())
            # if there is an error then an exception is raised by command execution
            cmd = gp.SendFilerepTransitionMessage("Fault Injector", inputFile.name, \
                                        segment.getSegmentPort(), base.LOCAL, segment.getSegmentHostName())
            cmd.run(validateAfter=False)


            # validate ourselves
            if cmd.results.rc != 0:
                raise ExceptionNoStackTraceNeeded("Injection Failed: %s" % cmd.results.stderr)
            elif self.options.type == "status":
                # server side prints nice success messages on status...so print it
                str = cmd.results.stderr
                if str.startswith("Success: "):
                    str = str.replace("Success: ", "", 1)
                str = str.replace("\n", "")
                logger.info("%s", str)
        inputFile.close()
コード例 #4
0
    def injectFaults(self, segments, messageText):

        inputFile = self.writeToTempFile(messageText)
        logger.info("Injecting fault on %d segment(s)", len(segments))
        testOutput("Injecting fault on %d segment(s)" % len(segments))

        # run the command in serial to each target
        for segment in segments :
            logger.info("Injecting fault on %s", segment)
            print "### DEBUG: injectFaults -> SendFilerepTransitionMessage inputFile.name = %s" % inputFile.name
            print "### DEBUG: injectFaults -> SendFilerepTransitionMessage segment.getPort = %s" % segment.getPort()
            print "### DEBUG: injectFaults -> SendFilerepTransitionMessage base.LOCAL = %s" % base.LOCAL
            print "### DEBUG: injectFaults -> SendFilerepTransitionMessage segment.getHostName = %s" % segment.getHostName()
            # if there is an error then an exception is raised by command execution
            cmd = gp.SendFilerepTransitionMessage("Fault Injector", inputFile.name, \
                                        segment.getPort(), base.LOCAL, segment.getHostName())
            
            print "### DEBUG: injectFaults -> Command = %s ###" % cmd
            print "### DEBUG: injectFaults -> SendFilerepTransitionMessage ###"
            cmd.run(validateAfter=False)

 
            print "### DEBUG: injectFaults -> Run ###"
            # validate ourselves
            if cmd.results.rc != 0:
                print "### DEBUG: injectFaults -> Injection Failed ###"
                raise ExceptionNoStackTraceNeeded("Injection Failed: %s" % cmd.results.stderr)
            elif self.options.type == "status":
                # server side prints nice success messages on status...so print it
                print "### DEBUG: injectFaults -> Report Status ###"
                str = cmd.results.stderr
                print "### DEBUG: injectFaults -> STDERROR = %s ###" % str
                if str.startswith("Success: "):
                    str = str.replace("Success: ", "", 1)
                logger.info("%s", str)
            
            print "### DEBUG: injectFaults -> END ###" 
        inputFile.close()
コード例 #5
0
 def sleep(self, sleepTime):
     testOutput("Sleeping (seconds): %.2f" % sleepTime)
コード例 #6
0
ファイル: osImplTest.py プロジェクト: 50wu/gpdb
 def sleep(self, sleepTime):
     testOutput("Sleeping (seconds): %.2f" % sleepTime)
コード例 #7
0
 def sendPgElogFromMaster( self, msg, sendAlerts):
     """
     Send a message from the master database using select pg_elog ...
     """
     testOutput("Elog on master: " + ("(with alerts)" if sendAlerts else "(without alerts)") + msg)