Ejemplo n.º 1
0
    def runShellSequence(self, commands):
        terminate = False
        if commands is None:
            defer.returnValue(results.EXCEPTION)
        overall_result = results.SUCCESS
        for arg in commands:
            if not isinstance(arg, ShellArg):
                defer.returnValue(results.EXCEPTION)
            try:
                arg.validateAttributes()
            except config.ConfigErrors:
                defer.returnValue(results.EXCEPTION)

            # handle the command from the arg
            command = arg.command
            if not self.shouldRunTheCommand(command):
                continue

            # stick the command in self.command so that describe can use it
            self.command = command

            cmd = yield self.makeRemoteShellCommand(command=command,
                                                    stdioLogName=arg.logfile)
            yield self.runCommand(cmd)
            overall_result, terminate = results.computeResultAndTermination(
                arg, cmd.results(), overall_result)
            if terminate:
                break
        defer.returnValue(overall_result)
Ejemplo n.º 2
0
    def runShellSequence(self, commands):
        terminate = False
        if commands is None:
            log.msg("After rendering, ShellSequence `commands` is None")
            defer.returnValue(results.EXCEPTION)
        overall_result = results.SUCCESS
        for arg in commands:
            if not isinstance(arg, ShellArg):
                log.msg("After rendering, ShellSequence `commands` list "
                        "contains something that is not a ShellArg")
                defer.returnValue(results.EXCEPTION)
            try:
                arg.validateAttributes()
            except config.ConfigErrors as e:
                log.msg("After rendering, ShellSequence `commands` is "
                        "invalid: %s" % (e,))
                defer.returnValue(results.EXCEPTION)

            # handle the command from the arg
            command = arg.command
            if not self.shouldRunTheCommand(command):
                continue

            # keep the command around so we can describe it
            self.last_command = command

            cmd = yield self.makeRemoteShellCommand(command=command,
                                                    stdioLogName=arg.logfile)
            yield self.runCommand(cmd)
            overall_result, terminate = results.computeResultAndTermination(
                arg, cmd.results(), overall_result)
            if terminate:
                break
        defer.returnValue(overall_result)
Ejemplo n.º 3
0
 def do_test_carc(self, result, previousResult, newResult, terminate,
                  haltOnFailure=[True, False], flunkOnWarnings=[True, False],
                  flunkOnFailure=[True, False], warnOnWarnings=[True, False],
                  warnOnFailure=[True, False]):
     for hof in haltOnFailure:
         for fow in flunkOnWarnings:
             for fof in flunkOnFailure:
                 for wow in warnOnWarnings:
                     for wof in warnOnFailure:
                         self.haltOnFailure = hof
                         self.flunkOnWarnings = fow
                         self.flunkOnFailure = fof
                         self.warnOnWarnings = wow
                         self.warnOnFailure = wof
                         nr, term = results.computeResultAndTermination(
                             self, result, previousResult)
                         log.msg("res=%r prevRes=%r hof=%r fow=%r fof=%r "
                                 "wow=%r wof=%r => %r %r" %
                                 (results.Results[result],
                                  results.Results[previousResult],
                                  hof, fow, fof, wow, wof,
                                  results.Results[nr], term))
                         self.assertEqual((nr, term),
                                          (newResult, terminate),
                                          "see test.log for details")
Ejemplo n.º 4
0
 def do_test_carc(self,
                  result,
                  previousResult,
                  newResult,
                  terminate,
                  haltOnFailure=[True, False],
                  flunkOnWarnings=[True, False],
                  flunkOnFailure=[True, False],
                  warnOnWarnings=[True, False],
                  warnOnFailure=[True, False]):
     for hof in haltOnFailure:
         for fow in flunkOnWarnings:
             for fof in flunkOnFailure:
                 for wow in warnOnWarnings:
                     for wof in warnOnFailure:
                         self.haltOnFailure = hof
                         self.flunkOnWarnings = fow
                         self.flunkOnFailure = fof
                         self.warnOnWarnings = wow
                         self.warnOnFailure = wof
                         nr, term = results.computeResultAndTermination(
                             self, result, previousResult)
                         log.msg("res=%r prevRes=%r hof=%r fow=%r fof=%r "
                                 "wow=%r wof=%r => %r %r" %
                                 (results.Results[result],
                                  results.Results[previousResult], hof, fow,
                                  fof, wow, wof, results.Results[nr], term))
                         self.assertEqual((nr, term),
                                          (newResult, terminate),
                                          "see test.log for details")
Ejemplo n.º 5
0
    def runShellSequence(self, commands):
        terminate = False
        if commands is None:
            defer.returnValue(results.EXCEPTION)
        overall_result = results.SUCCESS
        for arg in commands:
            if not isinstance(arg, ShellArg):
                defer.returnValue(results.EXCEPTION)
            try:
                arg.validateAttributes()
            except config.ConfigErrors:
                defer.returnValue(results.EXCEPTION)

            # handle the command from the arg
            command = arg.command
            if not self.shouldRunTheCommand(command):
                continue

            # stick the command in self.command so that describe can use it
            self.command = command

            cmd = yield self.makeRemoteShellCommand(command=command,
                                                    stdioLogName=arg.logfile)
            yield self.runCommand(cmd)
            overall_result, terminate = results.computeResultAndTermination(
                arg, cmd.results(), overall_result)
            if terminate:
                break
        defer.returnValue(overall_result)
Ejemplo n.º 6
0
    def stepDone(self, results, step):
        """This method is called when the BuildStep completes. It is passed a
        status object from the BuildStep and is responsible for merging the
        Step's results into those of the overall Build."""

        terminate = False
        text = None
        if isinstance(results, tuple):
            results, text = results
        assert isinstance(results, type(SUCCESS)), "got %r" % (results,)
        log.msg(" step '%s' complete: %s" % (step.name, Results[results]))
        if text:
            self.text.extend(text)
        self.results, terminate = computeResultAndTermination(step, results, self.results)
        if not self.conn:
            terminate = True
        return terminate
Ejemplo n.º 7
0
    def stepDone(self, results, step):
        """This method is called when the BuildStep completes. It is passed a
        status object from the BuildStep and is responsible for merging the
        Step's results into those of the overall Build."""

        terminate = False
        text = None
        if isinstance(results, types.TupleType):
            results, text = results
        assert isinstance(results, type(SUCCESS)), "got %r" % (results, )
        log.msg(" step '%s' complete: %s" % (step.name, Results[results]))
        if text:
            self.text.extend(text)
        self.results, terminate = computeResultAndTermination(
            step, results, self.results)
        if not self.conn:
            terminate = True
        return terminate