(mutatorName, stubName)
| 24 | @pytest.mark.parametrize("mutatorName,stubName", mutators) |
| 25 | |
| 26 | def test_mutators(mutatorName, stubName): |
| 27 | try: |
| 28 | for i in range(100): |
| 29 | payload = obHandler.genObfuscationLayer(inputCommand, userMutator=mutatorName, userStub=stubName) |
| 30 | |
| 31 | proc = Popen(payload, executable="bash", stdout=PIPE, stderr=STDOUT, shell=True, universal_newlines=True) |
| 32 | payloadOutput, __ = proc.communicate() |
| 33 | |
| 34 | assert(expectedOutput == payloadOutput) |
| 35 | except AssertionError: |
| 36 | if not os.path.exists("failing"): |
| 37 | os.mkdir("failing") |
| 38 | |
| 39 | date = datetime.now() |
| 40 | timestamp = str(date.month) + "." + str(date.day) + "." + str(date.year) + "-" + str(date.hour) + "." + str(date.minute) + "." + str(date.second) |
| 41 | with open("failing/" + mutatorName.replace("/", ".") + "-" + timestamp + ".sh", "w") as errorFile: |
| 42 | errorFile.write(payload) |
| 43 | raise |
nothing calls this directly
no test coverage detected