[Pkg-privacy-maintainers] Bug#980194: mat2: autopkgtest regression in testing: AssertionError: ValueError not raised

Paul Gevers elbrus at debian.org
Fri Jan 15 21:09:18 GMT 2021


Source: mat2
Version: 0.12.0-1
X-Debbugs-CC: debian-ci at lists.debian.org
Severity: serious
User: debian-ci at lists.debian.org
Usertags: regression

Dear maintainer(s),

With a very recent change in testing the autopkgtest of your package
started to fail. I copied some of the output at the bottom of this
report. Can you please investigate the situation and fix it?

More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

https://ci.debian.net/data/autopkgtest/testing/amd64/m/mat2/9718736/log.gz

=================================== FAILURES
===================================
_____________________________ TestGetMeta.test_png
_____________________________

self = <tests.test_climat2.TestGetMeta testMethod=test_png>

    def test_png(self):
        proc = subprocess.Popen(mat2_binary + ['--show',
'./tests/data/dirty.png'],
                stdout=subprocess.PIPE)
        stdout, _ = proc.communicate()
>       self.assertIn(b'Comment: This is a comment, be careful!', stdout)
E       AssertionError: b'Comment: This is a comment, be careful!' not
found in b"[-] ./tests/data/dirty.png's format (image/vnd.mozilla.apng)
is not supported\n"

tests/test_climat2.py:192: AssertionError
_______________________ TestCorruptedEmbedded.test_docx
________________________

self = <tests.test_corrupted_files.TestCorruptedEmbedded
testMethod=test_docx>

    def test_docx(self):
        shutil.copy('./tests/data/embedded_corrupted.docx',
'./tests/data/clean.docx')
        parser, _ = parser_factory.get_parser('./tests/data/clean.docx')
        with self.assertRaises(ValueError):
>           parser.remove_all()
E           AssertionError: ValueError not raised

tests/test_corrupted_files.py:69: AssertionError
_________________________ TestCorruptedFiles.test_png2
_________________________

self = <tests.test_corrupted_files.TestCorruptedFiles testMethod=test_png2>

    def test_png2(self):
        shutil.copy('./tests/test_libmat2.py', './tests/clean.png')
        with self.assertRaises(ValueError):
>           parser_factory.get_parser('./tests/clean.png')
E           AssertionError: ValueError not raised

tests/test_corrupted_files.py:126: AssertionError
_________________________ TestCorruptedFiles.test_tar
__________________________

self = <tests.test_corrupted_files.TestCorruptedFiles testMethod=test_tar>

    def test_tar(self):
        with tarfile.TarFile.open('./tests/data/clean.tar', 'w') as zout:
            zout.add('./tests/data/dirty.flac')
            zout.add('./tests/data/dirty.docx')
            zout.add('./tests/data/dirty.jpg')
            zout.add('./tests/data/embedded_corrupted.docx')
            tarinfo = tarfile.TarInfo(name='./tests/data/dirty.png')
            tarinfo.mtime = time.time()
            tarinfo.uid = 1337
            tarinfo.gid = 1338
            tarinfo.size = os.stat('./tests/data/dirty.png').st_size
            with open('./tests/data/dirty.png', 'rb') as f:
                zout.addfile(tarinfo, f)
        p, mimetype = parser_factory.get_parser('./tests/data/clean.tar')
        self.assertEqual(mimetype, 'application/x-tar')
        with self.assertRaises(ValueError):
>           p.get_meta()
E           AssertionError: ValueError not raised

tests/test_corrupted_files.py:321: AssertionError
_________________________ TestCorruptedFiles.test_zip
__________________________

self = <tests.test_corrupted_files.TestCorruptedFiles testMethod=test_zip>

    def test_zip(self):
        with zipfile.ZipFile('./tests/data/clean.zip', 'w') as zout:
            zout.write('./tests/data/dirty.flac')
            zout.write('./tests/data/dirty.docx')
            zout.write('./tests/data/dirty.jpg')
            zout.write('./tests/data/embedded_corrupted.docx')
        p, mimetype = parser_factory.get_parser('./tests/data/clean.zip')
        self.assertEqual(mimetype, 'application/zip')
        with self.assertRaises(ValueError):
>           p.get_meta()
E           AssertionError: ValueError not raised

tests/test_corrupted_files.py:243: AssertionError
________________ TestReadOnlyArchiveMembers.test_onlymember_tar
________________

