summaryrefslogtreecommitdiff
path: root/tests/test-repo.sh
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2020-11-17 12:48:49 +0100
committerAlexander Larsson <alexander.larsson@gmail.com>2020-11-17 15:20:43 +0100
commitc4c57312ba06a943d0947d01f8d56ee96608e038 (patch)
tree107134157772cb85590f3cee7898dd57fadcbea4 /tests/test-repo.sh
parent7043093a5f08f32d1d244d4a70984bb8d6b8b128 (diff)
downloadflatpak-c4c57312ba06a943d0947d01f8d56ee96608e038.tar.gz
tests: Un-redirect url after trying redirect
After the --redirect-url= test is finished it leaves the remote with a different url, which is confusing the other tests. In particular, at some point we remove the remote and add it back, which gets us back to the old url, but at that point the summary (from the newer url) has a later mtime than the old one so the old one keeps getting used. So, we unset the redirect and set back the old url. Also, the following test had to be tweaked for this change.
Diffstat (limited to 'tests/test-repo.sh')
-rw-r--r--tests/test-repo.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test-repo.sh b/tests/test-repo.sh
index 3ad308d5..24e9f955 100644
--- a/tests/test-repo.sh
+++ b/tests/test-repo.sh
@@ -511,12 +511,21 @@ update_repo test-gpg3 org.test.Collection.test
${FLATPAK} ${U} install -y test-repo org.test.Hello
assert_file_has_content $FL_DIR/app/org.test.Hello/$ARCH/master/active/files/bin/hello.sh UPDATED
+# Switch back to the old url to unconfuse other tests
+UPDATE_REPO_ARGS="--redirect-url=" update_repo
+${FLATPAK} ${U} remote-modify --url="http://127.0.0.1:${port}/test" test-repo
+
+# Also remove app so we can install the older one from the previous repo
+${FLATPAK} ${U} uninstall -y org.test.Hello
+
ok "redirect url and gpg key"
+${FLATPAK} ${U} install -y -v test-repo org.test.Hello
+
# Test https://github.com/flatpak/flatpak/issues/3222
mkdir -p $FL_DIR/repo/refs/mirrors/org.test.Collection.test/app/org.test.Hello/$ARCH/
cp $FL_DIR/repo/refs/remotes/test-repo/app/org.test.Hello/$ARCH/master $FL_DIR/repo/refs/mirrors/org.test.Collection.test/app/org.test.Hello/$ARCH/
-make_updated_app test-gpg3 org.test.Collection.test master UPDATE2
+make_updated_app test org.test.Collection.test master UPDATE2
${FLATPAK} ${U} update -y org.test.Hello
assert_not_has_file $FL_DIR/repo/refs/mirrors/org.test.Collection.test/app/org.test.Hello/$ARCH/master
assert_has_file $FL_DIR/repo/refs/remotes/test-repo/app/org.test.Hello/$ARCH/master