Skip to content

Commit

Permalink
#102 test UNZZIP-NOTFOUND and skip those 37 tests using it in test/zz…
Browse files Browse the repository at this point in the history
…iptests.py
  • Loading branch information
gdraheim committed Jan 3, 2021
1 parent 0e2588d commit 5873155
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions test/zziptests.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ def test_20344_zzxorcat_test4_zip(self):
#####################################################################
def test_20400_infozip_cat_test0_zip(self):
""" run inzo-zip cat test.zip using just archive README """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
zipfile = "test0.zip"
getfile = "README"
logfile = "test0.readme.pk.txt"
Expand All @@ -732,6 +733,7 @@ def test_20400_infozip_cat_test0_zip(self):
self.assertEqual(run.output.split("\n"), self.readme().split("\n"))
def test_20401_infozip_cat_test1_zip(self):
""" run info-zip cat test.zip using just archive README """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
zipfile = "test1.zip"
getfile = "README"
logfile = "test1.readme.pk.txt"
Expand All @@ -744,6 +746,7 @@ def test_20401_infozip_cat_test1_zip(self):
self.assertEqual("file-1\n", run.output)
def test_20402_infozip_cat_test2_zip(self):
""" run info-zip cat test.zip using just archive README """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
zipfile = "test2.zip"
getfile = "README"
logfile = "test2.readme.pk.txt"
Expand All @@ -756,6 +759,7 @@ def test_20402_infozip_cat_test2_zip(self):
self.assertEqual("file-22\n", run.output)
def test_20405_zzcat_big_test5_zip(self):
""" run info-zip cat test.zip using archive README """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
zipfile = "test5.zip"
getfile = "README"
logfile = "test5.readme.pk.txt"
Expand Down Expand Up @@ -1026,6 +1030,7 @@ def test_20445_zzcat_zap_test5_zip(self):

