3 set -e # quit script on error
6 { echo -e "==============================================================================\n$1"; } 2>/dev/null
9 copy_apks_into_repo() {
11 for f in `find $APKDIR -name '*.apk' | grep -F -v -e unaligned -e unsigned -e badsig -e badcert`; do
12 name=$(basename $(dirname `dirname $f`))
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
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() {
28 mkdir $1/platform-tools
30 mkdir $1/build-tools/19.0.2
31 touch $1/build-tools/19.0.2/aapt
35 test -e $WORKSPACE/.testfiles || mkdir $WORKSPACE/.testfiles
36 mktemp -d $WORKSPACE/.testfiles/run-tests.XXXX
40 test -e $WORKSPACE/.testfiles || mkdir $WORKSPACE/.testfiles
41 TMPDIR=$WORKSPACE/.testfiles mktemp
44 # the < is reverse since 0 means success in exit codes
46 python3 -c "import sys; from distutils.version import LooseVersion as V; sys.exit(V(sys.argv[3]) < V('2.3'))" `git --version`
49 #------------------------------------------------------------------------------#
52 if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
54 echo "Usage: $0 '/path/to/folder/with/apks'"
58 if [ -z "$ANDROID_HOME" ]; then
59 echo "ANDROID_HOME must be set with the path to the Android SDK, i.e.: "
60 echo " export ANDROID_HOME=/opt/android-sdk"
74 if [ -z $WORKSPACE ]; then
75 WORKSPACE=`dirname $(pwd)`
76 echo "Setting Workspace to $WORKSPACE"
79 # allow the location of the script to be overridden
80 if [ -z $fdroid ]; then
81 fdroid="$WORKSPACE/fdroid"
84 # allow the location of aapt to be overridden
86 aapt=`ls -1 $ANDROID_HOME/build-tools/*/aapt | sort | tail -1`
89 # allow the location of python to be overridden
90 if [ -z $python ]; then
94 set -x # show each command as it is executed
96 #------------------------------------------------------------------------------#
97 echo_header "run commit hooks"
103 #------------------------------------------------------------------------------#
104 echo_header "test python getsig replacement"
106 cd $WORKSPACE/tests/getsig
110 for testcase in $WORKSPACE/tests/*.TestCase; do
115 #------------------------------------------------------------------------------#
116 echo_header "print fdroid version"
121 #------------------------------------------------------------------------------#
122 echo_header 'run process when building and signing are on separate machines'
124 REPOROOT=`create_test_dir`
126 cp $WORKSPACE/tests/keystore.jks $REPOROOT/
127 $fdroid init --keystore keystore.jks --repo-keyalias=sova
128 echo 'keystorepass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
129 echo 'keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
130 echo "accepted_formats = ['txt', 'yml']" >> config.py
131 echo 'keydname = "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"' >> config.py
132 test -d archive || mkdir archive
133 test -d metadata || mkdir metadata
134 cp $WORKSPACE/tests/metadata/info.guardianproject.urzip.yml metadata/
135 test -d repo || mkdir repo
136 test -d unsigned || mkdir unsigned
137 cp $WORKSPACE/tests/urzip-release-unsigned.apk unsigned/info.guardianproject.urzip_100.apk
138 $fdroid publish --verbose
139 $fdroid update --verbose --nosign
140 $fdroid signindex --verbose
141 test -e repo/index.xml
142 test -e repo/index.jar
143 test -e repo/index-v1.jar
145 grep -F '<application id=' repo/index.xml > /dev/null
148 #------------------------------------------------------------------------------#
149 echo_header "test UTF-8 metadata"
151 REPOROOT=`create_test_dir`
155 sed -i.tmp 's,^ *repo_description.*,repo_description = """获取已安装在您的设备上的应用的,' config.py
156 echo "mirrors = ('https://foo.bar/fdroid', 'http://secret.onion/fdroid')" >> config.py
158 cp $WORKSPACE/tests/urzip.apk repo/
159 cp $WORKSPACE/tests/metadata/info.guardianproject.urzip.yml metadata/
165 #------------------------------------------------------------------------------#
166 echo_header 'run `fdroid build` in fresh git checkout from import.TestCase'
168 cd $WORKSPACE/tests/tmp/importer
171 # stick with known working commit, in case future commits break things for this code
172 git reset --hard cecf00c08aec56ae7a5eba444150c4d1ae868814
173 if [ -d $ANDROID_HOME/platforms/android-23 ]; then
174 echo "build_tools = '`ls -1 $ANDROID_HOME/build-tools/ | sort -n | tail -1`'" > config.py
175 echo "force_build_tools = True" >> config.py
176 $fdroid build --verbose org.fdroid.ci.test.app:300
178 echo 'WARNING: Skipping `fdroid build` test since android-23 is missing!'
181 #------------------------------------------------------------------------------#
182 echo_header 'copy git import and run `fdroid scanner` on it'
184 REPOROOT=`create_test_dir`
187 cp $WORKSPACE/examples/fdroid-icon.png $REPOROOT/
189 echo "Auto Name:Just A Test" > metadata/org.fdroid.ci.test.app.txt
190 echo "Web Site:" >> metadata/org.fdroid.ci.test.app.txt
191 echo "Build:0.3,300" >> metadata/org.fdroid.ci.test.app.txt
192 echo " commit=0.3" >> metadata/org.fdroid.ci.test.app.txt
193 echo " subdir=app" >> metadata/org.fdroid.ci.test.app.txt
194 echo " gradle=yes" >> metadata/org.fdroid.ci.test.app.txt
195 echo "" >> metadata/org.fdroid.ci.test.app.txt
196 echo "Repo:https://gitlab.com/fdroid/ci-test-app.git" >> metadata/org.fdroid.ci.test.app.txt
197 echo "Repo Type:git" >> metadata/org.fdroid.ci.test.app.txt
199 cp -a $WORKSPACE/tests/tmp/importer build/org.fdroid.ci.test.app
200 ls -l build/org.fdroid.ci.test.app
201 $fdroid scanner org.fdroid.ci.test.app --verbose
204 #------------------------------------------------------------------------------#
205 echo_header "copy tests/repo, generate java/gpg keys, update, and gpgsign"
207 REPOROOT=`create_test_dir`
208 GNUPGHOME=$REPOROOT/gnupghome
209 KEYSTORE=$WORKSPACE/tests/keystore.jks
211 $fdroid init --keystore $KEYSTORE --repo-keyalias=sova
212 echo 'keystorepass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
213 echo 'keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
214 cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $REPOROOT/
215 cp -a $WORKSPACE/tests/gnupghome $GNUPGHOME
216 chmod 0700 $GNUPGHOME
217 echo "accepted_formats = ['json', 'txt', 'yml']" >> config.py
218 echo "install_list = 'org.adaway'" >> config.py
219 echo "uninstall_list = ('com.android.vending', 'com.facebook.orca',)" >> config.py
220 echo "gpghome = '$GNUPGHOME'" >> config.py
221 echo "gpgkey = 'CE71F7FB'" >> config.py
222 echo "mirrors = ('http://foobarfoobarfoobar.onion/fdroid','https://foo.bar/fdroid',)" >> config.py
223 $fdroid update --verbose --pretty
224 test -e repo/index.xml
225 test -e repo/index.jar
226 test -e repo/index-v1.jar
227 grep -F '<application id=' repo/index.xml > /dev/null
228 grep -F '<install packageName=' repo/index.xml > /dev/null
229 grep -F '<uninstall packageName=' repo/index.xml > /dev/null
230 $fdroid gpgsign --verbose
231 $fdroid gpgsign --verbose
232 test -e repo/obb.mainpatch.current_1619.apk.asc
233 test -e repo/obb.main.twoversions_1101617_src.tar.gz.asc
234 ! test -e repo/obb.mainpatch.current_1619.apk.asc.asc
235 ! test -e repo/obb.main.twoversions_1101617_src.tar.gz.asc.asc
236 ! test -e repo/index.xml.asc
238 # we can't easily reproduce the timestamps for things, so just hardcode them
239 sed -i --expression='s,timestamp="[0-9]*",timestamp="1480431575",' repo/index.xml
240 diff $WORKSPACE/tests/repo/index.xml repo/index.xml
242 #------------------------------------------------------------------------------#
243 echo_header "test metadata checks"
245 REPOROOT=`create_test_dir`
250 cp $WORKSPACE/tests/urzip.apk $REPOROOT/repo/
254 if [ $? -eq 0 ]; then
255 echo "This should have failed because there is no metadata!"
258 echo "testing metadata checks passed"
262 mkdir $REPOROOT/metadata/
263 cp $WORKSPACE/tests/metadata/org.smssecure.smssecure.txt $REPOROOT/metadata/
266 # now make a fake duplicate
267 touch $REPOROOT/metadata/org.smssecure.smssecure.yml
271 if [ $? -eq 0 ]; then
272 echo "This should have failed because there is a duplicate metadata file!"
275 echo "testing duplicate metadata checks passed"
280 #------------------------------------------------------------------------------#
281 echo_header "ensure commands that don't need the JDK work without a JDK configed"
283 REPOROOT=`create_test_dir`
287 echo "License:GPL-2.0" >> metadata/fake.txt
288 echo "Summary:Yup still fake" >> metadata/fake.txt
289 echo "Categories:Internet" >> metadata/fake.txt
290 echo "Description:" >> metadata/fake.txt
291 echo "this is fake" >> metadata/fake.txt
292 echo "." >> metadata/fake.txt
294 # fake that no JDKs are available
295 echo 'java_paths = {}' > config.py
297 LOCAL_COPY_DIR=`create_test_dir`/fdroid
298 mkdir -p $LOCAL_COPY_DIR/repo
299 echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
305 $fdroid rewritemeta fake
306 $fdroid server update
309 # run these to get their output, but the are not setup, so don't fail
310 $fdroid build || true
311 $fdroid import || true
312 $fdroid install || true
315 #------------------------------------------------------------------------------#
316 echo_header "create a source tarball and use that to build a repo"
319 $python setup.py sdist
321 REPOROOT=`create_test_dir`
323 tar xzf `ls -1 $WORKSPACE/dist/fdroidserver-*.tar.gz | sort -n | tail -1`
325 ./fdroidserver-*/fdroid init
326 copy_apks_into_repo $REPOROOT
327 ./fdroidserver-*/fdroid update --create-metadata --verbose
330 #------------------------------------------------------------------------------#
331 echo_header "test config checks of local_copy_dir"
333 REPOROOT=`create_test_dir`
336 $fdroid update --create-metadata --verbose
338 $fdroid server update --local-copy-dir=/tmp/fdroid
340 # now test the errors work
342 $fdroid server update --local-copy-dir=thisisnotanabsolutepath
343 if [ $? -eq 0 ]; then
344 echo "This should have failed because thisisnotanabsolutepath is not an absolute path!"
347 echo "testing absolute path checker passed"
349 $fdroid server update --local-copy-dir=/tmp/IReallyDoubtThisPathExistsasdfasdf
350 if [ $? -eq 0 ]; then
351 echo "This should have failed because the path does not end with 'fdroid'!"
354 echo "testing dirname exists checker passed"
356 $fdroid server update --local-copy-dir=/tmp/IReallyDoubtThisPathExistsasdfasdf/fdroid
357 if [ $? -eq 0 ]; then
358 echo "This should have failed because the dirname path does not exist!"
361 echo "testing dirname exists checker passed"
366 #------------------------------------------------------------------------------#
367 echo_header "setup a new repo from scratch using ANDROID_HOME and do a local sync"
369 REPOROOT=`create_test_dir`
372 copy_apks_into_repo $REPOROOT
373 $fdroid update --create-metadata --verbose
375 grep -F '<application id=' repo/index.xml > /dev/null
377 LOCALCOPYDIR=`create_test_dir`/fdroid
378 $fdroid server update --local-copy-dir=$LOCALCOPYDIR
379 NEWREPOROOT=`create_test_dir`
382 echo "sync_from_local_copy_dir = True" >> config.py
383 $fdroid server update --local-copy-dir=$LOCALCOPYDIR
386 #------------------------------------------------------------------------------#
387 # check that --android-home fails when dir does not exist or is not a dir
389 REPOROOT=`create_test_dir`
390 KEYSTORE=$REPOROOT/keystore.jks
393 $fdroid init --keystore $KEYSTORE --android-home /opt/fakeandroidhome
394 if [ $? -eq 0 ]; then
395 echo "This should have failed because /opt/fakeandroidhome does not exist!"
398 echo "testing android-home path checker passed"
400 TESTFILE=`create_test_file`
401 $fdroid init --keystore $KEYSTORE --android-home $TESTFILE
402 if [ $? -eq 0 ]; then
403 echo "This should have failed because $TESTFILE is a file not a dir!"
406 echo "testing android-home not-dir checker passed"
411 #------------------------------------------------------------------------------#
412 echo_header "check that fake android home passes 'fdroid init'"
414 REPOROOT=`create_test_dir`
415 FAKE_ANDROID_HOME=`create_test_dir`
416 create_fake_android_home $FAKE_ANDROID_HOME
417 KEYSTORE=$REPOROOT/keystore.jks
419 $fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME
422 #------------------------------------------------------------------------------#
423 echo_header "check that 'fdroid init' fails when build-tools cannot be found"
425 if [ -e /usr/bin/aapt ]; then
426 echo "/usr/bin/aapt exists, not running test"
428 REPOROOT=`create_test_dir`
429 FAKE_ANDROID_HOME=`create_test_dir`
430 create_fake_android_home $FAKE_ANDROID_HOME
431 rm -f $FAKE_ANDROID_HOME/build-tools/*/aapt
432 KEYSTORE=$REPOROOT/keystore.jks
435 $fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME
436 [ $? -eq 0 ] && exit 1
441 #------------------------------------------------------------------------------#
442 echo_header "check that --android-home overrides ANDROID_HOME"
444 REPOROOT=`create_test_dir`
445 FAKE_ANDROID_HOME=`create_test_dir`
446 create_fake_android_home $FAKE_ANDROID_HOME
447 KEYSTORE=$REPOROOT/keystore.jks
449 $fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME
451 grep $FAKE_ANDROID_HOME $REPOROOT/config.py
452 if [ $? -ne 0 ]; then
453 echo "the value set in --android-home '$FAKE_ANDROID_HOME' should override ANDROID_HOME '$ANDROID_HOME'"
459 #------------------------------------------------------------------------------#
460 # In this case, ANDROID_HOME is set to a fake, non-working version that will
461 # be detected by fdroid as an Android SDK install. It should use the path set
462 # by --android-home over the one in ANDROID_HOME, therefore if it uses the one
463 # in ANDROID_HOME, it won't work because it is a fake one. Only
464 # --android-home provides a working one.
465 echo_header "setup a new repo from scratch with keystore and android-home set on cmd line"
467 REPOROOT=`create_test_dir`
468 KEYSTORE=$REPOROOT/keystore.jks
469 FAKE_ANDROID_HOME=`create_test_dir`
470 create_fake_android_home $FAKE_ANDROID_HOME
471 STORED_ANDROID_HOME=$ANDROID_HOME
473 echo "ANDROID_HOME: $ANDROID_HOME"
475 $fdroid init --keystore $KEYSTORE --android-home $STORED_ANDROID_HOME --no-prompt
477 copy_apks_into_repo $REPOROOT
478 $fdroid update --create-metadata --verbose
480 grep -F '<application id=' repo/index.xml > /dev/null
481 test -e repo/index.xml
482 test -e repo/index.jar
483 test -e repo/index-v1.jar
484 export ANDROID_HOME=$STORED_ANDROID_HOME
487 #------------------------------------------------------------------------------#
488 echo_header "setup new repo from scratch using ANDROID_HOME, putting APKs in repo first"
490 REPOROOT=`create_test_dir`
493 copy_apks_into_repo $REPOROOT
495 $fdroid update --create-metadata --verbose
497 grep -F '<application id=' repo/index.xml > /dev/null
500 #------------------------------------------------------------------------------#
501 echo_header "setup a new repo from scratch and generate a keystore"
503 REPOROOT=`create_test_dir`
504 KEYSTORE=$REPOROOT/keystore.jks
506 $fdroid init --keystore $KEYSTORE
508 copy_apks_into_repo $REPOROOT
509 $fdroid update --create-metadata --verbose
511 test -e repo/index.xml
512 test -e repo/index.jar
513 test -e repo/index-v1.jar
514 grep -F '<application id=' repo/index.xml > /dev/null
517 #------------------------------------------------------------------------------#
518 echo_header "setup a new repo manually and generate a keystore"
520 REPOROOT=`create_test_dir`
521 KEYSTORE=$REPOROOT/keystore.jks
524 cp $WORKSPACE/examples/fdroid-icon.png $REPOROOT/
528 if [ $? -eq 0 ]; then
529 echo "This should have failed because this repo has no keystore!"
532 echo '`fdroid update` prompted to add keystore'
535 $fdroid update --create-key
537 copy_apks_into_repo $REPOROOT
538 $fdroid update --create-metadata --verbose
540 test -e repo/index.xml
541 test -e repo/index.jar
542 test -e repo/index-v1.jar
543 grep -F '<application id=' repo/index.xml > /dev/null
546 #------------------------------------------------------------------------------#
547 echo_header "setup a new repo from scratch, generate a keystore, then add APK and update"
549 REPOROOT=`create_test_dir`
550 KEYSTORE=$REPOROOT/keystore.jks
552 $fdroid init --keystore $KEYSTORE
554 copy_apks_into_repo $REPOROOT
555 $fdroid update --create-metadata --verbose
557 test -e repo/index.xml
558 test -e repo/index.jar
559 test -e repo/index-v1.jar
560 grep -F '<application id=' repo/index.xml > /dev/null
561 test -e $REPOROOT/repo/info.guardianproject.urzip_100.apk || \
562 cp $WORKSPACE/tests/urzip.apk $REPOROOT/repo/
563 $fdroid update --create-metadata --verbose
565 test -e repo/index.xml
566 test -e repo/index.jar
567 test -e repo/index-v1.jar
568 grep -F '<application id=' repo/index.xml > /dev/null
571 #------------------------------------------------------------------------------#
572 echo_header "setup a new repo from scratch with a HSM/smartcard"
573 REPOROOT=`create_test_dir`
575 $fdroid init --keystore NONE
576 test -e opensc-fdroid.cfg
580 #------------------------------------------------------------------------------#
581 echo_header "setup a new repo with no keystore, add APK, and update"
583 REPOROOT=`create_test_dir`
584 KEYSTORE=$REPOROOT/keystore.jks
587 touch fdroid-icon.png
589 cp $WORKSPACE/tests/urzip.apk $REPOROOT/repo/
591 $fdroid update --create-metadata --verbose
592 if [ $? -eq 0 ]; then
593 echo "This should have failed because this repo has no keystore!"
596 echo '`fdroid update` prompted to add keystore'
600 # now set up fake, non-working keystore setup
602 echo "keystore = \"$KEYSTORE\"" >> config.py
603 echo 'repo_keyalias = "foo"' >> config.py
604 echo 'keystorepass = "foo"' >> config.py
605 echo 'keypass = "foo"' >> config.py
607 $fdroid update --create-metadata --verbose
608 if [ $? -eq 0 ]; then
609 echo "This should have failed because this repo has a bad/fake keystore!"
612 echo '`fdroid update` prompted to add keystore'
617 #------------------------------------------------------------------------------#
618 echo_header "copy tests/repo, update with binary transparency log"
620 REPOROOT=`create_test_dir`
621 GIT_REMOTE=`create_test_dir`
622 GNUPGHOME=$REPOROOT/gnupghome
623 KEYSTORE=$WORKSPACE/tests/keystore.jks
625 $fdroid init --keystore $KEYSTORE --repo-keyalias=sova
626 cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $REPOROOT/
627 echo 'keystorepass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
628 echo 'keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
629 echo "binary_transparency_remote = '$GIT_REMOTE'" >> config.py
630 echo "accepted_formats = ['json', 'txt', 'yml']" >> config.py
631 $fdroid update --verbose
632 if have_git_2_3; then
633 $fdroid server update --verbose
634 test -e repo/index.xml
635 test -e repo/index.jar
636 test -e repo/index-v1.jar
637 grep -F '<application id=' repo/index.xml > /dev/null
638 cd binary_transparency
639 [ `git rev-list --count HEAD` == "2" ]
641 [ `git rev-list --count HEAD` == "2" ]
643 echo "Skipping test, `git --version` older than 2.3"
647 #------------------------------------------------------------------------------#
648 echo_header "setup a new repo with keystore with APK, update, then without key"
650 REPOROOT=`create_test_dir`
651 KEYSTORE=$REPOROOT/keystore.jks
653 $fdroid init --keystore $KEYSTORE
655 cp $WORKSPACE/tests/urzip.apk $REPOROOT/repo/
656 $fdroid update --create-metadata --verbose
658 test -e repo/index.xml
659 test -e repo/index.jar
660 test -e repo/index-v1.jar
661 grep -F '<application id=' repo/index.xml > /dev/null
663 # now set fake repo_keyalias
664 sed -i.tmp 's,^ *repo_keyalias.*,repo_keyalias = "fake",' $REPOROOT/config.py
667 if [ $? -eq 0 ]; then
668 echo "This should have failed because this repo has a bad repo_keyalias!"
671 echo '`fdroid update` prompted to add keystore'
675 # try creating a new keystore, but fail because the old one is there
678 $fdroid update --create-key
679 if [ $? -eq 0 ]; then
680 echo "This should have failed because a keystore is already there!"
683 echo '`fdroid update` complained about existing keystore'
687 # now actually create the key with the existing settings
690 $fdroid update --create-key
694 #------------------------------------------------------------------------------#
695 echo_header "sign binary repo in offline box, then publishing from online box"
697 OFFLINE_ROOT=`create_test_dir`
698 KEYSTORE=$WORKSPACE/tests/keystore.jks
699 LOCAL_COPY_DIR=`create_test_dir`/fdroid
700 mkdir $LOCAL_COPY_DIR
701 ONLINE_ROOT=`create_test_dir`
702 SERVERWEBROOT=`create_test_dir`
704 # create offline binary transparency log
706 mkdir binary_transparency
707 cd binary_transparency
710 # fake git remote server for binary transparency log
711 BINARY_TRANSPARENCY_REMOTE=`create_test_dir`
713 # fake git remote server for repo mirror
714 SERVER_GIT_MIRROR=`create_test_dir`
715 cd $SERVER_GIT_MIRROR
717 if have_git_2_3; then
718 git config receive.denyCurrentBranch updateInstead
722 $fdroid init --keystore $KEYSTORE --repo-keyalias=sova
723 cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $OFFLINE_ROOT/
725 echo 'keystorepass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
726 echo 'keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py
727 echo "servergitmirrors = '$SERVER_GIT_MIRROR'" >> config.py
728 echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
729 echo "accepted_formats = ['json', 'txt', 'yml']" >> config.py
730 $fdroid update --verbose
731 grep -F '<application id=' repo/index.xml > /dev/null
732 cd binary_transparency
733 [ `git rev-list --count HEAD` == "1" ]
735 if have_git_2_3; then
736 $fdroid server update --verbose
737 grep -F '<application id=' $LOCAL_COPY_DIR/repo/index.xml > /dev/null
739 echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
740 echo "sync_from_local_copy_dir = True" >> config.py
741 echo "serverwebroots = '$SERVERWEBROOT'" >> config.py
742 echo "servergitmirrors = '$SERVER_GIT_MIRROR'" >> config.py
743 echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
744 echo "binary_transparency_remote = '$BINARY_TRANSPARENCY_REMOTE'" >> config.py
745 $fdroid server update --verbose
746 cd $BINARY_TRANSPARENCY_REMOTE
747 [ `git rev-list --count HEAD` == "1" ]
748 cd $SERVER_GIT_MIRROR
749 [ `git rev-list --count HEAD` == "1" ]
751 echo "Skipping test, `git --version` older than 2.3"
755 #------------------------------------------------------------------------------#
757 # remove this to prevent git conflicts and complaining
758 rm -rf $WORKSPACE/fdroidserver.egg-info/