Blame tests/bugfixes/github/test_issue_828.py

Packit Service 21b5d1
# -*- coding: utf-8 -*-
Packit Service 21b5d1
Packit Service 21b5d1
from system_tests import CaseMeta, path
Packit Service 21b5d1
import unittest
Packit Service 21b5d1
Packit Service 21b5d1
@unittest.skip("Skipping test using option -pR (only for Debug mode)")
Packit Service 21b5d1
class SegmentationFaultPngImage(metaclass=CaseMeta):
Packit Service 21b5d1
    """
Packit Service 21b5d1
    Regression test for the bug described in:
Packit Service 21b5d1
    https://github.com/Exiv2/exiv2/issues/828
Packit Service 21b5d1
    """
Packit Service 21b5d1
    url = "https://github.com/Exiv2/exiv2/issues/828"
Packit Service 21b5d1
Packit Service 21b5d1
    filename = path("$data_path/issue_828_poc.png")
Packit Service 21b5d1
    commands = ["$exiv2 -pR $filename"]
Packit Service 21b5d1
    stdout = ["""STRUCTURE OF PNG FILE: $filename
Packit Service 21b5d1
 address | chunk |  length | data                           | checksum
Packit Service 21b5d1
       8 | IHDR  |      13 | .............                  | 0x085f152d
Packit Service 21b5d1
      33 | gAMA  |       4 | ....                           | 0x0bfc6105
Packit Service 21b5d1
      49 | PLTE  |     717 | .........].....Y..q..}..q..y.. | 0x7b35a4a5
Packit Service 21b5d1
     778 | tRNS  |     238 | -U...............}...=..e..... | 0xebd29012
Packit Service 21b5d1
    1028 | bKGD  |       1 | .                              | 0xcfb7d237
Packit Service 21b5d1
    1041 | tEXt  |      14 | Title.IceAlpha                 | 0xc562f8cb
Packit Service 21b5d1
    1067 | tEXt  |      31 | Author.Pieter S. van der Meule | 0x6bfe26a8
Packit Service 21b5d1
    1110 | tEXt  |     411 | Description.The original image | 0xe12effe4
Packit Service 21b5d1
"""
Packit Service 21b5d1
]
Packit Service 21b5d1
    stderr = [
Packit Service 21b5d1
        """$exiv2_exception_message $filename:
Packit Service 21b5d1
$kerCorruptedMetadata
Packit Service 21b5d1
"""]
Packit Service 21b5d1
    retval = [1]