def test_20500_infozipdir_test0_zip(self):
""" run info-zip dir test0.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
zipfile = "test0.zip"
getfile = "test0.zip"
exe = self.bins("unzip")
Expand All @@ -1034,6 +1039,7 @@ def test_20500_infozipdir_test0_zip(self):
self.assertLess(len(run.output), 230)
def test_20501_infozipdir_test1_zip(self):
""" run info-zip dir test1.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
zipfile = "test1.zip"
getfile = "test1.zip"
exe = self.bins("unzip")
Expand All @@ -1044,6 +1050,7 @@ def test_20501_infozipdir_test1_zip(self):
self.assertIn(' README\n', run.output)
def test_20502_infozipdir_big_test2_zip(self):
""" run info-zip dir test2.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
zipfile = "test2.zip"
getfile = "test2.zip"
exe = self.bins("unzip")
Expand All @@ -1053,6 +1060,7 @@ def test_20502_infozipdir_big_test2_zip(self):
self.assertIn(' file.99\n', run.output)
def test_20503_infozipdir_big_test3_zip(self):
""" run info-zip dir test3.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
zipfile = "test3.zip"
getfile = "test3.zip"
exe = self.bins("unzip")
Expand All @@ -1062,6 +1070,7 @@ def test_20503_infozipdir_big_test3_zip(self):
self.assertIn(' file.999\n', run.output)
def test_20504_infozipdir_big_test4_zip(self):
""" run info-zip dir test4.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
zipfile = "test4.zip"
getfile = "test4.zip"
exe = self.bins("unzip")
Expand Down Expand Up @@ -1343,6 +1352,7 @@ def test_20595_zzextract_zap_test5_zip(self):
zip_CVE_2017_5977 = "00153-zziplib-invalidread-zzip_mem_entry_extra_block"
def test_59770_infozipdir_CVE_2017_5977(self):
""" run info-zip dir test0.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2017_5977
file_url = self.url_CVE_2017_5977
Expand Down Expand Up @@ -1456,6 +1466,7 @@ def test_59779(self):
zip_CVE_2017_5978 = "00156-zziplib-oobread-zzip_mem_entry_new"
def test_59780_infozipdir_CVE_2017_5978(self):
""" run info-zip dir test0.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2017_5978
file_url = self.url_CVE_2017_5978
Expand Down Expand Up @@ -1579,6 +1590,7 @@ def test_59789(self):
zip_CVE_2017_5979 = "00157-zziplib-nullptr-prescan_entry"
def test_59790_infozipdir_CVE_2017_5979(self):
""" run info-zip dir test0.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2017_5979
file_url = self.url_CVE_2017_5979
Expand Down Expand Up @@ -1694,6 +1706,7 @@ def test_59799(self):
zip_CVE_2017_5974 = "00150-zziplib-heapoverflow-__zzip_get32"
def test_59740_infozipdir_CVE_2017_5974(self):
""" run info-zip dir test0.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2017_5974
file_url = self.url_CVE_2017_5974
Expand Down Expand Up @@ -1808,6 +1821,7 @@ def test_59749(self):
zip_CVE_2017_5975 = "00151-zziplib-heapoverflow-__zzip_get64"
def test_59750_infozipdir_CVE_2017_5975(self):
""" run info-zip dir test0.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2017_5975
file_url = self.url_CVE_2017_5975
Expand Down Expand Up @@ -1931,6 +1945,7 @@ def test_59759(self):
zip_CVE_2017_5976 = "00152-zziplib-heapoverflow-zzip_mem_entry_extra_block"
def test_59760_infozipdir_CVE_2017_5976(self):
""" run info-zip dir test0.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2017_5976
file_url = self.url_CVE_2017_5976
Expand Down Expand Up @@ -2050,6 +2065,7 @@ def test_59769(self):
zip_CVE_2017_5980 = "00154-zziplib-nullptr-zzip_mem_entry_new"
def test_59800_infozipdir_CVE_2017_5980(self):
""" run info-zip dir test0.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2017_5980
file_url = self.url_CVE_2017_5980
Expand Down Expand Up @@ -2172,6 +2188,7 @@ def test_59809(self):
zip_CVE_2017_5981 = "00161-zziplib-assertionfailure-seeko_C"
def test_59810_infozipdir_CVE_2017_5981(self):
""" run info-zip dir test0.zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2017_5981
file_url = self.url_CVE_2017_5981
Expand Down Expand Up @@ -2289,6 +2306,7 @@ def test_59819(self):
zip_CVE_2018_10 = "zziplib_0-13-67_zzdir_invalid-memory-access_main.zip"
def test_63010(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_10
file_url = self.url_CVE_2018_10
Expand Down Expand Up @@ -2418,6 +2436,7 @@ def test_63019(self):
zip_CVE_2018_11 = "zziplib_0-13-67_unzzip_infinite-loop_unzzip_cat_file.zip"
def test_63110(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_11
file_url = self.url_CVE_2018_11
Expand Down Expand Up @@ -2537,6 +2556,7 @@ def test_63119(self):
zip_CVE_2018_12 = "zziplib_0-13-67_unzip-mem_buffer-access-with-incorrect-length-value_zzip_disk_fread.zip"
def test_63810(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_12
file_url = self.url_CVE_2018_12
Expand Down Expand Up @@ -2654,6 +2674,7 @@ def test_63819(self):
zip_CVE_2018_14 = "zziplib_0-13-67_zzdir_memory-alignment-errors___zzip_fetch_disk_trailer.zip"
def test_64840(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_14
file_url = self.url_CVE_2018_14
Expand Down Expand Up @@ -2784,6 +2805,7 @@ def test_64849(self):
zip_CVE_2018_15 = "zziplib_0-13-67_unzip-mem_memory-alignment-errors_zzip_disk_findfirst.zip"
def test_65400(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_15
file_url = self.url_CVE_2018_15
Expand Down Expand Up @@ -2900,6 +2922,7 @@ def test_65409(self):
zip_CVE_2018_16 = "zziplib_0-13-67_unzzip_memory-aligment-errors___zzip_fetch_disk_trailer.zip"
def test_65410(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_16
file_url = self.url_CVE_2018_16
Expand Down Expand Up @@ -3021,6 +3044,7 @@ def test_65419(self):
zip_CVE_2018_17 = "zziplib_0-13-67_unzip-mem_memory-alignment-errors_zzip_disk_findfirst_64.zip"
def test_65420(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_17
file_url = self.url_CVE_2018_17
Expand Down Expand Up @@ -3140,6 +3164,7 @@ def test_65429(self):
zip_CVE_2018_42 = "c006-unknown-add-main"
def test_65430(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_42
file_url = self.url_CVE_2018_42
Expand Down Expand Up @@ -3180,6 +3205,7 @@ def test_65431(self):
zip_CVE_2018_43 = "c008-main-unknown-de"
def test_65440(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_43
file_url = self.url_CVE_2018_43
Expand Down Expand Up @@ -3225,6 +3251,7 @@ def test_65441(self):
zip_CVE_2018_27_size = 56
def test_65450(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_27
file_url = self.url_CVE_2018_27
Expand Down Expand Up @@ -3361,6 +3388,7 @@ def test_65459(self):
zip_CVE_2018_41 = "c005-bus-zzip_parse_root_directory" # CVE-2018-7726.
def test_65460(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_41
file_url = self.url_CVE_2018_41
Expand Down Expand Up @@ -3401,6 +3429,7 @@ def test_65461(self):
zip_CVE_2018_39 = "003-unknow-def-zip"
def test_65470(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_39
file_url = self.url_CVE_2018_39
Expand Down Expand Up @@ -3527,6 +3556,7 @@ def test_65479(self):
zip_CVE_2018_40 = "002-mem-leaks-zip"
def test_65480(self):
""" info unzip -l $(CVE).zip """
if unzip_skip: self.skipTest("skip tests using infozip 'unzip'")
tmpdir = self.testdir()
filename = self.zip_CVE_2018_40
file_url = self.url_CVE_2018_40
Expand Down Expand Up @@ -3718,8 +3748,9 @@ def test_99000_make_test1w_zip(self):
logg.error(" no infozip 'zip' found, expect failing tests (given -Z %s)", opt.mkzip)
else:
mkzip = opt.mkzip
if opt.unzip.endswith("-NOTFOUND"):
logg.error("no infozip 'unzip' found, expect failing tests (given -U %s)", opt.unzip)
if opt.unzip.endswith("-NOTFOUND") or len(opt.unzip) < 3:
logg.error("no infozip 'unzip' found, expect skipped tests (given -U %s)", opt.unzip)
unzip_skip = True
else:
unzip = opt.unzip
exeext = opt.exeext
Expand Down

0 comments on commit 5873155

Please sign in to comment.