Add POC + regression test.

Note that we override here the method check_no_ASAN_UBSAN_errors to also
analyze the last two lines of got_stderr.
This commit is contained in:
Luis Diaz Mas
2018-05-25 22:29:20 +02:00
committed by Luis Díaz Más
parent 67a5a74115
commit 8eca055058
2 changed files with 31 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
import system_tests
import os.path
class TestFirstPoC(metaclass=system_tests.CaseMeta):
"""
Regression test for the bug described in:
https://github.com/Exiv2/exiv2/issues/283
"""
url = "https://github.com/Exiv2/exiv2/issues/283"
def check_no_ASAN_UBSAN_errors(self, i, command, got_stderr, expected_stderr):
""" Override of system_tests.check_no_ASAN_UBSAN_errors for this particular test case.
Here we want to also check that the two last lines of got_stderr have the expected_stderr
"""
system_tests.check_no_ASAN_UBSAN_errors(self, i, command, got_stderr, expected_stderr)
self.assertListEqual(expected_stderr.splitlines(), got_stderr.splitlines()[-2:])
filename = os.path.join("$data_path", "pocIssue283.jpg")
commands = ["$exiv2 $filename"]
stdout = [""]
stderr = [
"""$exiv2_exception_message """ + filename + """:
$kerCorruptedMetadata
"""]
compare_stderr = check_no_ASAN_UBSAN_errors
retval = [1]