From 12fd8332da6a15f5a67bddc542949301f804c145 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 21 Oct 2020 14:05:25 +0200 Subject: [PATCH] tests: Test stuff with the old (non-indexed) summary format too --- tests/Makefile-test-matrix.am.inc | 6 +++++- tests/Makefile.am.inc | 4 ++-- tests/libtest.sh | 11 ++++++++++- tests/test-repo.sh | 4 ++-- tests/test-wrapper.sh | 6 ++++++ 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/tests/Makefile-test-matrix.am.inc b/tests/Makefile-test-matrix.am.inc index b65d970e..66806b27 100644 --- a/tests/Makefile-test-matrix.am.inc +++ b/tests/Makefile-test-matrix.am.inc @@ -11,6 +11,8 @@ TEST_MATRIX= \ tests/test-repo@user.wrap \ tests/test-repo@system.wrap \ tests/test-repo@system-norevokefs.wrap \ + tests/test-repo@user,oldsummary.wrap \ + tests/test-repo@system,oldsummary.wrap \ tests/test-sideload@user.wrap \ tests/test-sideload@system.wrap \ tests/test-bundle@user.wrap \ @@ -18,6 +20,8 @@ TEST_MATRIX= \ tests/test-bundle@system-norevokefs.wrap \ tests/test-oci-registry@user.wrap \ tests/test-oci-registry@system.wrap \ + tests/test-update-remote-configuration@newsummary.wrap \ + tests/test-update-remote-configuration@oldsummary.wrap \ tests/test-update-portal@user.wrap \ tests/test-update-portal@system.wrap \ $(NULL) @@ -30,7 +34,6 @@ TEST_MATRIX_DIST= \ tests/test-default-remotes.sh \ tests/test-extensions.sh \ tests/test-oci.sh \ - tests/test-update-remote-configuration.sh \ tests/test-override.sh \ tests/test-auth.sh \ tests/test-unused.sh \ @@ -42,5 +45,6 @@ TEST_MATRIX_EXTRA_DIST= \ tests/test-sideload.sh \ tests/test-bundle.sh \ tests/test-oci-registry.sh \ + tests/test-update-remote-configuration.sh \ tests/test-update-portal.sh \ $(NULL) diff --git a/tests/Makefile.am.inc b/tests/Makefile.am.inc index adafaae1..4b18499b 100644 --- a/tests/Makefile.am.inc +++ b/tests/Makefile.am.inc @@ -192,14 +192,14 @@ TEST_MATRIX_SOURCE = \ tests/test-http-utils.sh \ tests/test-run.sh{{user+system+system-norevokefs},{nodeltas+deltas}} \ tests/test-info.sh{user+system} \ - tests/test-repo.sh{user+system+system-norevokefs} \ + tests/test-repo.sh{{user+system+system-norevokefs}+{{user+system},oldsummary}} \ tests/test-sideload.sh{user+system} \ tests/test-default-remotes.sh \ tests/test-extensions.sh \ tests/test-bundle.sh{user+system+system-norevokefs} \ tests/test-oci.sh \ tests/test-oci-registry.sh{user+system} \ - tests/test-update-remote-configuration.sh \ + tests/test-update-remote-configuration.sh{newsummary+oldsummary} \ tests/test-override.sh \ tests/test-update-portal.sh{user+system} \ tests/test-auth.sh \ diff --git a/tests/libtest.sh b/tests/libtest.sh index 3680cf82..886cd68b 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -109,6 +109,10 @@ export USERDIR=${TEST_DATA_DIR}/home/share/flatpak export SYSTEMDIR=${TEST_DATA_DIR}/system export ARCH=`flatpak --default-arch` +if [ x${SUMMARY_FORMAT-} == xold ] ; then + export BUILD_UPDATE_REPO_FLAGS="--no-summary-index" +fi + if [ x${USE_SYSTEMDIR-} == xyes ] ; then export FL_DIR=${SYSTEMDIR} export U= @@ -394,7 +398,12 @@ update_repo () { collection_args= fi - ${FLATPAK} build-update-repo ${collection_args} ${GPGARGS:-${FL_GPGARGS}} ${UPDATE_REPO_ARGS-} repos/${REPONAME} + ${FLATPAK} build-update-repo ${BUILD_UPDATE_REPO_FLAGS-} ${collection_args} ${GPGARGS:-${FL_GPGARGS}} ${UPDATE_REPO_ARGS-} repos/${REPONAME} + if [ x${SUMMARY_FORMAT-} == xold ] ; then + assert_not_has_file repos/${REPONAME}/summary.idx + else + assert_has_file repos/${REPONAME}/summary.idx + fi } make_updated_app () { diff --git a/tests/test-repo.sh b/tests/test-repo.sh index 5c64d7e9..222fc302 100644 --- a/tests/test-repo.sh +++ b/tests/test-repo.sh @@ -77,7 +77,7 @@ fi # Remove new appstream branch so we can test deploying the old one rm -rf repos/test/refs/heads/appstream2 -${FLATPAK} build-update-repo --no-update-appstream ${FL_GPGARGS} repos/test +${FLATPAK} build-update-repo ${BUILD_UPDATE_REPO_FLAGS-} --no-update-appstream ${FL_GPGARGS} repos/test flatpak ${U} --appstream update test-repo @@ -720,7 +720,7 @@ fi ok "remote-ls" # Test that remote-ls can take a file:// URI -${FLATPAK} build-update-repo --no-update-appstream repos/test +${FLATPAK} build-update-repo ${BUILD_UPDATE_REPO_FLAGS-} --no-update-appstream repos/test ${FLATPAK} remote-ls file://`pwd`/repos/test > repo-list assert_file_has_content repo-list "org\.test\.Hello" diff --git a/tests/test-wrapper.sh b/tests/test-wrapper.sh index e2cc6286..be624256 100755 --- a/tests/test-wrapper.sh +++ b/tests/test-wrapper.sh @@ -15,6 +15,12 @@ for feature in $(echo $1 | sed "s/^.*@\(.*\).wrap/\1/" | tr "," "\n"); do deltas) export USE_DELTAS=yes ;; + newsummary) + export SUMMARY_FORMAT=new + ;; + oldsummary) + export SUMMARY_FORMAT=old + ;; nodeltas) export USE_DELTAS=no ;;