From: Hans-Christoph Steiner Date: Tue, 19 Sep 2017 14:48:20 +0000 (+0200) Subject: tests: move test APK with bad unicode filename to separate test X-Git-Tag: 0.9~74^2~10 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6adf309bef5ee7dbc6785d44d30f28c41ba2866b;p=fdroidserver.git tests: move test APK with bad unicode filename to separate test This filename has some messed up bytes related to bi-directional script that is included (Left-to-Right and Right-to-Left). GNU/Linux always interprets filenames as pure byte sequences. Windows and OSX store filenames as Unicode strings. So on OSX, the invalid filename gets converted to a valid name. That works fine, but the test fails because it is compared to a file generated on Ubuntu, where it preserves the byte sequence. This includes an APK with a valid Unicode filename that includes bi-directional script. --- diff --git "a/tests/repo/urzip-\317\200\303\207\303\207\317\200\303\207\303\207\347\216\260\344\273\243\346\261\211\350\257\255\351\200\232\347\224\250\345\255\227-\320\261\321\212\320\273\320\263\320\260\321\200\321\201\320\272\320\270-\330\271\330\261\330\250\331\2121234.apk" "b/tests/bad-unicode-\317\200\303\207\303\207\317\200\303\207\303\207\347\216\260\344\273\243\346\261\211\350\257\255\351\200\232\347\224\250\345\255\227-\320\261\321\212\320\273\320\263\320\260\321\200\321\201\320\272\320\270-\330\271\330\261\330\250\331\2121234.apk" similarity index 100% rename from "tests/repo/urzip-\317\200\303\207\303\207\317\200\303\207\303\207\347\216\260\344\273\243\346\261\211\350\257\255\351\200\232\347\224\250\345\255\227-\320\261\321\212\320\273\320\263\320\260\321\200\321\201\320\272\320\270-\330\271\330\261\330\250\331\2121234.apk" rename to "tests/bad-unicode-\317\200\303\207\303\207\317\200\303\207\303\207\347\216\260\344\273\243\346\261\211\350\257\255\351\200\232\347\224\250\345\255\227-\320\261\321\212\320\273\320\263\320\260\321\200\321\201\320\272\320\270-\330\271\330\261\330\250\331\2121234.apk" diff --git a/tests/repo/index.xml b/tests/repo/index.xml index 9836fc3e..a2eb17e3 100644 --- a/tests/repo/index.xml +++ b/tests/repo/index.xml @@ -244,7 +244,7 @@ 0.1 100 - urzip-πÇÇπÇÇ现代汉语通用字-български-عربي1234.apk + urzip-Sergey Vasilyevich Rakhmaninov; Серге́й Васи́льевич Рахма́нинов, IPA: [sʲɪrˈɡʲej rɐxˈmanʲɪnəf] سيرجي_رخمانينوف 谢尔盖·瓦西里耶维奇·拉赫玛.apk尼诺夫 .apk 15c0ec72c74a3791f42cdb43c57df0fb11a4dbb656851bbb8cf05b26a8372789 11471 4 diff --git "a/tests/repo/urzip-Sergey Vasilyevich Rakhmaninov; \320\241\320\265\321\200\320\263\320\265\314\201\320\270\314\206 \320\222\320\260\321\201\320\270\314\201\320\273\321\214\320\265\320\262\320\270\321\207 \320\240\320\260\321\205\320\274\320\260\314\201\320\275\320\270\320\275\320\276\320\262, IPA: [s\312\262\311\252r\313\210\311\241\312\262ej r\311\220x\313\210man\312\262\311\252n\311\231f] \330\263\331\212\330\261\330\254\331\212_\330\261\330\256\331\205\330\247\331\206\331\212\331\206\331\210\331\201 \350\260\242\345\260\224\347\233\226\302\267\347\223\246\350\245\277\351\207\214\350\200\266\347\273\264\345\245\207\302\267\346\213\211\350\265\253\347\216\233.apk\345\260\274\350\257\272\345\244\253 .apk" "b/tests/repo/urzip-Sergey Vasilyevich Rakhmaninov; \320\241\320\265\321\200\320\263\320\265\314\201\320\270\314\206 \320\222\320\260\321\201\320\270\314\201\320\273\321\214\320\265\320\262\320\270\321\207 \320\240\320\260\321\205\320\274\320\260\314\201\320\275\320\270\320\275\320\276\320\262, IPA: [s\312\262\311\252r\313\210\311\241\312\262ej r\311\220x\313\210man\312\262\311\252n\311\231f] \330\263\331\212\330\261\330\254\331\212_\330\261\330\256\331\205\330\247\331\206\331\212\331\206\331\210\331\201 \350\260\242\345\260\224\347\233\226\302\267\347\223\246\350\245\277\351\207\214\350\200\266\347\273\264\345\245\207\302\267\346\213\211\350\265\253\347\216\233.apk\345\260\274\350\257\272\345\244\253 .apk" new file mode 100644 index 00000000..0851e066 Binary files /dev/null and "b/tests/repo/urzip-Sergey Vasilyevich Rakhmaninov; \320\241\320\265\321\200\320\263\320\265\314\201\320\270\314\206 \320\222\320\260\321\201\320\270\314\201\320\273\321\214\320\265\320\262\320\270\321\207 \320\240\320\260\321\205\320\274\320\260\314\201\320\275\320\270\320\275\320\276\320\262, IPA: [s\312\262\311\252r\313\210\311\241\312\262ej r\311\220x\313\210man\312\262\311\252n\311\231f] \330\263\331\212\330\261\330\254\331\212_\330\261\330\256\331\205\330\247\331\206\331\212\331\206\331\210\331\201 \350\260\242\345\260\224\347\233\226\302\267\347\223\246\350\245\277\351\207\214\350\200\266\347\273\264\345\245\207\302\267\346\213\211\350\265\253\347\216\233.apk\345\260\274\350\257\272\345\244\253 .apk" differ diff --git a/tests/run-tests b/tests/run-tests index c58942bd..8558794e 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -8,7 +8,7 @@ echo_header() { copy_apks_into_repo() { set +x - for f in `find $APKDIR -name '*.apk' | grep -F -v -e unaligned -e unsigned -e badsig -e badcert`; do + for f in `find $APKDIR -name '*.apk' | grep -F -v -e unaligned -e unsigned -e badsig -e badcert -e bad-unicode`; do name=$(basename $(dirname `dirname $f`)) apk=`$aapt dump badging "$f" | sed -n "s,^package: name='\(.*\)' versionCode='\([0-9][0-9]*\)' .*,\1_\2.apk,p"` test $f -nt repo/$apk && rm -f repo/$apk # delete existing if $f is newer @@ -157,7 +157,7 @@ $fdroid init sed -i.tmp 's,^ *repo_description.*,repo_description = """获取已安装在您的设备上的应用的,' config.py echo "mirrors = ('https://foo.bar/fdroid', 'http://secret.onion/fdroid')" >> config.py mkdir metadata -cp $WORKSPACE/tests/urzip.apk repo/ +cp $WORKSPACE/tests/urzip.apk $WORKSPACE/tests/bad-unicode*.apk repo/ cp $WORKSPACE/tests/metadata/info.guardianproject.urzip.yml metadata/ $fdroid readmeta diff --git a/tests/stats/known_apks.txt b/tests/stats/known_apks.txt index 6d457a6f..b9fd7f4b 100644 --- a/tests/stats/known_apks.txt +++ b/tests/stats/known_apks.txt @@ -9,4 +9,4 @@ obb.main.twoversions_1101615.apk obb.main.twoversions 2016-01-01 obb.main.twoversions_1101617.apk obb.main.twoversions 2016-06-20 obb.mainpatch.current_1619.apk obb.mainpatch.current 2016-04-23 obb.mainpatch.current_1619_another-release-key.apk obb.mainpatch.current 2017-06-01 -urzip-πÇÇπÇÇ现代汉语通用字-български-عربي1234.apk info.guardianproject.urzip 2016-06-23 +urzip-Sergey Vasilyevich Rakhmaninov; Серге́й Васи́льевич Рахма́нинов, IPA: [sʲɪrˈɡʲej rɐxˈmanʲɪnəf] سيرجي_رخمانينوف 谢尔盖·瓦西里耶维奇·拉赫玛.apk尼诺夫 .apk info.guardianproject.urzip 2016-06-23