From 0e36042fdfbb0621907d006b014436594e7bb129 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 17 Oct 2018 09:28:10 +0200 Subject: [PATCH] tests: Add a test for multi-updates and required version I had a report of (and old version of) flatpak stopping an entire "flatpak update" because one app had a new required version. This adds a test of this (and it seems fixed now). --- tests/test-run.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/test-run.sh b/tests/test-run.sh index 9d83d82e..780f96b8 100755 --- a/tests/test-run.sh +++ b/tests/test-run.sh @@ -336,6 +336,29 @@ ${FLATPAK} build-export ${FL_GPGARGS} repos/test ${DIR} ${FLATPAK} ${U} update -y org.test.OldVersion +# Make sure a multi-ref update succeeds even if some update requires a newer version +# Note that updates are in alphabetical order, so CurrentVersion will be pulled first +# and should not block a successful install of OldVersion later + +DIR=`mktemp -d` +${FLATPAK} build-init ${DIR} org.test.CurrentVersion org.test.Platform org.test.Platform +touch ${DIR}/files/updated +${FLATPAK} build-finish --require-version=99.0.0 --command=hello.sh ${DIR} +${FLATPAK} build-export ${FL_GPGARGS} repos/test ${DIR} +DIR=`mktemp -d` +${FLATPAK} build-init ${DIR} org.test.OldVersion org.test.Platform org.test.Platform +touch ${DIR}/files/updated +${FLATPAK} build-finish --require-version=${VERSION} --command=hello.sh ${DIR} +${FLATPAK} build-export ${FL_GPGARGS} repos/test ${DIR} + +if ${FLATPAK} ${U} update -y &> err_version.txt; then + assert_not_reached "Should not have been able to update due to version" +fi +assert_file_has_content err_version.txt "needs a later flatpak version" + +assert_not_has_file $FL_DIR/app/org.test.CurrentVersion/$ARCH/master/active/files/updated +assert_has_file $FL_DIR/app/org.test.OldVersion/$ARCH/master/active/files/updated + echo "ok version checks" rm -rf app