diff --git a/tests/Makefile.am.inc b/tests/Makefile.am.inc index e2b2fa9ac..a379e2953 100644 --- a/tests/Makefile.am.inc +++ b/tests/Makefile.am.inc @@ -97,6 +97,8 @@ dist_test_scripts = \ tests/test-basic.sh \ tests/test-run.sh \ tests/test-run-system.sh \ + tests/test-run-deltas.sh \ + tests/test-run-system-deltas.sh \ tests/test-bundle.sh \ tests/test-bundle-system.sh \ tests/test-builder.sh \ diff --git a/tests/libtest.sh b/tests/libtest.sh index b314ef1cc..b723fc016 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -90,6 +90,10 @@ else export U="--user" fi +if [ x${USE_DELTAS-} == xyes ] ; then + export UPDATE_REPO_ARGS="--generate-static-deltas" +fi + export FLATPAK="${CMD_PREFIX} flatpak" assert_streq () { @@ -169,17 +173,24 @@ export FL_GPGARGS="--gpg-homedir=${FL_GPG_HOMEDIR} --gpg-sign=${FL_GPG_ID}" setup_repo () { GPGARGS="$FL_GPGARGS" . $(dirname $0)/make-test-runtime.sh org.test.Platform bash ls cat echo readlink > /dev/null GPGARGS="$FL_GPGARGS" . $(dirname $0)/make-test-app.sh > /dev/null + update_repo ostree trivial-httpd --autoexit --daemonize -p httpd-port . port=$(cat httpd-port) flatpak remote-add ${U} --gpg-import=${FL_GPG_HOMEDIR}/pubring.gpg test-repo "http://127.0.0.1:${port}/repo" } +update_repo () { + ${FLATPAK} build-update-repo $FL_GPGARGS ${UPDATE_REPO_ARGS-} repo +} + make_updated_app () { GPGARGS="$FL_GPGARGS" . $(dirname $0)/make-test-app.sh UPDATED > /dev/null + update_repo } setup_sdk_repo () { GPGARGS="$FL_GPGARGS" . $(dirname $0)/make-test-runtime.sh org.test.Sdk bash ls cat echo readlink make mkdir cp touch > /dev/null + update_repo } install_repo () { diff --git a/tests/test-run-deltas.sh b/tests/test-run-deltas.sh new file mode 100755 index 000000000..f178231f9 --- /dev/null +++ b/tests/test-run-deltas.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# +# Copyright (C) 2011 Colin Walters +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +export USE_DELTAS=yes + +. $(dirname $0)/test-run.sh diff --git a/tests/test-run-system-deltas.sh b/tests/test-run-system-deltas.sh new file mode 100755 index 000000000..507eee448 --- /dev/null +++ b/tests/test-run-system-deltas.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# Copyright (C) 2011 Colin Walters +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +export USE_SYSTEMDIR=yes +export USE_DELTAS=yes + +. $(dirname $0)/test-run.sh diff --git a/tests/test-run.sh b/tests/test-run.sh index 8d1d6b7f9..2cedccfa1 100755 --- a/tests/test-run.sh +++ b/tests/test-run.sh @@ -219,6 +219,7 @@ echo "nope" > ${DIR}/files/nope ${FLATPAK} build-finish --command=hello.sh ${DIR} ${FLATPAK} build-export ${FL_GPGARGS} repo ${DIR} +update_repo ${FLATPAK} ${U} install test-repo org.test.Split --subpath=/a --subpath=/b --subpath=/nosuchdir master @@ -244,6 +245,7 @@ echo "f" > ${DIR}/files/f/data rm -rf ${DIR}/files/b ${FLATPAK} build-export ${FL_GPGARGS} repo ${DIR} +update_repo ${FLATPAK} ${U} update --subpath=/a --subpath=/b --subpath=/e --subpath=/nosuchdir org.test.Split @@ -263,6 +265,7 @@ assert_not_has_file $FL_DIR/app/org.test.Split/$ARCH/master/active/files/f assert_not_has_file $FL_DIR/app/org.test.Split/$ARCH/master/active/files/nope ${FLATPAK} build-export ${FL_GPGARGS} repo ${DIR} +update_repo # Test reusing the old subpath list ${FLATPAK} ${U} update org.test.Split