mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
tests: support running on platforms with old java
In order to test on travis-ci's OSX setup, its easiest to support the old version of Java that is installed there by default. It is pretty old, so it does not include the April 2017 update that disables MD5: https://blogs.oracle.com/java-platform-group/oracle-jre-will-no-longer-trust-md5-signed-code-by-default https://www.bleepingcomputer.com/news/security/oracle-to-block-jar-files-signed-with-md5-starting-with-april-2017 https://support.ca.com/us/knowledge-base-articles.TEC1691042.html #292 #323
This commit is contained in:
parent
cb10f0df09
commit
e4ca82d80c
1 changed files with 9 additions and 0 deletions
|
|
@ -8,11 +8,13 @@ import logging
|
||||||
import optparse
|
import optparse
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
import yaml
|
import yaml
|
||||||
from binascii import unhexlify
|
from binascii import unhexlify
|
||||||
|
from distutils.version import LooseVersion
|
||||||
|
|
||||||
localmodule = os.path.realpath(
|
localmodule = os.path.realpath(
|
||||||
os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..'))
|
os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..'))
|
||||||
|
|
@ -397,8 +399,15 @@ class UpdateTest(unittest.TestCase):
|
||||||
self.assertFalse(os.path.exists(os.path.join('archive', apkName)))
|
self.assertFalse(os.path.exists(os.path.join('archive', apkName)))
|
||||||
self.assertTrue(os.path.exists(os.path.join('repo', apkName)))
|
self.assertTrue(os.path.exists(os.path.join('repo', apkName)))
|
||||||
|
|
||||||
|
javac = config['jarsigner'].replace('jarsigner', 'javac')
|
||||||
|
v = subprocess.check_output([javac, '-version'], stderr=subprocess.STDOUT)[6:-1].decode('utf-8')
|
||||||
|
if LooseVersion(v) < LooseVersion('1.8.0_132'):
|
||||||
|
print('SKIPPING: running tests with old Java (' + v + ')')
|
||||||
|
return
|
||||||
|
|
||||||
# this test only works on systems with fully updated Java/jarsigner
|
# this test only works on systems with fully updated Java/jarsigner
|
||||||
# that has MD5 listed in jdk.jar.disabledAlgorithms in java.security
|
# that has MD5 listed in jdk.jar.disabledAlgorithms in java.security
|
||||||
|
# https://blogs.oracle.com/java-platform-group/oracle-jre-will-no-longer-trust-md5-signed-code-by-default
|
||||||
skip, apk, cachechanged = fdroidserver.update.process_apk({}, apkName, 'repo',
|
skip, apk, cachechanged = fdroidserver.update.process_apk({}, apkName, 'repo',
|
||||||
knownapks,
|
knownapks,
|
||||||
allow_disabled_algorithms=False,
|
allow_disabled_algorithms=False,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue