Exemplo n.º 1
0
def interesting(cliArgs, tempPrefix):
    (timeout, regexEnabled, args) = parseOptions(cliArgs)

    searchFor = args[0]

    runinfo = timedRun.timed_run(args[1:], timeout, tempPrefix)

    result = (
        fileIngredients.fileContains(tempPrefix + "-out.txt", searchFor, regexEnabled)[0] or
        fileIngredients.fileContains(tempPrefix + "-err.txt", searchFor, regexEnabled)[0]
    )

    print 'Exit status: ' + runinfo.msg + " (%.3f seconds)" % runinfo.elapsedtime

    return result
Exemplo n.º 2
0
def interesting(cliArgs, tempPrefix):
    (timeout, regexEnabled, args) = parseOptions(cliArgs)

    searchFor = args[0]

    runinfo = timedRun.timed_run(args[1:], timeout, tempPrefix)

    result = (fileIngredients.fileContains(tempPrefix + "-out.txt", searchFor,
                                           regexEnabled)[0]
              or fileIngredients.fileContains(tempPrefix + "-err.txt",
                                              searchFor, regexEnabled)[0])

    print 'Exit status: ' + runinfo.msg + " (%.3f seconds)" % runinfo.elapsedtime

    return result
Exemplo n.º 3
0
def interesting(cliArgs, tempPrefix):
    (regexEnabled, crashSig, timeout, args) = parseOptions(cliArgs)

    # Examine stack for crash signature, this is needed if crashSig is specified.
    runinfo = timedRun.timed_run(args, timeout, tempPrefix)
    if runinfo.sta == timedRun.CRASHED:
        sps.grabCrashLog(args[0], runinfo.pid, tempPrefix, True)

    timeString = " (%.3f seconds)" % runinfo.elapsedtime

    crashLogName = tempPrefix + "-crash.txt"

    if runinfo.sta == timedRun.CRASHED:
        if os.path.exists(crashLogName):
            # When using this script, remember to escape characters, e.g. "\(" instead of "(" !
            found, _foundSig = fileIngredients.fileContains(
                crashLogName, crashSig, regexEnabled)
            if found:
                print 'Exit status: ' + runinfo.msg + timeString
                return True
            else:
                print "[Uninteresting] It crashed somewhere else!" + timeString
                return False
        else:
            print "[Uninteresting] It appeared to crash, but no crash log was found?" + timeString
            return False
    else:
        print "[Uninteresting] It didn't crash." + timeString
        return False
Exemplo n.º 4
0
def interesting(cliArgs, tempPrefix):
    (regexEnabled, crashSig, timeout, args) = parseOptions(cliArgs)

    # Examine stack for crash signature, this is needed if crashSig is specified.
    runinfo = timedRun.timed_run(args, timeout, tempPrefix)
    if runinfo.sta == timedRun.CRASHED:
        sps.grabCrashLog(args[0], runinfo.pid, tempPrefix, True)

    timeString = " (%.3f seconds)" % runinfo.elapsedtime

    crashLogName = tempPrefix + "-crash.txt"

    if runinfo.sta == timedRun.CRASHED:
        if os.path.exists(crashLogName):
            # When using this script, remember to escape characters, e.g. "\(" instead of "(" !
            found, _foundSig = fileIngredients.fileContains(crashLogName, crashSig, regexEnabled)
            if found:
                print 'Exit status: ' + runinfo.msg + timeString
                return True
            else:
                print "[Uninteresting] It crashed somewhere else!" + timeString
                return False
        else:
            print "[Uninteresting] It appeared to crash, but no crash log was found?" + timeString
            return False
    else:
        print "[Uninteresting] It didn't crash." + timeString
        return False