diff --git a/tools/donate-cpu.py b/tools/donate-cpu.py index f545928cb..ed0d3b27f 100644 --- a/tools/donate-cpu.py +++ b/tools/donate-cpu.py @@ -37,7 +37,7 @@ import platform # Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/ # Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic # changes) -CLIENT_VERSION = "1.1.8" +CLIENT_VERSION = "1.1.9" def checkRequirements(): @@ -208,7 +208,10 @@ def hasInclude(path, includes): for name in files: filename = os.path.join(root, name) try: - f = open(filename, 'rt') + if sys.version_info.major < 3: + f = open(filename, 'rt') + else: + f = open(filename, 'rt', errors='ignore') filedata = f.read() try: # Python2 needs to decode the data first diff --git a/tools/test/run_donate_cpu_client_tests.sh b/tools/test/run_donate_cpu_client_tests.sh index 567239d0d..b5d28297e 100644 --- a/tools/test/run_donate_cpu_client_tests.sh +++ b/tools/test/run_donate_cpu_client_tests.sh @@ -18,16 +18,22 @@ trap error_occurred ERR # Run tests client_script=../donate-cpu.py -test_package=ftp://ftp.se.debian.org/debian/pool/main/0/0xffff/0xffff_0.8.orig.tar.gz +test_packages=( +ftp://ftp.se.debian.org/debian/pool/main/0/0xffff/0xffff_0.8.orig.tar.gz +ftp://ftp.se.debian.org/debian/pool/main/a/actionaz/actionaz_3.8.0.orig.tar.gz +) for python_exec in "python" "python3" do - echo "Testing with ${python_exec} ..." - ${python_exec} ${client_script} --package=${test_package} - ${python_exec} ${client_script} --package=${test_package} -j1 - ${python_exec} ${client_script} --package=${test_package} -j2 - ${python_exec} ${client_script} --package=${test_package} --bandwidth-limit=250k - ${python_exec} ${client_script} --package=${test_package} -j2 --bandwidth-limit=0.5M + for test_package in "${test_packages[@]}" + do + echo "Testing package ${test_package} with ${python_exec} ..." + ${python_exec} ${client_script} --package=${test_package} + ${python_exec} ${client_script} --package=${test_package} -j1 + ${python_exec} ${client_script} --package=${test_package} -j2 + ${python_exec} ${client_script} --package=${test_package} --bandwidth-limit=250k + ${python_exec} ${client_script} --package=${test_package} -j2 --bandwidth-limit=0.5M + done done # Report result and exit accordingly