self = <tests.test_corrupted_files.TestReadOnlyArchiveMembers
testMethod=test_onlymember_tar>

    def test_onlymember_tar(self):
        with tarfile.open('./tests/data/clean.tar', 'w') as zout:
            zout.add('./tests/data/dirty.png')
            tarinfo = tarfile.TarInfo('./tests/data/dirty.jpg')
            tarinfo.mtime = time.time()
            tarinfo.uid = 1337
            tarinfo.gid = 0
            tarinfo.mode = 0o000
            tarinfo.size = os.stat('./tests/data/dirty.jpg').st_size
            with open('./tests/data/dirty.jpg', 'rb') as f:
                zout.addfile(tarinfo=tarinfo, fileobj=f)
        p, mimetype = parser_factory.get_parser('./tests/data/clean.tar')
        self.assertEqual(mimetype, 'application/x-tar')
        meta = p.get_meta()
        self.assertEqual(meta['./tests/data/dirty.jpg']['uid'], '1337')
>       self.assertTrue(p.remove_all())
E       AssertionError: False is not true

tests/test_corrupted_files.py:347: AssertionError
_______________________ TestZipMetadata.test_libreoffice
_______________________

self = <tests.test_deep_cleaning.TestZipMetadata
testMethod=test_libreoffice>

    def test_libreoffice(self):
        shutil.copy('./tests/data/dirty.odt', './tests/data/clean.odt')
        p = office.LibreOfficeParser('./tests/data/clean.odt')

        meta = p.get_meta()
        self.assertIsNotNone(meta)

        ret = p.remove_all()
>       self.assertTrue(ret)
E       AssertionError: False is not true

tests/test_deep_cleaning.py:61: AssertionError
_________________________ TestZipMetadata.test_office
__________________________

self = <tests.test_deep_cleaning.TestZipMetadata testMethod=test_office>

    def test_office(self):
        shutil.copy('./tests/data/dirty.docx', './tests/data/clean.docx')
        p = office.MSOfficeParser('./tests/data/clean.docx')

        meta = p.get_meta()
        self.assertIsNotNone(meta)
>       self.assertEqual(meta['word/media/image1.png']['Comment'], 'This
is a comment, be careful!')
E       KeyError: 'Comment'

tests/test_deep_cleaning.py:39: KeyError
________________________ TestZipOrder.test_libreoffice
_________________________

self = <tests.test_deep_cleaning.TestZipOrder testMethod=test_libreoffice>

    def test_libreoffice(self):
        shutil.copy('./tests/data/dirty.odt', './tests/data/clean.odt')
        p = office.LibreOfficeParser('./tests/data/clean.odt')

        meta = p.get_meta()
        self.assertIsNotNone(meta)

        is_unordered = False
        with zipfile.ZipFile('./tests/data/clean.odt') as zin:
            previous_name = ''
            for item in zin.infolist():
                if previous_name == '':
                    if item.filename == 'mimetype':
                        continue
                    previous_name = item.filename
                    continue
                elif item.filename < previous_name:
                    is_unordered = True
                    break
        self.assertTrue(is_unordered)

        ret = p.remove_all()
>       self.assertTrue(ret)
E       AssertionError: False is not true

tests/test_deep_cleaning.py:96: AssertionError
_________________________ TestNsidRemoval.test_office
__________________________

self = <tests.test_deep_cleaning.TestNsidRemoval testMethod=test_office>

    def test_office(self):
        shutil.copy('./tests/data/dirty_with_nsid.docx',
'./tests/data/clean.docx')
        p = office.MSOfficeParser('./tests/data/clean.docx')

        meta = p.get_meta()
        self.assertIsNotNone(meta)

        how_many_rsid = False
        with zipfile.ZipFile('./tests/data/clean.docx') as zin:
            for item in zin.infolist():
                if not item.filename.endswith('.xml'):
                    continue
                num = zin.read(item).decode('utf-8').lower().count('w:rsid')
                how_many_rsid += num
        self.assertEqual(how_many_rsid, 1190)

        ret = p.remove_all()
>       self.assertTrue(ret)
E       AssertionError: False is not true

tests/test_deep_cleaning.py:160: AssertionError
_____________________________ TestGetMeta.test_tar
_____________________________

self = <tests.test_libmat2.TestGetMeta testMethod=test_tar>

    def test_tar(self):
        with tarfile.TarFile('./tests/data/dirty.tar', 'w') as tout:
            tout.add('./tests/data/dirty.flac')
            tout.add('./tests/data/dirty.docx')
            tout.add('./tests/data/dirty.jpg')
        p, mimetype = parser_factory.get_parser('./tests/data/dirty.tar')
        self.assertEqual(mimetype, 'application/x-tar')
        meta = p.get_meta()
        self.assertEqual(meta['./tests/data/dirty.flac']['comments'],
'Thank you for using MAT !')
>
self.assertEqual(meta['./tests/data/dirty.docx']['word/media/image1.png']['Comment'],
'This is a comment, be careful!')
E       KeyError: 'Comment'

tests/test_libmat2.py:226: KeyError
_____________________________ TestGetMeta.test_zip
_____________________________

self = <tests.test_libmat2.TestGetMeta testMethod=test_zip>

    def test_zip(self):
        with zipfile.ZipFile('./tests/data/dirty.zip', 'w') as zout:
            zout.write('./tests/data/dirty.flac')
            zout.write('./tests/data/dirty.docx')
            zout.write('./tests/data/dirty.jpg')
        p, mimetype = parser_factory.get_parser('./tests/data/dirty.zip')
        self.assertEqual(mimetype, 'application/zip')
        meta = p.get_meta()
        self.assertEqual(meta['tests/data/dirty.flac']['comments'],
'Thank you for using MAT !')
>
self.assertEqual(meta['tests/data/dirty.docx']['word/media/image1.png']['Comment'],
'This is a comment, be careful!')
E       KeyError: 'Comment'

tests/test_libmat2.py:185: KeyError
_______________________ TestRemovingThumbnails.test_odt
________________________

self = <tests.test_libmat2.TestRemovingThumbnails testMethod=test_odt>

    def test_odt(self):
        shutil.copy('./tests/data/revision.odt', './tests/data/clean.odt')

        zipin = zipfile.ZipFile(os.path.abspath('./tests/data/clean.odt'))
        self.assertIn('Thumbnails/thumbnail.png', zipin.namelist())
        zipin.close()

        p = office.LibreOfficeParser('./tests/data/clean.odt')
>       self.assertTrue(p.remove_all())
E       AssertionError: False is not true

tests/test_libmat2.py:243: AssertionError
____________________ TestRevisionsCleaning.test_libreoffice
____________________

self = <tests.test_libmat2.TestRevisionsCleaning
testMethod=test_libreoffice>

    def test_libreoffice(self):
        with zipfile.ZipFile('./tests/data/revision.odt') as zipin:
            c = zipin.open('content.xml')
            r = c.read()
            self.assertIn(b'tracked-changes', r)

        shutil.copy('./tests/data/revision.odt', './tests/data/clean.odt')
        p = office.LibreOfficeParser('./tests/data/clean.odt')
>       self.assertTrue(p.remove_all())
E       AssertionError: False is not true

tests/test_libmat2.py:262: AssertionError
_______________________ TestCleaning.test_all_parametred
_______________________

self = <tests.test_libmat2.TestCleaning testMethod=test_all_parametred>

    def test_all_parametred(self):
        for case in self.data:
            if 'ffmpeg' in case:
                try:
                    video._get_ffmpeg_path()
                except RuntimeError:
                    raise unittest.SkipTest

            print('[+] Testing %s' % case['name'])
            target = './tests/data/clean.' + case['name']
            shutil.copy('./tests/data/dirty.' + case['name'], target)
            p1 = case['parser'](target)

            for k, v in p1.get_meta().items():
                if k not in case['meta']:
                    continue
                if isinstance(v, dict):
                    for _k, _v in v.items():
                        if _k in case['meta'][k]:
                            self.assertEqual(_v, case['meta'][k][_k])
                else:
                    self.assertEqual(v, case['meta'][k])

            p1.lightweight_cleaning = True
>           self.assertTrue(p1.remove_all())
E           AssertionError: False is not true

tests/test_libmat2.py:500: AssertionError
----------------------------- Captured stdout call
-----------------------------
[+] Testing pdf
[+] Testing png
[+] Testing jpg
[+] Testing wav
[+] Testing mp3
[+] Testing ogg
[+] Testing flac
[+] Testing docx
________________________ TestCleaningArchives.test_tar
_________________________

self = <tests.test_libmat2.TestCleaningArchives testMethod=test_tar>

    def test_tar(self):
        with tarfile.TarFile.open('./tests/data/dirty.tar', 'w') as zout:
            zout.add('./tests/data/dirty.flac')
            zout.add('./tests/data/dirty.docx')
            zout.add('./tests/data/dirty.jpg')
        p = archive.TarParser('./tests/data/dirty.tar')
        meta = p.get_meta()
>
self.assertEqual(meta['./tests/data/dirty.docx']['word/media/image1.png']['Comment'],
'This is a comment, be careful!')
E       KeyError: 'Comment'

tests/test_libmat2.py:608: KeyError
_______________________ TestCleaningArchives.test_tarbz2
_______________________

self = <tests.test_libmat2.TestCleaningArchives testMethod=test_tarbz2>

    def test_tarbz2(self):
        with tarfile.TarFile.open('./tests/data/dirty.tar.bz2', 'w:bz2')
as zout:
            zout.add('./tests/data/dirty.flac')
            zout.add('./tests/data/dirty.docx')
            zout.add('./tests/data/dirty.jpg')
        p = archive.TarParser('./tests/data/dirty.tar.bz2')
        meta = p.get_meta()
>
self.assertEqual(meta['./tests/data/dirty.docx']['word/media/image1.png']['Comment'],
'This is a comment, be careful!')
E       KeyError: 'Comment'

tests/test_libmat2.py:678: KeyError
_______________________ TestCleaningArchives.test_targz
________________________

self = <tests.test_libmat2.TestCleaningArchives testMethod=test_targz>

    def test_targz(self):
        with tarfile.TarFile.open('./tests/data/dirty.tar.gz', 'w:gz')
as zout:
            zout.add('./tests/data/dirty.flac')
            zout.add('./tests/data/dirty.docx')
            zout.add('./tests/data/dirty.jpg')
        p = archive.TarParser('./tests/data/dirty.tar.gz')
        meta = p.get_meta()
>
self.assertEqual(meta['./tests/data/dirty.docx']['word/media/image1.png']['Comment'],
'This is a comment, be careful!')
E       KeyError: 'Comment'

tests/test_libmat2.py:643: KeyError
_______________________ TestCleaningArchives.test_tarxz
________________________

self = <tests.test_libmat2.TestCleaningArchives testMethod=test_tarxz>

    def test_tarxz(self):
        with tarfile.TarFile.open('./tests/data/dirty.tar.xz', 'w:xz')
as zout:
            zout.add('./tests/data/dirty.flac')
            zout.add('./tests/data/dirty.docx')
            zout.add('./tests/data/dirty.jpg')
        p = archive.TarParser('./tests/data/dirty.tar.xz')
        meta = p.get_meta()
>
self.assertEqual(meta['./tests/data/dirty.docx']['word/media/image1.png']['Comment'],
'This is a comment, be careful!')
E       KeyError: 'Comment'

tests/test_libmat2.py:713: KeyError
________________________ TestCleaningArchives.test_zip
_________________________

self = <tests.test_libmat2.TestCleaningArchives testMethod=test_zip>

    def test_zip(self):
        with zipfile.ZipFile('./tests/data/dirty.zip', 'w') as zout:
            zout.write('./tests/data/dirty.flac')
            zout.write('./tests/data/dirty.docx')
            zout.write('./tests/data/dirty.jpg')
        p = archive.ZipParser('./tests/data/dirty.zip')
        meta = p.get_meta()
>
self.assertEqual(meta['tests/data/dirty.docx']['word/media/image1.png']['Comment'],
'This is a comment, be careful!')
E       KeyError: 'Comment'

tests/test_libmat2.py:588: KeyError
___________________ TestComplexOfficeFiles.test_complex_pptx
___________________

self = <tests.test_libmat2.TestComplexOfficeFiles
testMethod=test_complex_pptx>

    def test_complex_pptx(self):
        target = './tests/data/clean.pptx'

shutil.copy('./tests/data/narrated_powerpoint_presentation.pptx', target)
        p = office.MSOfficeParser(target)
>       self.assertTrue(p.remove_all())
E       AssertionError: False is not true

tests/test_libmat2.py:786: AssertionError
==================== 21 failed, 98 passed in 46.47 seconds
=====================

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-privacy-maintainers/attachments/20210115/1febb5fb/attachment-0001.sig>


More information about the Pkg-privacy-maintainers mailing list