chiark / gitweb /
index: ensure index.xml timestamp is in UTC, closes #481
[fdroidserver.git] / tests / run-tests
1 #!/bin/bash
2
3 set -e # quit script on error
4
5 echo_header() {
6     { echo -e "==============================================================================\n$1"; } 2>/dev/null
7 }
8
9 copy_apks_into_repo() {
10     set +x
11     find $APKDIR -type f -name '*.apk' -print0 | while IFS= read -r -d '' f; do
12         echo $f | grep -F -v -e unaligned -e unsigned -e badsig -e badcert -e bad-unicode -e janus.apk || continue
13         apk=`$aapt dump badging "$f" | sed -n "s,^package: name='\(.*\)' versionCode='\([0-9][0-9]*\)' .*,\1_\2.apk,p"`
14         test "$f" -nt repo/$apk && rm -f repo/$apk  # delete existing if $f is newer
15         if [ ! -e repo/$apk ] && [ ! -e archive/$apk ]; then
16             echo "$f --> repo/$apk"
17             ln "$f" $1/repo/$apk || \
18                 rsync -axv "$f" $1/repo/$apk # rsync if hard link is not possible
19         fi
20     done
21     set -x
22 }
23
24 # keep this as an old version to test the automatic parsing of build-tools
25 # verion numbers in `fdroid init`
26 create_fake_android_home() {
27     mkdir $1/tools
28     mkdir $1/platform-tools
29     mkdir $1/build-tools
30     mkdir $1/build-tools/19.0.2
31     touch $1/build-tools/19.0.2/aapt
32 }
33
34 create_test_dir() {
35     test -e $WORKSPACE/.testfiles || mkdir $WORKSPACE/.testfiles
36     mktemp -d $WORKSPACE/.testfiles/run-tests.XXXX
37 }
38
39 create_test_file() {
40     test -e $WORKSPACE/.testfiles || mkdir $WORKSPACE/.testfiles
41     TMPDIR=$WORKSPACE/.testfiles  mktemp
42 }
43
44 fdroid_init_with_prebuilt_keystore() {
45     if [ -z "$1" ]; then
46         keystore=$WORKSPACE/tests/keystore.jks
47     else
48         keystore="$1"
49     fi
50     $fdroid init --keystore $keystore --repo-keyalias=sova
51     echo 'keystorepass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
52     echo 'keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
53 }
54
55 # the < is reverse since 0 means success in exit codes
56 have_git_2_3() {
57     python3 -c "import sys; from distutils.version import LooseVersion as V; sys.exit(V(sys.argv[3]) < V('2.3'))" `git --version`
58 }
59
60 is_MD5_disabled() {
61     javac $WORKSPACE/tests/IsMD5Disabled.java && java -cp $WORKSPACE/tests IsMD5Disabled
62     return $?
63 }
64
65 #------------------------------------------------------------------------------#
66 # "main"
67
68 if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
69     set +x
70     echo "Usage: $0 '/path/to/folder/with/apks'"
71     exit 1
72 fi
73
74 if [ -z "$ANDROID_HOME" ]; then
75     echo "ANDROID_HOME must be set with the path to the Android SDK, i.e.: "
76     echo "  export ANDROID_HOME=/opt/android-sdk"
77     exit 1
78 fi
79
80 if [ -d tests ]; then
81     cd tests
82 fi
83
84 if [ -z "$1" ]; then
85     APKDIR=`pwd`
86 else
87     APKDIR=$1
88 fi
89
90 if [ -z $WORKSPACE ]; then
91     WORKSPACE=`dirname $(pwd)`
92     echo "Setting Workspace to $WORKSPACE"
93 fi
94
95 # allow the location of the script to be overridden
96 if [ -z $fdroid ]; then
97     fdroid="$WORKSPACE/fdroid"
98 fi
99
100 # allow the location of aapt to be overridden
101 if [ -z $aapt ]; then
102     aapt=`ls -1 $ANDROID_HOME/build-tools/*/aapt | sort | tail -1`
103 fi
104
105 # try to use GNU sed on OSX/BSD cuz BSD sed sucks
106 if which gsed; then
107     sed=gsed
108 else
109     sed=sed
110 fi
111
112 set -x # show each command as it is executed
113
114 #------------------------------------------------------------------------------#
115 echo_header "run commit hooks"
116
117 cd $WORKSPACE
118 ./hooks/pre-commit
119
120
121 #------------------------------------------------------------------------------#
122 echo_header "test python getsig replacement"
123
124 cd $WORKSPACE/tests/getsig
125 ./make.sh
126
127 cd $WORKSPACE/tests
128 for testcase in $WORKSPACE/tests/i*.TestCase; do
129     if [ $testcase == $WORKSPACE/tests/install.TestCase ]; then
130         echo "skipping install.TestCase, its too troublesome in CI builds"
131         continue
132     fi
133     $testcase
134 done
135
136
137 #------------------------------------------------------------------------------#
138 echo_header "print fdroid version"
139
140 $fdroid --version
141
142
143 #------------------------------------------------------------------------------#
144 echo_header 'run process when building and signing are on separate machines'
145
146 REPOROOT=`create_test_dir`
147 cd $REPOROOT
148 cp $WORKSPACE/tests/keystore.jks $REPOROOT/
149 $fdroid init --keystore keystore.jks --repo-keyalias=sova
150 echo 'keystorepass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
151 echo 'keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
152 echo "accepted_formats = ['txt', 'yml']" >> config.py
153 echo 'keydname = "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"' >> config.py
154 test -d archive || mkdir archive
155 test -d metadata || mkdir metadata
156 cp $WORKSPACE/tests/metadata/info.guardianproject.urzip.yml metadata/
157 test -d repo || mkdir repo
158 test -d unsigned || mkdir unsigned
159 cp $WORKSPACE/tests/urzip-release-unsigned.apk unsigned/info.guardianproject.urzip_100.apk
160 $fdroid publish --verbose
161 $fdroid update --verbose --nosign
162 $fdroid signindex --verbose
163 test -e repo/index.xml
164 test -e repo/index.jar
165 test -e repo/index-v1.jar
166 test -e tmp/apkcache
167 ! test -z tmp/apkcache
168 test -L urzip.apk
169 grep -F '<application id=' repo/index.xml > /dev/null
170
171
172 #------------------------------------------------------------------------------#
173 echo_header "test UTF-8 metadata"
174
175 REPOROOT=`create_test_dir`
176 cd $REPOROOT
177
178 fdroid_init_with_prebuilt_keystore
179 $sed -i.tmp 's,^ *repo_description.*,repo_description = """获取已安装在您的设备上的应用的,' config.py
180 echo "mirrors = ('https://foo.bar/fdroid', 'http://secret.onion/fdroid')" >> config.py
181 mkdir metadata
182 cp $WORKSPACE/tests/urzip.apk $WORKSPACE/tests/bad-unicode*.apk repo/
183 cp $WORKSPACE/tests/metadata/info.guardianproject.urzip.yml metadata/
184
185 $fdroid readmeta
186 $fdroid update
187
188
189 #------------------------------------------------------------------------------#
190 echo_header 'run "fdroid build" in fresh git checkout from import.TestCase'
191
192 cd $WORKSPACE/tests/tmp/importer
193 git remote update -p
194 git clean -fdx
195 # stick with known working commit, in case future commits break things for this code
196 git reset --hard fea54e1161d5eb9eb1a54e26253ef84d3ab63705
197 if [ -d $ANDROID_HOME/platforms/android-23 && -d $ANDROID_HOME/build-tools/23.0.3 ]; then
198     echo "build_tools = '`ls -1 $ANDROID_HOME/build-tools/ | sort -n | tail -1`'" > config.py
199     echo "force_build_tools = True" >> config.py
200     $fdroid build --verbose org.fdroid.ci.test.app:300
201 else
202     echo 'WARNING: Skipping "fdroid build" test since android-23 is missing!'
203 fi
204
205 #------------------------------------------------------------------------------#
206 echo_header 'copy git import and run "fdroid scanner" on it'
207
208 REPOROOT=`create_test_dir`
209 cd $REPOROOT
210 cp $WORKSPACE/examples/fdroid-icon.png $REPOROOT/
211 mkdir metadata
212 echo "Auto Name:Just A Test" > metadata/org.fdroid.ci.test.app.txt
213 echo "Web Site:" >> metadata/org.fdroid.ci.test.app.txt
214 echo "Build:0.3,300" >> metadata/org.fdroid.ci.test.app.txt
215 echo "    commit=0.3" >> metadata/org.fdroid.ci.test.app.txt
216 echo "    subdir=app" >> metadata/org.fdroid.ci.test.app.txt
217 echo "    gradle=yes" >> metadata/org.fdroid.ci.test.app.txt
218 echo "" >> metadata/org.fdroid.ci.test.app.txt
219 echo "Repo:https://gitlab.com/fdroid/ci-test-app.git" >> metadata/org.fdroid.ci.test.app.txt
220 echo "Repo Type:git" >> metadata/org.fdroid.ci.test.app.txt
221 mkdir build
222 cp -a $WORKSPACE/tests/tmp/importer build/org.fdroid.ci.test.app
223 ls -l build/org.fdroid.ci.test.app
224 $fdroid scanner org.fdroid.ci.test.app --verbose
225
226
227 #------------------------------------------------------------------------------#
228 echo_header "copy tests/repo, generate java/gpg keys, update, and gpgsign"
229
230 REPOROOT=`create_test_dir`
231 GNUPGHOME=$REPOROOT/gnupghome
232 cd $REPOROOT
233 fdroid_init_with_prebuilt_keystore
234 cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $REPOROOT/
235 cp -a $WORKSPACE/tests/gnupghome $GNUPGHOME
236 chmod 0700 $GNUPGHOME
237 echo "accepted_formats = ['json', 'txt', 'yml']" >> config.py
238 echo "install_list = 'org.adaway'" >> config.py
239 echo "uninstall_list = ('com.android.vending', 'com.facebook.orca',)" >> config.py
240 echo "gpghome = '$GNUPGHOME'" >> config.py
241 echo "gpgkey = 'CE71F7FB'" >> config.py
242 echo "mirrors = ('http://foobarfoobarfoobar.onion/fdroid','https://foo.bar/fdroid',)" >> config.py
243 $fdroid update --verbose --pretty
244 test -e repo/index.xml
245 test -e repo/index.jar
246 test -e repo/index-v1.jar
247 grep -F '<application id=' repo/index.xml > /dev/null
248 grep -F '<install packageName=' repo/index.xml > /dev/null
249 grep -F '<uninstall packageName=' repo/index.xml > /dev/null
250 # OSX tests are run on Travis-CI, and gpg fails to launch gpg-agent there
251 if [ "$TRAVIS_OS_NAME" != "osx" ]; then
252     $fdroid gpgsign --verbose
253     $fdroid gpgsign --verbose
254     test -e repo/obb.mainpatch.current_1619.apk.asc
255     test -e repo/obb.main.twoversions_1101617_src.tar.gz.asc
256     ! test -e repo/obb.mainpatch.current_1619.apk.asc.asc
257     ! test -e repo/obb.main.twoversions_1101617_src.tar.gz.asc.asc
258     ! test -e repo/index.xml.asc
259 fi
260
261 v0timestamp=`$sed -n -e 's,.*timestamp="\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\)".*,\1,p' repo/index.xml`
262 v1timestamp=`$sed -n -e 's,.*"timestamp": \([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\).*,\1,p' repo/index-v1.json`
263 test $v0timestamp -eq $v1timestamp
264
265 # we can't easily reproduce the timestamps for things, so just hardcode them
266 $sed -i.tmp -e 's,timestamp="[0-9]*",timestamp="1480431575",' repo/index.xml
267 diff -uw $WORKSPACE/tests/repo/index.xml repo/index.xml
268 sed -i --expression='s,"timestamp": [0-9]*,"timestamp": 1502845383782,' repo/index-v1.json
269 diff -uw $WORKSPACE/tests/repo/index-v1.json repo/index-v1.json
270
271
272 #------------------------------------------------------------------------------#
273 echo_header 'test moving lots of APKs to the archive'
274
275 REPOROOT=`create_test_dir`
276 cd $REPOROOT
277 fdroid_init_with_prebuilt_keystore
278 echo "accepted_formats = ['txt']" >> config.py
279 $sed -i.tmp '/allow_disabled_algorithms/d' config.py
280 test -d metadata || mkdir metadata
281 cp $WORKSPACE/tests/metadata/*.txt metadata/
282 echo 'Summary:good test version of urzip' > metadata/info.guardianproject.urzip.txt
283 echo 'Summary:good MD5 sig, which is disabled algorithm' > metadata/org.bitbucket.tickytacky.mirrormirror.txt
284 $sed -i.tmp '/Archive Policy:/d' metadata/*.txt
285 test -d repo || mkdir repo
286 cp $WORKSPACE/tests/urzip.apk \
287    $WORKSPACE/tests/org.bitbucket.tickytacky.mirrormirror_[0-9].apk \
288    $WORKSPACE/tests/repo/com.politedroid_[0-9].apk \
289    $WORKSPACE/tests/repo/obb.main.twoversions_110161[357].apk \
290    repo/
291 $sed -i.tmp 's,archive_older = [0-9],archive_older = 3,' config.py
292
293 $fdroid update --pretty --nosign
294 echo "This will fail when jarsigner allows MD5 for APK signatures"
295 test `grep '<package>' archive/index.xml | wc -l` -eq 5
296 test `grep '<package>' repo/index.xml | wc -l` -eq 7
297
298
299 #------------------------------------------------------------------------------#
300 echo_header 'test per-app "Archive Policy"'
301
302 REPOROOT=`create_test_dir`
303 cd $REPOROOT
304 fdroid_init_with_prebuilt_keystore
305 echo "accepted_formats = ['txt']" >> config.py
306 test -d metadata || mkdir metadata
307 cp $WORKSPACE/tests/metadata/com.politedroid.txt metadata/
308 test -d repo || mkdir repo
309 cp $WORKSPACE/tests/repo/com.politedroid_[0-9].apk repo/
310 $sed -i.tmp 's,archive_older = [0-9],archive_older = 3,' config.py
311
312 $fdroid update --pretty --nosign
313 test `grep '<package>' archive/index.xml | wc -l` -eq 0
314 test `grep '<package>' repo/index.xml | wc -l` -eq 4
315 grep -F com.politedroid_3.apk repo/index.xml
316 grep -F com.politedroid_4.apk repo/index.xml
317 grep -F com.politedroid_5.apk repo/index.xml
318 grep -F com.politedroid_6.apk repo/index.xml
319 test -e repo/com.politedroid_3.apk
320 test -e repo/com.politedroid_4.apk
321 test -e repo/com.politedroid_5.apk
322 test -e repo/com.politedroid_6.apk
323
324 echo "enable one app in the repo"
325 $sed -i.tmp 's,^Archive Policy:4,Archive Policy:1,' metadata/com.politedroid.txt
326 $fdroid update --pretty --nosign
327 test `grep '<package>' archive/index.xml | wc -l` -eq 3
328 test `grep '<package>' repo/index.xml | wc -l` -eq 1
329 grep -F com.politedroid_3.apk archive/index.xml
330 grep -F com.politedroid_4.apk archive/index.xml
331 grep -F com.politedroid_5.apk archive/index.xml
332 grep -F com.politedroid_6.apk repo/index.xml
333 test -e archive/com.politedroid_3.apk
334 test -e archive/com.politedroid_4.apk
335 test -e archive/com.politedroid_5.apk
336 test -e repo/com.politedroid_6.apk
337
338 echo "remove all apps from the repo"
339 $sed -i.tmp 's,^Archive Policy:1,Archive Policy:0,' metadata/com.politedroid.txt
340 $fdroid update --pretty --nosign
341 test `grep '<package>' archive/index.xml | wc -l` -eq 4
342 test `grep '<package>' repo/index.xml | wc -l` -eq 0
343 grep -F com.politedroid_3.apk archive/index.xml
344 grep -F com.politedroid_4.apk archive/index.xml
345 grep -F com.politedroid_5.apk archive/index.xml
346 grep -F com.politedroid_6.apk archive/index.xml
347 test -e archive/com.politedroid_3.apk
348 test -e archive/com.politedroid_4.apk
349 test -e archive/com.politedroid_5.apk
350 test -e archive/com.politedroid_6.apk
351 ! test -e repo/com.politedroid_6.apk
352
353 echo "move back one from archive to the repo"
354 $sed -i.tmp 's,^Archive Policy:0,Archive Policy:1,' metadata/com.politedroid.txt
355 $fdroid update --pretty --nosign
356 test `grep '<package>' archive/index.xml | wc -l` -eq 3
357 test `grep '<package>' repo/index.xml | wc -l` -eq 1
358 grep -F com.politedroid_3.apk archive/index.xml
359 grep -F com.politedroid_4.apk archive/index.xml
360 grep -F com.politedroid_5.apk archive/index.xml
361 grep -F com.politedroid_6.apk repo/index.xml
362 test -e archive/com.politedroid_3.apk
363 test -e archive/com.politedroid_4.apk
364 test -e archive/com.politedroid_5.apk
365 ! test -e archive/com.politedroid_6.apk
366 test -e repo/com.politedroid_6.apk
367
368
369
370 #------------------------------------------------------------------------------#
371 echo_header 'test moving old APKs to and from the archive'
372
373 REPOROOT=`create_test_dir`
374 cd $REPOROOT
375 fdroid_init_with_prebuilt_keystore
376 echo "accepted_formats = ['txt']" >> config.py
377 test -d metadata || mkdir metadata
378 cp $WORKSPACE/tests/metadata/com.politedroid.txt metadata/
379 $sed -i.tmp '/Archive Policy:/d' metadata/com.politedroid.txt
380 test -d repo || mkdir repo
381 cp $WORKSPACE/tests/repo/com.politedroid_[0-9].apk repo/
382 $sed -i.tmp 's,archive_older = [0-9],archive_older = 3,' config.py
383
384 $fdroid update --pretty --nosign
385 test `grep '<package>' archive/index.xml | wc -l` -eq 1
386 test `grep '<package>' repo/index.xml | wc -l` -eq 3
387 grep -F com.politedroid_3.apk archive/index.xml
388 grep -F com.politedroid_4.apk repo/index.xml
389 grep -F com.politedroid_5.apk repo/index.xml
390 grep -F com.politedroid_6.apk repo/index.xml
391 test -e archive/com.politedroid_3.apk
392 test -e repo/com.politedroid_4.apk
393 test -e repo/com.politedroid_5.apk
394 test -e repo/com.politedroid_6.apk
395
396 $sed -i.tmp 's,archive_older = 3,archive_older = 1,' config.py
397 $fdroid update --pretty --nosign
398 test `grep '<package>' archive/index.xml | wc -l` -eq 3
399 test `grep '<package>' repo/index.xml | wc -l` -eq 1
400 grep -F com.politedroid_3.apk archive/index.xml
401 grep -F com.politedroid_4.apk archive/index.xml
402 grep -F com.politedroid_5.apk archive/index.xml
403 grep -F com.politedroid_6.apk repo/index.xml
404 test -e archive/com.politedroid_3.apk
405 test -e archive/com.politedroid_4.apk
406 test -e archive/com.politedroid_5.apk
407 test -e repo/com.politedroid_6.apk
408
409 # disabling deletes from the archive
410 $sed -i.tmp 's/Build:1.3,4/Build:1.3,4\n    disable=testing deletion/' metadata/com.politedroid.txt
411 $fdroid update --pretty --nosign
412 test `grep '<package>' archive/index.xml | wc -l` -eq 2
413 test `grep '<package>' repo/index.xml | wc -l` -eq 1
414 grep -F com.politedroid_3.apk archive/index.xml
415 ! grep -F com.politedroid_4.apk archive/index.xml
416 grep -F com.politedroid_5.apk archive/index.xml
417 grep -F com.politedroid_6.apk repo/index.xml
418 test -e archive/com.politedroid_3.apk
419 ! test -e archive/com.politedroid_4.apk
420 test -e archive/com.politedroid_5.apk
421 test -e repo/com.politedroid_6.apk
422
423 # disabling deletes from the repo, and promotes one from the archive
424 $sed -i.tmp 's/Build:1.5,6/Build:1.5,6\n    disable=testing deletion/' metadata/com.politedroid.txt
425 $fdroid update --pretty --nosign
426 test `grep '<package>' archive/index.xml | wc -l` -eq 1
427 test `grep '<package>' repo/index.xml | wc -l` -eq 1
428 grep -F com.politedroid_3.apk archive/index.xml
429 grep -F com.politedroid_5.apk repo/index.xml
430 ! grep -F com.politedroid_6.apk repo/index.xml
431 test -e archive/com.politedroid_3.apk
432 test -e repo/com.politedroid_5.apk
433 ! test -e repo/com.politedroid_6.apk
434
435
436 #------------------------------------------------------------------------------#
437 echo_header 'test allowing disabled signatures in repo and archive'
438
439 REPOROOT=`create_test_dir`
440 cd $REPOROOT
441 fdroid_init_with_prebuilt_keystore
442 echo "accepted_formats = ['txt']" >> config.py
443 echo 'allow_disabled_algorithms = True' >> config.py
444 $sed -i.tmp 's,archive_older = [0-9],archive_older = 3,' config.py
445 test -d metadata || mkdir metadata
446 cp $WORKSPACE/tests/metadata/com.politedroid.txt metadata/
447 echo 'Summary:good test version of urzip' > metadata/info.guardianproject.urzip.txt
448 echo 'Summary:good MD5 sig, disabled algorithm' > metadata/org.bitbucket.tickytacky.mirrormirror.txt
449 $sed -i.tmp '/Archive Policy:/d' metadata/*.txt
450 test -d repo || mkdir repo
451 cp $WORKSPACE/tests/repo/com.politedroid_[0-9].apk \
452    $WORKSPACE/tests/org.bitbucket.tickytacky.mirrormirror_[0-9].apk \
453    $WORKSPACE/tests/urzip-badsig.apk \
454    repo/
455
456 $fdroid update --pretty --nosign
457 test `grep '<package>' archive/index.xml | wc -l` -eq 2
458 test `grep '<package>' repo/index.xml | wc -l` -eq 6
459 grep -F com.politedroid_3.apk archive/index.xml
460 grep -F com.politedroid_4.apk repo/index.xml
461 grep -F com.politedroid_5.apk repo/index.xml
462 grep -F com.politedroid_6.apk repo/index.xml
463 grep -F org.bitbucket.tickytacky.mirrormirror_1.apk archive/index.xml
464 grep -F org.bitbucket.tickytacky.mirrormirror_2.apk repo/index.xml
465 grep -F org.bitbucket.tickytacky.mirrormirror_3.apk repo/index.xml
466 grep -F org.bitbucket.tickytacky.mirrormirror_4.apk repo/index.xml
467 ! grep -F urzip-badsig.apk repo/index.xml
468 ! grep -F urzip-badsig.apk archive/index.xml
469 test -e archive/com.politedroid_3.apk
470 test -e repo/com.politedroid_4.apk
471 test -e repo/com.politedroid_5.apk
472 test -e repo/com.politedroid_6.apk
473 test -e archive/org.bitbucket.tickytacky.mirrormirror_1.apk
474 test -e repo/org.bitbucket.tickytacky.mirrormirror_2.apk
475 test -e repo/org.bitbucket.tickytacky.mirrormirror_3.apk
476 test -e repo/org.bitbucket.tickytacky.mirrormirror_4.apk
477 test -e archive/urzip-badsig.apk
478
479 $sed -i.tmp '/allow_disabled_algorithms/d' config.py
480 $fdroid update --pretty --nosign
481 test `grep '<package>' archive/index.xml | wc -l` -eq 5
482 test `grep '<package>' repo/index.xml | wc -l` -eq 3
483 grep -F org.bitbucket.tickytacky.mirrormirror_1.apk archive/index.xml
484 grep -F org.bitbucket.tickytacky.mirrormirror_2.apk archive/index.xml
485 grep -F org.bitbucket.tickytacky.mirrormirror_3.apk archive/index.xml
486 grep -F org.bitbucket.tickytacky.mirrormirror_4.apk archive/index.xml
487 grep -F com.politedroid_3.apk archive/index.xml
488 grep -F com.politedroid_4.apk repo/index.xml
489 grep -F com.politedroid_5.apk repo/index.xml
490 grep -F com.politedroid_6.apk repo/index.xml
491 ! grep -F urzip-badsig.apk repo/index.xml
492 ! grep -F urzip-badsig.apk archive/index.xml
493 test -e archive/org.bitbucket.tickytacky.mirrormirror_1.apk
494 test -e archive/org.bitbucket.tickytacky.mirrormirror_2.apk
495 test -e archive/org.bitbucket.tickytacky.mirrormirror_3.apk
496 test -e archive/org.bitbucket.tickytacky.mirrormirror_4.apk
497 test -e archive/com.politedroid_3.apk
498 test -e archive/urzip-badsig.apk
499 test -e repo/com.politedroid_4.apk
500 test -e repo/com.politedroid_5.apk
501 test -e repo/com.politedroid_6.apk
502
503
504 #------------------------------------------------------------------------------#
505 echo_header 'rename apks with `fdroid update --rename-apks`, --nosign for speed'
506
507 REPOROOT=`create_test_dir`
508 cd $REPOROOT
509 fdroid_init_with_prebuilt_keystore
510 echo "accepted_formats = ['txt', 'yml']" >> config.py
511 echo 'keydname = "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"' >> config.py
512 test -d metadata || mkdir metadata
513 cp $WORKSPACE/tests/metadata/info.guardianproject.urzip.yml metadata/
514 test -d repo || mkdir repo
515 cp $WORKSPACE/tests/urzip.apk "repo/asdfiuhk urzip-πÇÇπÇÇ现代汉语通用字-български-عربي1234 ö.apk"
516 $fdroid update --rename-apks --pretty --nosign
517 test -e repo/info.guardianproject.urzip_100.apk
518 grep -F 'info.guardianproject.urzip_100.apk' repo/index-v1.json repo/index.xml
519 cp $WORKSPACE/tests/urzip-release.apk repo/
520 $fdroid update --rename-apks --pretty --nosign
521 test -e repo/info.guardianproject.urzip_100.apk
522 test -e repo/info.guardianproject.urzip_100_b4964fd.apk
523 grep -F 'info.guardianproject.urzip_100.apk' repo/index-v1.json repo/index.xml
524 grep -F 'info.guardianproject.urzip_100_b4964fd.apk' repo/index-v1.json
525 ! grep -F 'info.guardianproject.urzip_100_b4964fd.apk' repo/index.xml
526 cp $WORKSPACE/tests/urzip-release.apk repo/
527 $fdroid update --rename-apks --pretty --nosign
528 test -e repo/info.guardianproject.urzip_100.apk
529 test -e repo/info.guardianproject.urzip_100_b4964fd.apk
530 test -e duplicates/repo/info.guardianproject.urzip_100_b4964fd.apk
531 grep -F 'info.guardianproject.urzip_100.apk' repo/index-v1.json repo/index.xml
532 grep -F 'info.guardianproject.urzip_100_b4964fd.apk' repo/index-v1.json
533 ! grep -F 'info.guardianproject.urzip_100_b4964fd.apk' repo/index.xml
534
535
536 #------------------------------------------------------------------------------#
537 echo_header "test metadata checks"
538
539 REPOROOT=`create_test_dir`
540 cd $REPOROOT
541
542 mkdir repo
543 cp $WORKSPACE/tests/urzip.apk $REPOROOT/repo/
544
545 set +e
546 $fdroid build
547 if [ $? -eq 0 ]; then
548     echo "This should have failed because there is no metadata!"
549     exit 1
550 else
551     echo "testing metadata checks passed"
552 fi
553 set -e
554
555 mkdir $REPOROOT/metadata/
556 cp $WORKSPACE/tests/metadata/org.smssecure.smssecure.txt $REPOROOT/metadata/
557 $fdroid readmeta
558
559 # now make a fake duplicate
560 touch $REPOROOT/metadata/org.smssecure.smssecure.yml
561
562 set +e
563 $fdroid readmeta
564 if [ $? -eq 0 ]; then
565     echo "This should have failed because there is a duplicate metadata file!"
566     exit 1
567 else
568     echo "testing duplicate metadata checks passed"
569 fi
570 set -e
571
572
573 #------------------------------------------------------------------------------#
574 echo_header "ensure commands that don't need the JDK work without a JDK configed"
575
576 REPOROOT=`create_test_dir`
577 cd $REPOROOT
578 mkdir repo
579 mkdir metadata
580 echo "License:GPL-2.0" >> metadata/fake.txt
581 echo "Summary:Yup still fake" >> metadata/fake.txt
582 echo "Categories:Internet" >> metadata/fake.txt
583 echo "Description:" >> metadata/fake.txt
584 echo "this is fake" >> metadata/fake.txt
585 echo "." >> metadata/fake.txt
586
587 # fake that no JDKs are available
588 echo 'java_paths = {}' > config.py
589
590 LOCAL_COPY_DIR=`create_test_dir`/fdroid
591 mkdir -p $LOCAL_COPY_DIR/repo
592 echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
593
594 $fdroid checkupdates --allow-dirty
595 $fdroid gpgsign
596 $fdroid lint
597 $fdroid readmeta
598 $fdroid rewritemeta fake
599 $fdroid server update
600 $fdroid scanner
601
602 # run these to get their output, but the are not setup, so don't fail
603 $fdroid build || true
604 $fdroid import || true
605 $fdroid install || true
606
607
608 #------------------------------------------------------------------------------#
609 echo_header "create a source tarball"
610
611 cd $WORKSPACE
612 ./setup.py compile_catalog sdist
613
614 REPOROOT=`create_test_dir`
615 cd $REPOROOT
616 tar xzf `ls -1 $WORKSPACE/dist/fdroidserver-*.tar.gz | sort -n | tail -1`
617 cd $REPOROOT
618 ./fdroidserver-*/fdroid init
619 copy_apks_into_repo $REPOROOT
620 ./fdroidserver-*/fdroid update --create-metadata --verbose
621
622
623 #------------------------------------------------------------------------------#
624 echo_header "test config checks of local_copy_dir"
625
626 REPOROOT=`create_test_dir`
627 cd $REPOROOT
628 $fdroid init
629 $fdroid update --create-metadata --verbose
630 $fdroid readmeta
631 $fdroid server update --local-copy-dir=/tmp/fdroid
632
633 # now test the errors work
634 set +e
635 $fdroid server update --local-copy-dir=thisisnotanabsolutepath
636 if [ $? -eq 0 ]; then
637     echo "This should have failed because thisisnotanabsolutepath is not an absolute path!"
638     exit 1
639 else
640     echo "testing absolute path checker passed"
641 fi
642 $fdroid server update --local-copy-dir=/tmp/IReallyDoubtThisPathExistsasdfasdf
643 if [ $? -eq 0 ]; then
644     echo "This should have failed because the path does not end with 'fdroid'!"
645     exit 1
646 else
647     echo "testing dirname exists checker passed"
648 fi
649 $fdroid server update --local-copy-dir=/tmp/IReallyDoubtThisPathExistsasdfasdf/fdroid
650 if [ $? -eq 0 ]; then
651     echo "This should have failed because the dirname path does not exist!"
652     exit 1
653 else
654     echo "testing dirname exists checker passed"
655 fi
656 set -e
657
658
659 #------------------------------------------------------------------------------#
660 echo_header "setup a new repo from scratch using ANDROID_HOME and do a local sync"
661
662 REPOROOT=`create_test_dir`
663 cd $REPOROOT
664 fdroid_init_with_prebuilt_keystore
665 copy_apks_into_repo $REPOROOT
666 $fdroid update --create-metadata --verbose
667 $fdroid readmeta
668 grep -F '<application id=' repo/index.xml > /dev/null
669
670 LOCALCOPYDIR=`create_test_dir`/fdroid
671 $fdroid server update --local-copy-dir=$LOCALCOPYDIR
672 NEWREPOROOT=`create_test_dir`
673 cd $NEWREPOROOT
674 fdroid_init_with_prebuilt_keystore
675 echo "sync_from_local_copy_dir = True" >> config.py
676 $fdroid server update --local-copy-dir=$LOCALCOPYDIR
677
678
679 #------------------------------------------------------------------------------#
680 # check that --android-home fails when dir does not exist or is not a dir
681
682 REPOROOT=`create_test_dir`
683 KEYSTORE=$REPOROOT/keystore.jks
684 cd $REPOROOT
685 set +e
686 $fdroid init --keystore $KEYSTORE --android-home /opt/fakeandroidhome
687 if [ $? -eq 0 ]; then
688     echo "This should have failed because /opt/fakeandroidhome does not exist!"
689     exit 1
690 else
691     echo "testing android-home path checker passed"
692 fi
693 TESTFILE=`create_test_file`
694 $fdroid init --keystore $KEYSTORE --android-home $TESTFILE
695 if [ $? -eq 0 ]; then
696     echo "This should have failed because $TESTFILE is a file not a dir!"
697     exit 1
698 else
699     echo "testing android-home not-dir checker passed"
700 fi
701 set -e
702
703
704 #------------------------------------------------------------------------------#
705 echo_header "check that fake android home passes 'fdroid init'"
706
707 REPOROOT=`create_test_dir`
708 FAKE_ANDROID_HOME=`create_test_dir`
709 create_fake_android_home $FAKE_ANDROID_HOME
710 KEYSTORE=$REPOROOT/keystore.jks
711 cd $REPOROOT
712 $fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME
713
714
715 #------------------------------------------------------------------------------#
716 echo_header "check that 'fdroid init' fails when build-tools cannot be found"
717
718 if [ -e /usr/bin/aapt ]; then
719     echo "/usr/bin/aapt exists, not running test"
720 else
721     REPOROOT=`create_test_dir`
722     FAKE_ANDROID_HOME=`create_test_dir`
723     create_fake_android_home $FAKE_ANDROID_HOME
724     rm -f $FAKE_ANDROID_HOME/build-tools/*/aapt
725     KEYSTORE=$REPOROOT/keystore.jks
726     cd $REPOROOT
727     set +e
728     $fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME
729     [ $? -eq 0 ] && exit 1
730     set -e
731 fi
732
733
734 #------------------------------------------------------------------------------#
735 echo_header "check that --android-home overrides ANDROID_HOME"
736
737 REPOROOT=`create_test_dir`
738 FAKE_ANDROID_HOME=`create_test_dir`
739 create_fake_android_home $FAKE_ANDROID_HOME
740 KEYSTORE=$REPOROOT/keystore.jks
741 cd $REPOROOT
742 $fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME
743 set +e
744 grep $FAKE_ANDROID_HOME $REPOROOT/config.py
745 if [ $? -ne 0 ]; then
746     echo "the value set in --android-home '$FAKE_ANDROID_HOME' should override ANDROID_HOME '$ANDROID_HOME'"
747     exit 1
748 fi
749 set -e
750
751
752 #------------------------------------------------------------------------------#
753 # In this case, ANDROID_HOME is set to a fake, non-working version that will
754 # be detected by fdroid as an Android SDK install.  It should use the path set
755 # by --android-home over the one in ANDROID_HOME, therefore if it uses the one
756 # in ANDROID_HOME, it won't work because it is a fake one.  Only
757 # --android-home provides a working one.
758 echo_header "setup a new repo from scratch with keystore and android-home set on cmd line"
759
760 REPOROOT=`create_test_dir`
761 KEYSTORE=$REPOROOT/keystore.jks
762 FAKE_ANDROID_HOME=`create_test_dir`
763 create_fake_android_home $FAKE_ANDROID_HOME
764 STORED_ANDROID_HOME=$ANDROID_HOME
765 unset ANDROID_HOME
766 echo "ANDROID_HOME: $ANDROID_HOME"
767 cd $REPOROOT
768 $fdroid init --keystore $KEYSTORE --android-home $STORED_ANDROID_HOME --no-prompt
769 test -e $KEYSTORE
770 copy_apks_into_repo $REPOROOT
771 $fdroid update --create-metadata --verbose
772 $fdroid readmeta
773 grep -F '<application id=' repo/index.xml > /dev/null
774 test -e repo/index.xml
775 test -e repo/index.jar
776 test -e repo/index-v1.jar
777 test -e tmp/apkcache
778 ! test -z tmp/apkcache
779 export ANDROID_HOME=$STORED_ANDROID_HOME
780
781
782 #------------------------------------------------------------------------------#
783 echo_header "check duplicate files are properly handled by fdroid update"
784
785 REPOROOT=`create_test_dir`
786 cd $REPOROOT
787 fdroid_init_with_prebuilt_keystore
788 mkdir $REPOROOT/metadata
789 cp -a $WORKSPACE/tests/metadata/obb.mainpatch.current.txt $REPOROOT/metadata
790 echo "accepted_formats = ['txt']" >> config.py
791 cp $WORKSPACE/tests/repo/obb.mainpatch.current_1619.apk $REPOROOT/repo/
792 cp $WORKSPACE/tests/repo/obb.mainpatch.current_1619_another-release-key.apk $REPOROOT/repo/
793 $fdroid update --pretty
794 grep -F 'obb.mainpatch.current_1619.apk' repo/index.xml repo/index-v1.json
795 grep -F 'obb.mainpatch.current_1619_another-release-key.apk' repo/index-v1.json
796 ! grep -F 'obb.mainpatch.current_1619_another-release-key.apk' repo/index.xml
797 # die if there are exact duplicates
798 cp $WORKSPACE/tests/repo/obb.mainpatch.current_1619.apk $REPOROOT/repo/duplicate.apk
799 ! $fdroid update
800
801
802 #------------------------------------------------------------------------------#
803 echo_header "setup new repo from scratch using ANDROID_HOME, putting APKs in repo first"
804
805 REPOROOT=`create_test_dir`
806 cd $REPOROOT
807 mkdir repo
808 copy_apks_into_repo $REPOROOT
809 fdroid_init_with_prebuilt_keystore
810 $fdroid update --create-metadata --verbose
811 $fdroid readmeta
812 grep -F '<application id=' repo/index.xml > /dev/null
813
814
815 #------------------------------------------------------------------------------#
816 echo_header "setup a new repo from scratch and generate a keystore"
817
818 REPOROOT=`create_test_dir`
819 KEYSTORE=$REPOROOT/keystore.jks
820 cd $REPOROOT
821 $fdroid init --keystore $KEYSTORE
822 test -e $KEYSTORE
823 copy_apks_into_repo $REPOROOT
824 $fdroid update --create-metadata --verbose
825 $fdroid readmeta
826 test -e repo/index.xml
827 test -e repo/index.jar
828 test -e repo/index-v1.jar
829 test -e tmp/apkcache
830 ! test -z tmp/apkcache
831 grep -F '<application id=' repo/index.xml > /dev/null
832
833
834 #------------------------------------------------------------------------------#
835 echo_header "setup a new repo manually and generate a keystore"
836
837 REPOROOT=`create_test_dir`
838 KEYSTORE=$REPOROOT/keystore.jks
839 cd $REPOROOT
840 cp $WORKSPACE/examples/fdroid-icon.png $REPOROOT/
841 ! test -e $KEYSTORE
842 set +e
843 $fdroid update
844 if [ $? -eq 0 ]; then
845     echo "This should have failed because this repo has no keystore!"
846     exit 1
847 else
848     echo '`fdroid update` prompted to add keystore'
849 fi
850 set -e
851 $fdroid update --create-key
852 test -e $KEYSTORE
853 copy_apks_into_repo $REPOROOT
854 $fdroid update --create-metadata --verbose
855 $fdroid readmeta
856 test -e repo/index.xml
857 test -e repo/index.jar
858 test -e repo/index-v1.jar
859 test -e tmp/apkcache
860 ! test -z tmp/apkcache
861 grep -F '<application id=' repo/index.xml > /dev/null
862
863
864 #------------------------------------------------------------------------------#
865 echo_header "setup a new repo from scratch, generate a keystore, then add APK and update"
866
867 REPOROOT=`create_test_dir`
868 KEYSTORE=$REPOROOT/keystore.jks
869 cd $REPOROOT
870 $fdroid init --keystore $KEYSTORE
871 test -e $KEYSTORE
872 copy_apks_into_repo $REPOROOT
873 $fdroid update --create-metadata --verbose
874 $fdroid readmeta
875 test -e repo/index.xml
876 test -e repo/index.jar
877 test -e repo/index-v1.jar
878 grep -F '<application id=' repo/index.xml > /dev/null
879 test -e $REPOROOT/repo/info.guardianproject.urzip_100.apk || \
880     cp $WORKSPACE/tests/urzip.apk $REPOROOT/repo/
881 $fdroid update --create-metadata --verbose
882 $fdroid readmeta
883 test -e repo/index.xml
884 test -e repo/index.jar
885 test -e repo/index-v1.jar
886 test -e tmp/apkcache
887 ! test -z tmp/apkcache
888 grep -F '<application id=' repo/index.xml > /dev/null
889
890
891 #------------------------------------------------------------------------------#
892 echo_header "setup a new repo from scratch with a HSM/smartcard"
893 REPOROOT=`create_test_dir`
894 cd $REPOROOT
895 $fdroid init --keystore NONE
896 test -e opensc-fdroid.cfg
897 test ! -e NONE
898
899
900 #------------------------------------------------------------------------------#
901 echo_header "setup a new repo with no keystore, add APK, and update"
902
903 REPOROOT=`create_test_dir`
904 KEYSTORE=$REPOROOT/keystore.jks
905 cd $REPOROOT
906 touch fdroid-icon.png
907 mkdir repo
908 cp $WORKSPACE/tests/urzip.apk $REPOROOT/repo/
909 set +e
910 $fdroid update --create-metadata --verbose
911 if [ $? -eq 0 ]; then
912     echo "This should have failed because this repo has no keystore!"
913     exit 1
914 else
915     echo '`fdroid update` prompted to add keystore'
916 fi
917 set -e
918
919 # now set up fake, non-working keystore setup
920 touch $KEYSTORE
921 echo "keystore = \"$KEYSTORE\"" >> config.py
922 echo 'repo_keyalias = "foo"' >> config.py
923 echo 'keystorepass = "foo"' >> config.py
924 echo 'keypass = "foo"' >> config.py
925 set +e
926 $fdroid update --create-metadata --verbose
927 if [ $? -eq 0 ]; then
928     echo "This should have failed because this repo has a bad/fake keystore!"
929     exit 1
930 else
931     echo '`fdroid update` prompted to add keystore'
932 fi
933 set -e
934
935
936 #------------------------------------------------------------------------------#
937 echo_header "copy tests/repo, update with binary transparency log"
938
939 REPOROOT=`create_test_dir`
940 GIT_REMOTE=`create_test_dir`
941 GNUPGHOME=$REPOROOT/gnupghome
942 cd $REPOROOT
943 fdroid_init_with_prebuilt_keystore
944 cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $REPOROOT/
945 echo "binary_transparency_remote = '$GIT_REMOTE'" >> config.py
946 echo "accepted_formats = ['json', 'txt', 'yml']" >> config.py
947 $fdroid update --verbose
948 if have_git_2_3; then
949     $fdroid server update --verbose
950     test -e repo/index.xml
951     test -e repo/index.jar
952     test -e repo/index-v1.jar
953     grep -F '<application id=' repo/index.xml > /dev/null
954     cd binary_transparency
955     [ `git rev-list --count HEAD` == "2" ]
956     cd $GIT_REMOTE
957     [ `git rev-list --count HEAD` == "2" ]
958 else
959     echo "Skipping test, `git --version` older than 2.3"
960 fi
961
962
963 #------------------------------------------------------------------------------#
964 echo_header "setup a new repo with keystore with APK, update, then without key"
965
966 REPOROOT=`create_test_dir`
967 KEYSTORE=$REPOROOT/keystore.jks
968 cd $REPOROOT
969 cp $WORKSPACE/tests/keystore.jks $KEYSTORE
970 fdroid_init_with_prebuilt_keystore $KEYSTORE
971 test -e $KEYSTORE
972 cp $WORKSPACE/tests/urzip.apk $REPOROOT/repo/
973 $fdroid update --create-metadata --verbose
974 $fdroid readmeta
975 test -e repo/index.xml
976 test -e repo/index.jar
977 test -e repo/index-v1.jar
978 test -e tmp/apkcache
979 ! test -z tmp/apkcache
980 grep -F '<application id=' repo/index.xml > /dev/null
981
982 # now set fake repo_keyalias
983 $sed -i.tmp 's,^ *repo_keyalias.*,repo_keyalias = "fake",' $REPOROOT/config.py
984 set +e
985 $fdroid update
986 if [ $? -eq 0 ]; then
987     echo "This should have failed because this repo has a bad repo_keyalias!"
988     exit 1
989 else
990     echo '`fdroid update` prompted to add keystore'
991 fi
992 set -e
993
994 # try creating a new keystore, but fail because the old one is there
995 test -e $KEYSTORE
996 set +e
997 $fdroid update --create-key
998 if [ $? -eq 0 ]; then
999     echo "This should have failed because a keystore is already there!"
1000     exit 1
1001 else
1002     echo '`fdroid update` complained about existing keystore'
1003 fi
1004 set -e
1005
1006 # now actually create the key with the existing settings
1007 rm -f $KEYSTORE
1008 ! test -e $KEYSTORE
1009 $fdroid update --create-key
1010 test -e $KEYSTORE
1011
1012
1013 #------------------------------------------------------------------------------#
1014 echo_header "sign binary repo in offline box, then publishing from online box"
1015
1016 OFFLINE_ROOT=`create_test_dir`
1017 KEYSTORE=$WORKSPACE/tests/keystore.jks
1018 LOCAL_COPY_DIR=`create_test_dir`/fdroid
1019 mkdir $LOCAL_COPY_DIR
1020 ONLINE_ROOT=`create_test_dir`
1021 SERVERWEBROOT=`create_test_dir`
1022
1023 # create offline binary transparency log
1024 cd $OFFLINE_ROOT
1025 mkdir binary_transparency
1026 cd binary_transparency
1027 git init
1028
1029 # fake git remote server for binary transparency log
1030 BINARY_TRANSPARENCY_REMOTE=`create_test_dir`
1031
1032 # fake git remote server for repo mirror
1033 SERVER_GIT_MIRROR=`create_test_dir`
1034 cd $SERVER_GIT_MIRROR
1035 git init
1036 if have_git_2_3; then
1037     git config receive.denyCurrentBranch updateInstead
1038 fi
1039
1040 cd $OFFLINE_ROOT
1041 fdroid_init_with_prebuilt_keystore
1042 cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $OFFLINE_ROOT/
1043
1044 echo "mirrors = ['http://foo.bar/fdroid', 'http://asdflkdsfjafdsdfhkjh.onion/fdroid']" >> config.py
1045 echo "servergitmirrors = '$SERVER_GIT_MIRROR'" >> config.py
1046 echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
1047 echo "accepted_formats = ['json', 'txt', 'yml']" >> config.py
1048 $fdroid update --pretty
1049 grep -F '<application id=' repo/index.xml > /dev/null
1050 grep -F '/fdroid/repo</mirror>' repo/index.xml
1051 grep -F '/fdroid/archive</mirror>' archive/index.xml
1052 test `grep '<mirror>' repo/index.xml | wc -l` -eq 2
1053 test `grep '<mirror>' archive/index.xml | wc -l` -eq 2
1054 cd binary_transparency
1055 [ `git rev-list --count HEAD` == "1" ]
1056 cd ..
1057 $fdroid server update --verbose
1058 grep -F '<application id=' $LOCAL_COPY_DIR/repo/index.xml > /dev/null
1059 cd $ONLINE_ROOT
1060 echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
1061 echo "sync_from_local_copy_dir = True" >> config.py
1062 echo "serverwebroots = '$SERVERWEBROOT'" >> config.py
1063 echo "servergitmirrors = '$SERVER_GIT_MIRROR'" >> config.py
1064 echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
1065 echo "binary_transparency_remote = '$BINARY_TRANSPARENCY_REMOTE'" >> config.py
1066 $fdroid server update --verbose
1067 cd $BINARY_TRANSPARENCY_REMOTE
1068 [ `git rev-list --count HEAD` == "1" ]
1069 cd $SERVER_GIT_MIRROR
1070 [ `git rev-list --count HEAD` == "1" ]
1071
1072
1073 #------------------------------------------------------------------------------#
1074
1075 # remove this to prevent git conflicts and complaining
1076 rm -rf $WORKSPACE/fdroidserver.egg-info/
1077
1078 echo SUCCESS