summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2020-03-16 15:19:58 +0100
committerAlexander Larsson <alexl@redhat.com>2020-03-23 17:58:04 +0100
commit9061b855d86fe44519c7728a146321abba6ad836 (patch)
tree06b8116f01fce23b422dde142392f7557ef796c2
parent116a8b848788c582fb2c8577f1250438b100da25 (diff)
downloadflatpak-9061b855d86fe44519c7728a146321abba6ad836.tar.gz
Initial remove of p2p codepaths
This removes the most basic codepaths for p2p installation, as well as the tests for it. There still remains various codepaths that looks as the collection id, these will be removed later. This is the first step in dropping the p2p code and replacing it with a simpler approach that focuses on the sideloading case only.
-rw-r--r--common/flatpak-dir-private.h20
-rw-r--r--common/flatpak-dir.c828
-rw-r--r--common/flatpak-transaction.c176
-rw-r--r--tests/Makefile-test-matrix.am.inc6
-rw-r--r--tests/Makefile.am.inc4
-rwxr-xr-xtests/test-wrapper.sh12
6 files changed, 19 insertions, 1027 deletions
diff --git a/common/flatpak-dir-private.h b/common/flatpak-dir-private.h
index 4a22b387..0a493dc4 100644
--- a/common/flatpak-dir-private.h
+++ b/common/flatpak-dir-private.h
@@ -962,11 +962,6 @@ typedef struct
char *ref;
char *opt_commit;
- /* Used during p2p resolve */
- OstreeCollectionRef collection_ref; /* owns the collection_id member only, ref_name is from above */
- char *local_commit;
- char *latest_remote_commit;
-
/* out */
char *resolved_commit;
GBytes *resolved_metadata;
@@ -986,21 +981,6 @@ void flatpak_dir_resolve_free (FlatpakDirResolve *resolve);
gboolean flatpak_dir_resolve_maybe_resolve_from_metadata (FlatpakDirResolve *resolve,
FlatpakRemoteState *state);
-typedef struct _FlatpakDirP2PState FlatpakDirP2PState;
-void flatpak_dir_p2p_state_free (FlatpakDirP2PState *state);
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakDirP2PState, flatpak_dir_p2p_state_free)
-
-FlatpakDirP2PState *flatpak_dir_prepare_resolve_p2p_refs (FlatpakDir *self,
- FlatpakDirResolve **resolves,
- GCancellable *cancellable,
- GError **error);
-gboolean flatpak_dir_finish_resolve_p2p_refs (FlatpakDir *self,
- FlatpakDirResolve **resolves,
- const char *token,
- FlatpakDirP2PState *state,
- GCancellable *cancellable,
- GError **error);
-
char ** flatpak_dir_get_default_locales (FlatpakDir *self);
char ** flatpak_dir_get_default_locale_languages (FlatpakDir *self);
char ** flatpak_dir_get_locales (FlatpakDir *self);
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index 52138e79..2f387285 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -130,11 +130,6 @@ static gboolean flatpak_dir_cleanup_remote_for_url_change (FlatpakDir *self,
GCancellable *cancellable,
GError **error);
-static gboolean _flatpak_dir_fetch_remote_state_metadata_branch (FlatpakDir *self,
- FlatpakRemoteState *state,
- gboolean only_cached,
- GCancellable *cancellable,
- GError **error);
static gboolean flatpak_dir_lookup_remote_filter (FlatpakDir *self,
const char *name,
gboolean force_load,
@@ -3676,75 +3671,15 @@ flatpak_dir_find_latest_rev (FlatpakDir *self,
g_return_val_if_fail (out_rev != NULL, FALSE);
- if (state->collection_id != NULL)
- {
- /* Find the latest rev from the remote and its available mirrors, including
- * LAN and USB sources. */
- g_auto(GVariantBuilder) find_builder = FLATPAK_VARIANT_BUILDER_INITIALIZER;
- g_autoptr(GVariant) find_options = NULL;
- g_autoptr(GAsyncResult) find_result = NULL;
- g_auto(OstreeRepoFinderResultv) results = NULL;
- OstreeCollectionRef collection_ref = { state->collection_id, (char *) ref };
- OstreeCollectionRef *collection_refs_to_fetch[2] = { &collection_ref, NULL };
- gsize i;
- g_autoptr(GMainContextPopDefault) context = NULL;
-
- /* Find options */
- g_variant_builder_init (&find_builder, G_VARIANT_TYPE ("a{sv}"));
-
- if (checksum_or_latest != NULL)
- {
- g_variant_builder_add (&find_builder, "{s@v}", "override-commit-ids",
- g_variant_new_variant (g_variant_new_strv (&checksum_or_latest, 1)));
- }
-
- find_options = g_variant_ref_sink (g_variant_builder_end (&find_builder));
-
- context = flatpak_main_context_new_default ();
-
- ostree_repo_find_remotes_async (self->repo, (const OstreeCollectionRef * const *) collection_refs_to_fetch,
- find_options,
- NULL /* default finders */,
- NULL /* no progress reporting */,
- cancellable, async_result_cb, &find_result);
-
- while (find_result == NULL)
- g_main_context_iteration (context, TRUE);
-
- results = ostree_repo_find_remotes_finish (self->repo, find_result, error);
-
- if (results == NULL)
- return FALSE;
-
- for (i = 0; results[i] != NULL && latest_rev == NULL; i++)
- latest_rev = g_strdup (g_hash_table_lookup (results[i]->ref_to_checksum, &collection_ref));
-
- if (latest_rev == NULL)
- {
- return flatpak_fail_error (error, FLATPAK_ERROR_REF_NOT_FOUND,
- _("No such ref (%s, %s) in remote %s or elsewhere"),
- collection_ref.collection_id, collection_ref.ref_name,
- state->remote_name);
- }
-
- if (out_results != NULL)
- *out_results = g_steal_pointer (&results);
-
- if (out_rev != NULL)
- *out_rev = g_steal_pointer (&latest_rev);
- }
- else
- {
- if (!flatpak_remote_state_lookup_ref (state, ref, &latest_rev, NULL, NULL, error))
- return FALSE;
- if (latest_rev == NULL)
- return flatpak_fail_error (error, FLATPAK_ERROR_REF_NOT_FOUND,
- _("Couldn't find latest checksum for ref %s in remote %s"),
- ref, state->remote_name);
+ if (!flatpak_remote_state_lookup_ref (state, ref, &latest_rev, NULL, NULL, error))
+ return FALSE;
+ if (latest_rev == NULL)
+ return flatpak_fail_error (error, FLATPAK_ERROR_REF_NOT_FOUND,
+ _("Couldn't find latest checksum for ref %s in remote %s"),
+ ref, state->remote_name);
- if (out_rev != NULL)
- *out_rev = g_steal_pointer (&latest_rev);
- }
+ if (out_rev != NULL)
+ *out_rev = g_steal_pointer (&latest_rev);
return TRUE;
}
@@ -3774,471 +3709,11 @@ flatpak_dir_resolve_free (FlatpakDirResolve *resolve)
g_bytes_unref (resolve->resolved_metadata);
g_free (resolve->eol);
g_free (resolve->eol_rebase);
- g_free (resolve->collection_ref.collection_id);
- g_free (resolve->local_commit);
- g_free (resolve->latest_remote_commit);
g_free (resolve);
}
}
-static const char *
-find_latest_p2p_result (OstreeRepoFinderResult **results, OstreeCollectionRef *cr)
-{
- const char *latest_rev = NULL;
- int i;
-
- for (i = 0; results[i] != NULL && latest_rev == NULL; i++)
- latest_rev = g_hash_table_lookup (results[i]->ref_to_checksum, cr);
-
- return latest_rev;
-}
-
-static void
-remove_ref_from_p2p_results (OstreeRepoFinderResult **results, OstreeCollectionRef *cr)
-{
- int i;
-
- for (i = 0; results[i] != NULL; i++)
- g_hash_table_remove (results[i]->ref_to_checksum, cr);
-}
-
-gboolean
-flatpak_dir_resolve_maybe_resolve_from_metadata (FlatpakDirResolve *resolve,
- FlatpakRemoteState *state)
-{
- guint64 download_size = 0;
- guint64 installed_size = 0;
- const char *xa_metadata = NULL;
- const guchar *metadata_checksum_bytes = NULL;
- g_autofree char *metadata_checksum = NULL;
- VarMetadataRef sparse_cache;
-
- if (!flatpak_remote_state_lookup_cache (state, resolve->ref, &download_size, &installed_size, &xa_metadata, &metadata_checksum_bytes, NULL))
- return FALSE;
-
- if (metadata_checksum_bytes == NULL)
- return FALSE; /* Commit unknown, old server version */
-
- metadata_checksum = ostree_checksum_from_bytes (metadata_checksum_bytes);
-
- /* If the latest available commit is the same as the one we have info on in the ostree-metadata
- then we can use the ostree-metadata to resolve the op without having to download the commit */
- if (g_strcmp0 (metadata_checksum, resolve->latest_remote_commit) != 0)
- return FALSE;
-
- resolve->resolved_commit = g_strdup (metadata_checksum);
- resolve->resolved_metadata = g_bytes_new (xa_metadata, strlen (xa_metadata) + 1);
- resolve->installed_size = installed_size;
- resolve->download_size = download_size;
-
- if (flatpak_remote_state_lookup_sparse_cache (state, resolve->ref, &sparse_cache, NULL))
- {
- resolve->eol = g_strdup (var_metadata_lookup_string (sparse_cache, FLATPAK_SPARSE_CACHE_KEY_ENDOFLINE, NULL));
- resolve->eol_rebase = g_strdup (var_metadata_lookup_string (sparse_cache, FLATPAK_SPARSE_CACHE_KEY_ENDOFLINE_REBASE, NULL));
- resolve->token_type = GINT32_FROM_LE(var_metadata_lookup_int32 (sparse_cache, FLATPAK_SPARSE_CACHE_KEY_TOKEN_TYPE, 0));
- }
-
- return TRUE; /* Resolved */
-}
-
-static void
-resolve_p2p_update_from_commit (FlatpakDirResolve *resolve,
- GVariant *commit_data)
-{
- g_autoptr(GVariant) commit_metadata = NULL;
- const char *xa_metadata = NULL;
- guint64 download_size = 0;
- guint64 installed_size = 0;
-
- commit_metadata = g_variant_get_child_value (commit_data, 0);
-
- g_variant_lookup (commit_metadata, "xa.metadata", "&s", &xa_metadata);
- if (xa_metadata == NULL)
- g_message ("Warning: No xa.metadata in commit %s ref %s", resolve->resolved_commit, resolve->ref);
- else
- resolve->resolved_metadata = g_bytes_new (xa_metadata, strlen (xa_metadata) + 1);
-
- if (g_variant_lookup (commit_metadata, "xa.download-size", "t", &download_size))
- resolve->download_size = GUINT64_FROM_BE (download_size);
-
- if (g_variant_lookup (commit_metadata, "xa.installed-size", "t", &installed_size))
- resolve->installed_size = GUINT64_FROM_BE (installed_size);
-
- g_variant_lookup (commit_metadata, OSTREE_COMMIT_META_KEY_ENDOFLIFE, "s", &resolve->eol);
- g_variant_lookup (commit_metadata, OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE, "s", &resolve->eol_rebase);
- /* NOTE: The transaction code already default or stored token_type from ostree-metadata here, but fix it up from the commit anyway */
- if (g_variant_lookup (commit_metadata, "xa.token-type", "i", &resolve->token_type))
- resolve->token_type = GINT32_FROM_LE (resolve->token_type);
-}
-
-struct _FlatpakDirP2PState {
- OstreeRepo *child_repo;
- GLnxLockFile child_repo_lock;
- GPtrArray *results;
- GPtrArray *results_refs; /* contains the original ref_to_checksum hashes from the items in results */
-};
-
-void
-flatpak_dir_p2p_state_free (FlatpakDirP2PState *state)
-{
- if (state->child_repo)
- {
- flatpak_rm_rf (ostree_repo_get_path (state->child_repo), NULL, NULL);
- g_object_unref (state->child_repo);
- glnx_release_lock_file (&state->child_repo_lock);
- }
-
- if (state->results)
- g_ptr_array_unref (state->results);
-
- if (state->results_refs)
- g_ptr_array_unref (state->results_refs);
-
- g_free (state);
-}
-
-static void
-finder_result_maybe_free (OstreeRepoFinderResult *result)
-{
- if (result)
- ostree_repo_finder_result_free (result);
-}
-
-static FlatpakDirP2PState *
-flatpak_dir_create_p2p_state (FlatpakDir *self,
- GCancellable *cancellable,
- GError **error)
-{
- g_autoptr(FlatpakDirP2PState) state = g_new0 (FlatpakDirP2PState, 1);
- g_autoptr(GFile) user_cache_dir = NULL;
-
- /* We create a temporary child repo in the user homedir so that we can just blow it away when we're done.
- * This lets us always write to the directory in the system-helper case, but also lets us properly clean up
- * the transaction state directory, as that doesn't happen on abort. */
- user_cache_dir = flatpak_ensure_user_cache_dir_location (error);
- if (user_cache_dir == NULL)
- return NULL;
-
- state->child_repo = flatpak_dir_create_child_repo (self, user_cache_dir, &state->child_repo_lock, NULL, error);
- if (state->child_repo == NULL)
- return NULL;
-
- state->results = g_ptr_array_new_with_free_func ((GDestroyNotify) finder_result_maybe_free);
- state->results_refs = g_ptr_array_new_with_free_func ((GDestroyNotify) g_hash_table_unref);
-
- return g_steal_pointer (&state);
-}
-
-static gboolean
-flatpak_dir_prepare_resolve_p2p_refs_helper (FlatpakDir *self,
- GPtrArray *resolves,
- gboolean with_commit_ids,
- FlatpakDirP2PState *state,
- GCancellable *cancellable,
- GError **error)
-{
- g_autoptr(GPtrArray) collection_refs_to_fetch = g_ptr_array_new ();
- g_autoptr(GPtrArray) commit_ids_to_fetch = NULL;
- g_autoptr(GAsyncResult) find_result = NULL;
- g_auto(OstreeRepoFinderResultv) results = NULL;
- g_autoptr(GVariant) find_options = NULL;
- g_auto(GVariantBuilder) find_builder = FLATPAK_VARIANT_BUILDER_INITIALIZER;
- g_autoptr(GMainContextPopDefault) main_context = NULL;
- g_autoptr(GString) refs_str = NULL;
- int i;
-
- if (with_commit_ids)
- commit_ids_to_fetch = g_ptr_array_new ();
-
- refs_str = g_string_new ("");
- for (i = 0; i < resolves->len; i++)
- {
- FlatpakDirResolve *resolve = resolves->pdata[i];
-
- if (i != 0)
- g_string_append (refs_str, ", ");
- g_string_append_printf (refs_str, "(%s, %s)",
- resolve->collection_ref.collection_id,
- resolve->collection_ref.ref_name);
-
- g_ptr_array_add (collection_refs_to_fetch, &resolve->collection_ref);
- if (commit_ids_to_fetch)
- {
- g_assert (resolve->opt_commit != NULL);
- g_ptr_array_add (commit_ids_to_fetch, resolve->opt_commit);
- }
- }
-
- g_ptr_array_add (collection_refs_to_fetch, NULL);
-
- g_debug ("Resolving these collection-refs: [%s]", refs_str->str);
-
- g_variant_builder_init (&find_builder, G_VARIANT_TYPE ("a{sv}"));
- if (commit_ids_to_fetch)
- g_variant_builder_add (&find_builder, "{s@v}", "override-commit-ids",
- g_variant_new_variant (g_variant_new_strv ((const char * const *) commit_ids_to_fetch->pdata,
- commit_ids_to_fetch->len)));
- find_options = g_variant_ref_sink (g_variant_builder_end (&find_builder));
-
- main_context = flatpak_main_context_new_default ();
-
- ostree_repo_find_remotes_async (state->child_repo,
- (const OstreeCollectionRef * const *) collection_refs_to_fetch->pdata,
- find_options,
- NULL /* default finders */,
- NULL /* no progress reporting */,
- cancellable, async_result_cb, &find_result);
-
- while (find_result == NULL)
- g_main_context_iteration (main_context, TRUE);
-
- results = ostree_repo_find_remotes_finish (state->child_repo, find_result, error);
- if (results == NULL)
- return FALSE;
-
- if (results[0] == NULL)
- return flatpak_fail_error (error, FLATPAK_ERROR_REF_NOT_FOUND,
- _("No remotes found which provide these refs: [%s]"),
- refs_str->str);
-
- /* Drop from the results all ops that are no-op updates */
- for (i = 0; i < resolves->len; i++)
- {
- FlatpakDirResolve *resolve = resolves->pdata[i];
- const char *latest_rev = NULL;
-
- latest_rev = find_latest_p2p_result (results, &resolve->collection_ref);
- resolve->latest_remote_commit = g_strdup (latest_rev);
-
- if (resolve->local_commit == NULL)
- continue;
-
- if (g_strcmp0 (latest_rev, resolve->local_commit) == 0)
- {
- g_autoptr(GVariant) commit_data = NULL;
-
- /* We already have the latest commit, so resolve it from
- * the local commit and remove from all results. This way we
- * avoid pulling this ref from all remotes. */
-
- if (!ostree_repo_load_commit (state->child_repo, resolve->local_commit, &commit_data, NULL, NULL))
- return FALSE;
-
- resolve->resolved_commit = g_strdup (resolve->local_commit);
- resolve_p2p_update_from_commit (resolve, commit_data);
- remove_ref_from_p2p_results (results, &resolve->collection_ref);
- }
- }
-
- /* Copy any (now) non-empty FinderResults into the state */
- for (i = 0; results[i] != NULL; i++)
- {
- OstreeRepoFinderResult *result = results[i];
-
- if (g_hash_table_size (result->ref_to_checksum) > 0)
- g_ptr_array_add (state->results, result);
- else
- ostree_repo_finder_result_free (result);
- }
-
- g_free (g_steal_pointer (&results)); /* content was freed or stolen above */
-
- return TRUE;
-}
-
-/* Unfortunately the p2p resolve case has to be split into two phases. The first (prepare)
- * phase only works on public data such as the summary and ostree-metadata branch, whereas the second
- * phace (_finish) actually needs to look at the commit objects, and before that is possible we have
- * to externally any require bearer tokens for this to be possible.
- */
-FlatpakDirP2PState *
-flatpak_dir_prepare_resolve_p2p_refs (FlatpakDir *self,
- FlatpakDirResolve **resolves,
- GCancellable *cancellable,
- GError **error)
-{
- g_autoptr(GPtrArray) latest_resolves = g_ptr_array_new ();
- g_autoptr(GPtrArray) specific_resolves = g_ptr_array_new ();
- g_autoptr(FlatpakDirP2PState) state = NULL;
- int i;
-
- for (i = 0; resolves[i] != NULL; i++)
- {
- FlatpakDirResolve *resolve = resolves[i];
-
- g_assert (resolve->ref != NULL);
- g_assert (resolve->remote != NULL);
-
- resolve->collection_ref.ref_name = resolve->ref;
- resolve->collection_ref.collection_id = flatpak_dir_get_remote_collection_id (self, resolve->remote);
-
- g_assert (resolve->collection_ref.collection_id != NULL);
-
- if (resolve->opt_commit == NULL)
- {
- flatpak_repo_resolve_rev (self->repo, resolve->collection_ref.collection_id, resolve->remote,
- resolve->ref, TRUE, &resolve->local_commit, cancellable, NULL);
- }
-
- /* The ostree p2p api doesn't let you mix pulls with specific commit IDs
- * and HEAD (https://github.com/ostreedev/ostree/issues/1622) so we need
- * to split these into two pull ops */
- if (resolve->opt_commit)
- g_ptr_array_add (specific_resolves, resolve);
- else
- g_ptr_array_add (latest_resolves, resolve);
- }
-
- state = flatpak_dir_create_p2p_state (self, cancellable, error);
- if (state == NULL)
- return NULL;
-
- if (specific_resolves->len > 0)
- {
- if (!flatpak_dir_prepare_resolve_p2p_refs_helper (self, specific_resolves, TRUE, state, cancellable, error))
- return NULL;
- }
-
- if (latest_resolves->len > 0)
- {
- if (!flatpak_dir_prepare_resolve_p2p_refs_helper (self, latest_resolves, FALSE, state, cancellable, error))
- return NULL;
- }
-
- for (i = 0; i < state->results->len; i++)
- {
- OstreeRepoFinderResult *result = state->results->pdata[i];
-
- /* Squirrel away the original ref_to_checksum hash so that we can reuse it multiple times
- each with a different subset */
- g_ptr_array_add (state->results_refs, g_steal_pointer (&result->ref_to_checksum));
- result->ref_to_checksum = g_hash_table_new_full (ostree_collection_ref_hash,
- ostree_collection_ref_equal,
- NULL, g_free);
- }
-
- g_ptr_array_add (state->results, NULL); /* NULL terminate */
-
- return g_steal_pointer (&state);
-}
-
-gboolean
-flatpak_dir_finish_resolve_p2p_refs (FlatpakDir *self,
- FlatpakDirResolve **resolves, // This can be a subset of the prepare_resolve list
- const char *token,
- FlatpakDirP2PState *state,
- GCancellable *cancellable,
- GError **error)
-{
- OstreeRepoPullFlags flags = OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY;
- GVariantBuilder pull_builder, ref_keyring_map_builder;
- g_autoptr(GVariant) pull_options = NULL;
- g_autoptr(GAsyncResult) pull_result = NULL;
- g_autoptr(FlatpakRepoTransaction) transaction = NULL;
- g_autoptr(GMainContextPopDefault) main_context = NULL;
- int i;
-
- if (state->results->pdata[0] == NULL)
- return TRUE;
-
- /* Do a version check to ensure we have these:
- * https://github.com/ostreedev/ostree/pull/1821
- * https://github.com/ostreedev/ostree/pull/1825 */
-#if OSTREE_CHECK_VERSION (2019, 2)
- flags |= OSTREE_REPO_PULL_FLAGS_MIRROR;
-#endif
-
- g_variant_builder_init (&pull_builder, G_VARIANT_TYPE ("a{sv}"));
- g_variant_builder_add (&pull_builder, "{s@v}", "flags",
- g_variant_new_variant (g_variant_new_int32 (flags)));
- g_variant_builder_add (&pull_builder, "{s@v}", "inherit-transaction",
- g_variant_new_variant (g_variant_new_boolean (TRUE)));
- g_variant_builder_add (&pull_builder, "{s@v}", "append-user-agent",
- g_variant_new_variant (g_variant_new_string ("flatpak/" PACKAGE_VERSION)));
-
- if (token)
- {
- GVariantBuilder hdr_builder;
- g_variant_builder_init (&hdr_builder, G_VARIANT_TYPE ("a(ss)"));
- g_autofree char *bearer_token = g_strdup_printf ("Bearer %s", token);
- g_variant_builder_add (&hdr_builder, "(ss)", "Authorization", bearer_token);
- g_variant_builder_add (&pull_builder, "{s@v}", "http-headers",
- g_variant_new_variant (g_variant_builder_end (&hdr_builder)));
- }
-
- /* Ensure the results are signed with the GPG keys associated with the correct remote */
- g_variant_builder_init (&ref_keyring_map_builder, G_VARIANT_TYPE ("a(sss)"));
- for (i = 0; resolves[i] != NULL; i++)
- {
- FlatpakDirResolve *resolve = resolves[i];
-
- g_variant_builder_add (&ref_keyring_map_builder, "(sss)",
- resolve->collection_ref.collection_id,
- resolve->collection_ref.ref_name,
- resolve->remote);
- }
- g_variant_builder_add (&pull_builder, "{s@v}", "ref-keyring-map",
- g_variant_new_variant (g_variant_builder_end (&ref_keyring_map_builder)));
-
- pull_options = g_variant_ref_sink (g_variant_builder_end (&pull_builder));
-
- main_context = flatpak_main_context_new_default ();
-
- transaction = flatpak_repo_transaction_start (state->child_repo, cancellable, error);
- if (transaction == NULL)
- return FALSE;
-
- /* Update the ref_to_checksum array to only contain the original mappings that intersect
- the set of refs we're pulling now. */
- for (i = 0; state->results->pdata[i] != NULL; i++)
- {
- GHashTable *orig_ref_to_checksum = state->results_refs->pdata[i];
- OstreeRepoFinderResult *result = state->results->pdata[i];
-
- g_hash_table_remove_all (result->ref_to_checksum);
- for (int j = 0; resolves[j] != NULL; j++)
- {
- FlatpakDirResolve *resolve = resolves[j];
- const char *checksum = g_hash_table_lookup (orig_ref_to_checksum, &resolve->collection_ref);
- if (checksum)
- g_hash_table_insert (result->ref_to_checksum, &resolve->collection_ref, g_strdup (checksum));
- }
- }
-
- ostree_repo_pull_from_remotes_async (state->child_repo, (const OstreeRepoFinderResult * const *) state->results->pdata,
- pull_options, NULL,
- cancellable, async_result_cb,
- &pull_result);
-
- while (pull_result == NULL)
- g_main_context_iteration (main_context, TRUE);
-
- if (!ostree_repo_pull_from_remotes_finish (state->child_repo, pull_result, error))
- return FALSE;
-
- for (i = 0; resolves[i] != NULL; i++)
- {
- FlatpakDirResolve *resolve = resolves[i];
- g_autoptr(GVariant) commit_data = NULL;
-
- if (resolve->resolved_commit != NULL)
- continue;
-
- if (!flatpak_repo_resolve_rev (state->child_repo, resolve->collection_ref.collection_id, resolve->remote,
- resolve->ref, FALSE, &resolve->resolved_commit,
- cancellable, error))
- return FALSE;
-
- if (!ostree_repo_load_commit (state->child_repo, resolve->resolved_commit, &commit_data, NULL, error))
- return FALSE;
-
- resolve_p2p_update_from_commit (resolve, commit_data);
- }
-
- return TRUE;
-}
-
static gboolean
child_repo_ensure_summary (OstreeRepo *child_repo,
FlatpakRemoteState *state,
@@ -5547,81 +5022,12 @@ flatpak_dir_pull (FlatpakDir *self,
}
else
{
- if (state->collection_id)
- {
- GVariantBuilder find_builder;
- g_autoptr(GVariant) find_options = NULL;
- g_autoptr(GAsyncResult) find_result = NULL;
- OstreeCollectionRef collection_ref;
- OstreeCollectionRef *collection_refs_to_fetch[2];
- gboolean force_disable_deltas = (flatpak_flags & FLATPAK_PULL_FLAGS_NO_STATIC_DELTAS) != 0;
- guint update_interval = 0;
- gsize i;
- g_autoptr(GMainContextPopDefault) context = NULL;
- g_autoptr(FlatpakAsyncProgressChained) chained_progress = NULL;
-
- /* FIXME: It would be nice to break out a helper function from
- * flatpak_dir_do_resolve_p2p_refs() that would resolve refs to
- * commits and reuse it here */
+ flatpak_remote_state_lookup_ref (state, ref, &rev, NULL, NULL, error);
+ if (rev == NULL && error != NULL && *error == NULL)
+ flatpak_fail_error (error, FLATPAK_ERROR_REF_NOT_FOUND, _("Couldn't find latest checksum for ref %s in remote %s"),
+ ref, state->remote_name);
- g_variant_builder_init (&find_builder, G_VARIANT_TYPE ("a{sv}"));
-
- if (force_disable_deltas)
- {
- g_variant_builder_add (&find_builder, "{s@v}", "disable-static-deltas",
- g_variant_new_variant (g_variant_new_boolean (TRUE)));
- }
-
- collection_ref.collection_id = state->collection_id;
- collection_ref.ref_name = (char *) ref;
-
- collection_refs_to_fetch[0] = &collection_ref;
- collection_refs_to_fetch[1] = NULL;
-
- if (progress != NULL)
- update_interval = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (progress), "update-interval"));
- if (update_interval == 0)
- update_interval = FLATPAK_DEFAULT_UPDATE_INTERVAL_MS;
-
- g_variant_builder_add (&find_builder, "{s@v}", "update-frequency",
- g_variant_new_variant (g_variant_new_uint32 (update_interval)));
-
- find_options = g_variant_ref_sink (g_variant_builder_end (&find_builder));
-
- context = flatpak_main_context_new_default ();
- chained_progress = flatpak_progress_chain (progress);
-
- ostree_repo_find_remotes_async (self->repo, (const OstreeCollectionRef * const *) collection_refs_to_fetch,
- find_options,
- NULL /* default finders */,
- chained_progress, cancellable,
- async_result_cb, &find_result);
-
- while (find_result == NULL)
- g_main_context_iteration (context, TRUE);
-
- allocated_results = ostree_repo_find_remotes_finish (self->repo, find_result, error);
-
- results = (const OstreeRepoFinderResult * const *) allocated_results;
- if (results == NULL)
- return FALSE;
-
- for (i = 0, rev = NULL; results[i] != NULL && rev == NULL; i++)
- rev = g_strdup (g_hash_table_lookup (results[i]->ref_to_checksum, &collection_ref));
-
- if (rev == NULL)
- return flatpak_fail_error (error, FLATPAK_ERROR_REF_NOT_FOUND, _("No such ref (%s, %s) in remote %s or elsewhere"),
- collection_ref.collection_id, collection_ref.ref_name, state->remote_name);
- }
- else
- {
- flatpak_remote_state_lookup_ref (state, ref, &rev, NULL, NULL, error);
- if (rev == NULL && error != NULL && *error == NULL)
- flatpak_fail_error (error, FLATPAK_ERROR_REF_NOT_FOUND, _("Couldn't find latest checksum for ref %s in remote %s"),
- ref, state->remote_name);
-
- results = NULL;
- }
+ results = NULL;
if (rev == NULL)
{
@@ -11258,69 +10664,8 @@ _flatpak_dir_get_remote_state (FlatpakDir *self,
}
}
- if (state->collection_id == NULL)
- {
- if (state->summary != NULL) /* In the optional case we might not have a summary */
- state->metadata = g_variant_get_child_value (state->summary, 1);
- }
- else
- {
- g_autofree char *latest_rev = NULL;
- g_autoptr(GVariant) commit_v = NULL;
- g_autoptr(GError) local_error = NULL;
-
- /* Make sure the branch is up to date, but ignore downgrade errors (see
- * below for the explanation). */
- if (!_flatpak_dir_fetch_remote_state_metadata_branch (self, state, only_cached, cancellable, &local_error) &&
- !g_error_matches (local_error, FLATPAK_ERROR, FLATPAK_ERROR_DOWNGRADE))
- {
- if (optional && !g_cancellable_is_cancelled (cancellable))
- {
- /* This happens for instance in the case where a p2p remote is invalid (wrong signature)
- and we should just silently fail to update to it. */
- state->metadata_fetch_error = g_steal_pointer (&local_error);
- g_debug ("Failed to download optional metadata");
- }
- else
- {
- g_propagate_error (error, g_steal_pointer (&local_error));
- return NULL;
- }
- }
- else
- {
- if (g_error_matches (local_error, FLATPAK_ERROR, FLATPAK_ERROR_DOWNGRADE))
- {
- /* The latest metadata available is a downgrade, which means we're offline and using a
- * LAN/USB source. Downgrading the metadata in the system repo would be a security
- * risk, so instead ignore the downgrade and use the later metadata. There's some
- * chance its information won't be accurate for the refs that are pulled, but using
- * the old metadata wouldn't always be correct either because there's no guarantee the
- * refs will be pulled from the same peer source as the metadata. Long term, we should
- * figure out how to rely less on it. */
- g_debug ("Ignoring downgrade of ostree-metadata; using the newer one instead");
- }
-
- /* Look up the commit containing the latest repository metadata. */
- latest_rev = flatpak_dir_read_latest (self, remote_or_uri, OSTREE_REPO_METADATA_REF,
- NULL, cancellable, error);
- if (latest_rev == NULL)
- {
- if (only_cached)
- {
- g_clear_error (error);
- g_set_error (error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_CACHED,
- _("No repo metadata cached for remote '%s'"), remote_or_uri);
- }
- return NULL;
- }
-
- if (!ostree_repo_load_commit (self->repo, latest_rev, &commit_v, NULL, error))
- return NULL;
-
- state->metadata = g_variant_get_child_value (commit_v, 0);
- }
- }
+ if (state->summary != NULL) /* In the optional case we might not have a summary */
+ state->metadata = g_variant_get_child_value (state->summary, 1);
if (state->metadata)
{
@@ -13544,149 +12889,6 @@ flatpak_dir_list_remote_refs (FlatpakDir *self,
return TRUE;
}
-gboolean
-_flatpak_dir_fetch_remote_state_metadata_branch (FlatpakDir *self,
- FlatpakRemoteState *state, /* This state does not have metadata filled out yet */
- gboolean only_cached,
- GCancellable *cancellable,
- GError **error)
-{
- g_autoptr(OstreeAsyncProgressFinish) progress = ostree_async_progress_new ();
- FlatpakPullFlags flatpak_flags;
- gboolean gpg_verify;
- g_autofree char *checksum_from_summary = NULL;
- g_autofree char *checksum_from_repo = NULL;
-
- g_assert (state->collection_id != NULL);
-
- /* We can only fetch metadata if we’re going to verify it with GPG. */
- if (!ostree_repo_remote_get_gpg_verify (self->repo, state->remote_name,
- &gpg_verify, error))
- return FALSE;
-
- if (!gpg_verify)
- return flatpak_fail_error (error, FLATPAK_ERROR_UNTRUSTED, _("Can't pull from untrusted non-gpg verified remote"));
-
- /* Look up the checksum as advertised by the summary file. If it differs from
- * what we currently have on disk, try and pull the updated ostree-metadata ref.
- * This is how we implement caching. Ignore failure and pull the ref anyway. */
- if (state->summary != NULL)
- flatpak_summary_lookup_ref (state->summary, state->collection_id,
- OSTREE_REPO_METADATA_REF,
- &checksum_from_summary, NULL);
-
- if (!flatpak_repo_resolve_rev (self->repo, state->collection_id, state->remote_name,
- OSTREE_REPO_METADATA_REF, TRUE, &checksum_from_repo,
- cancellable, error))
- return FALSE;
-
- g_debug ("%s: Comparing %s from summary and %s from repo",
- G_STRFUNC, checksum_from_summary, checksum_from_repo);
-
- if (checksum_from_summary != NULL && checksum_from_repo != NULL &&
- g_str_equal (checksum_from_summary, checksum_from_repo))
- return TRUE;
-
- /* Do the pull into the local repository. */
- flatpak_flags = FLATPAK_PULL_FLAGS_DOWNLOAD_EXTRA_DATA;
- flatpak_flags |= FLATPAK_PULL_FLAGS_NO_STATIC_DELTAS;
-
- if (flatpak_dir_use_system_helper (self, NULL))
- {
- g_autoptr(OstreeRepo) child_repo = NULL;
- g_auto(GLnxLockFile) child_repo_lock = { 0, };
- const char *installation = flatpak_dir_get_id (self);
- const char *subpaths[] = {NULL};
- const char * const *previous_ids = {NULL};
- g_autofree char *child_repo_path = NULL;
- FlatpakHelperDeployFlags helper_flags = 0;
- g_autofree char *url = NULL;
- gboolean gpg_verify_summary;
- gboolean gpg_verify;
- gboolean is_oci;
-
- if (!ostree_repo_remote_get_url (self->repo,
- state->remote_name,
- &url,
- error))
- return FALSE;
-
- if (!ostree_repo_remote_get_gpg_verify_summary (self->repo, state->remote_name,
- &gpg_verify_summary, error))
- return FALSE;
-
- if (!ostree_repo_remote_get_gpg_verify (self->repo, state->remote_name,
- &gpg_verify, error))
- return FALSE;
-
- is_oci = flatpak_dir_get_remote_oci (self, state->remote_name);
- if ((!gpg_verify_summary && state->collection_id == NULL) || !gpg_verify)
- {
- /* The remote is not gpg verified, so we don't want to allow installation via
- a download in the home directory, as there is no way to verify you're not
- injecting anything into the remote. However, in the case of a remote
- configured to a local filesystem we can just let the system helper do
- the installation, as it can then avoid network i/o and be certain the
- data comes from the right place.
-
- If a collection ID is available, we can verify the refs in commit
- metadata. */
- if (g_str_has_prefix (url, "file:"))
- helper_flags |= FLATPAK_HELPER_DEPLOY_FLAGS_LOCAL_PULL;
- else
- return flatpak_fail_error (error, FLATPAK_ERROR_UNTRUSTED, _("Can't pull from untrusted non-gpg verified remote"));
- }
- else if (is_oci)
- {
- return flatpak_fail_error (error, FLATPAK_ERROR_INVALID_DATA, _("No metadata branch for OCI"));
- }
- else
- {
- /* We're pulling from a remote source, we do the network mirroring pull as a
- user and hand back the resulting data to the system-helper, that trusts us
- due to the GPG signatures in the repo */
- child_repo = flatpak_dir_create_system_child_repo (self, &child_repo_lock, NULL, error);
- if (child_repo == NULL)
- return FALSE;
-
- if (!flatpak_dir_pull (self, state, OSTREE_REPO_METADATA_REF, NULL, NULL, NULL, NULL,
- child_repo,
- flatpak_flags,
- 0,
- progress, cancellable, error))
- return FALSE;
-
- if (!child_repo_ensure_summary (child_repo, state, cancellable, error))
- return FALSE;
-
- child_repo_path = g_file_get_path (ostree_repo_get_path (child_repo));
- }
-
- helper_flags |= FLATPAK_HELPER_DEPLOY_FLAGS_NO_DEPLOY;
-
- if (!flatpak_dir_system_helper_call_deploy (self,
- child_repo_path ? child_repo_path : "",
- helper_flags, OSTREE_REPO_METADATA_REF, state->remote_name,
- (const char * const *) subpaths, previous_ids,
- installation ? installation : "",
- cancellable,
- error))
- return FALSE;
-
- if (child_repo_path)
- (void) glnx_shutil_rm_rf_at (AT_FDCWD, child_repo_path, NULL, NULL);
-
- return TRUE;
- }
-
- if (!flatpak_dir_pull (self, state, OSTREE_REPO_METADATA_REF, NULL, NULL, NULL, NULL, NULL,
- flatpak_flags, OSTREE_REPO_PULL_FLAGS_NONE,
- progress, cancellable, error))
- return FALSE;
-
- return TRUE;
-}
-
static gboolean
strv_contains_prefix (const gchar * const *strv,
const gchar *str)
diff --git a/common/flatpak-transaction.c b/common/flatpak-transaction.c
index c635b379..629accbe 100644
--- a/common/flatpak-transaction.c
+++ b/common/flatpak-transaction.c
@@ -2543,171 +2543,6 @@ op_may_need_token (FlatpakTransactionOperation *op)
op->kind == FLATPAK_TRANSACTION_OPERATION_INSTALL_OR_UPDATE);
}
-static gboolean
-resolve_p2p_ops (FlatpakTransaction *self,
- GList *p2p_ops,
- GCancellable *cancellable,
- GError **error)
-{
- FlatpakTransactionPrivate *priv = flatpak_transaction_get_instance_private (self);
- g_autoptr(GPtrArray) resolves = g_ptr_array_new_with_free_func ((GDestroyNotify) flatpak_dir_resolve_free);
- g_autoptr(FlatpakDirP2PState) state = NULL;
- gboolean got_new_need_token;
- GList *l;
- int i;
-
- for (l = p2p_ops; l != NULL; l = l->next)
- {
- FlatpakTransactionOperation *op = l->data;
- FlatpakDirResolve *resolve;
-
- g_debug ("resolving %s using p2p", op->ref);
-
- g_assert (op->kind != FLATPAK_TRANSACTION_OPERATION_UNINSTALL);
- g_assert (op->kind != FLATPAK_TRANSACTION_OPERATION_INSTALL_BUNDLE);
- g_assert (!op->resolved);
-
- resolve = flatpak_dir_resolve_new (op->remote, op->ref, op->commit);
- g_ptr_array_add (resolves, resolve);
- }
-
- g_ptr_array_add (resolves, NULL);
-
- /* This does the metadata checks and resolving of no-op updates. */
- state = flatpak_dir_prepare_resolve_p2p_refs (priv->dir, (FlatpakDirResolve **) resolves->pdata,
- cancellable, error);
- if (state == NULL)
- return FALSE;
-
- /* Resolve any ops that we can resolve from the ostree-metadata info */
- for (i = 0, l = p2p_ops; l != NULL; i++, l = l->next)
- {
- FlatpakTransactionOperation *op = l->data;
- FlatpakDirResolve *resolve = g_ptr_array_index (resolves, i);
-
- if (resolve->resolved_commit == NULL)
- {
- g_autoptr(FlatpakRemoteState) state = flatpak_transaction_ensure_remote_state (self, op->kind, op->remote, NULL);
- if (state != NULL)
- flatpak_dir_resolve_maybe_resolve_from_metadata (resolve, state);
- }
- }
-
- /* We now pre-resolved all p2p operations, which is all we can do without full access
- to the commit objects. To get the commit objects we might need a token, but the information
- about whether we need a token or not is in the commit object. This is a catch-22, which we
- break by using the extracted commit info in the ostree-metadata branch. There is a minor
- risk that this is out-of-sync with the exact information in the commit if using a p2p mirror
- with an old version of the app, but the latest ostree-metadata version. The need-token info
- is unlikely to change though, and the worst case issue here is some permission error during
- download, so this is not *unsafe*, just kinda iffy.
- */
- got_new_need_token = FALSE;
- for (i = 0, l = p2p_ops; l != NULL; i++, l = l->next)
- {
- FlatpakTransactionOperation *op = l->data;
- FlatpakDirResolve *resolve = g_ptr_array_index (resolves, i);
-
- if (resolve->resolved_commit != NULL)
- continue; /* Already resolved this (as no-op) */
-
- if (op_may_need_token (op))
- {
- g_autoptr(FlatpakRemoteState) state = NULL;
- VarMetadataRef sparse_cache;
- gint32 token_type;
-
- state = flatpak_transaction_ensure_remote_state (self, op->kind, op->remote, error);
- if (state == NULL)
- return FALSE;
-
- token_type = state->default_token_type;
-
- if (flatpak_remote_state_lookup_sparse_cache (state, op->ref, &sparse_cache, NULL))
- token_type = GINT32_FROM_LE (var_metadata_lookup_int32 (sparse_cache, FLATPAK_SPARSE_CACHE_KEY_TOKEN_TYPE, token_type));
-
- if (token_type > 0)
- {
- /* We set op->need_token here from the ostree-repo
- so we query a token for this, later we'll
- override it with the resolved value */
- op->token_type = token_type;
- got_new_need_token = TRUE;
- }
- }
- }
-
- if (got_new_need_token)
- {
- if (!request_required_tokens (self, NULL, cancellable, error))
- return FALSE;
- }
-
- /* We can't get all the resolve commit objects in one pull request,
- because the token can be different for each ref, so we need to
- split things up by token.*/
-
- g_autoptr(GPtrArray) non_token_resolves = g_ptr_array_new ();
- g_autoptr(GHashTable) token_resolves_ht = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) g_ptr_array_unref);
-
- for (i = 0, l = p2p_ops; l != NULL; i++, l = l->next)
- {
- FlatpakTransactionOperation *op = l->data;
- FlatpakDirResolve *resolve = g_ptr_array_index (resolves, i);
-
- if (resolve->resolved_commit != NULL)
- continue; /* Already resolved this (as no-op) */
-
- if (op->resolved_token)
- {
- GPtrArray *token_resolves = g_hash_table_lookup (token_resolves_ht, op->resolved_token);
- if (token_resolves == NULL)
- {
- token_resolves = g_ptr_array_new ();
- g_hash_table_insert (token_resolves_ht, op->resolved_token, token_resolves);
- }
- g_ptr_array_add (token_resolves, resolve);
- }
- else
- {
- g_ptr_array_add (non_token_resolves, resolve);
- }
- }
-
- /* This does the downloads of the actual commit objects that are needed. */
-
- /* First refs that need no token */
- g_ptr_array_add (non_token_resolves, NULL); // NULL terminate
- if (!flatpak_dir_finish_resolve_p2p_refs (priv->dir, (FlatpakDirResolve **) non_token_resolves->pdata, NULL,
- state, cancellable, error))
- return FALSE;
-
- /* Then once per token */
- GLNX_HASH_TABLE_FOREACH_KV(token_resolves_ht, const char *, token, GPtrArray *, token_resolves)
- {
- g_ptr_array_add (token_resolves, NULL); // NULL terminate
- if (!flatpak_dir_finish_resolve_p2p_refs (priv->dir, (FlatpakDirResolve **) token_resolves->pdata, token,
- state, cancellable, error))
- return FALSE;
- }
-
- for (i = 0, l = p2p_ops; l != NULL; i++, l = l->next)
- {
- FlatpakTransactionOperation *op = l->data;
- FlatpakDirResolve *resolve = g_ptr_array_index (resolves, i);
-
- op->download_size = resolve->download_size;
- op->installed_size = resolve->installed_size;
- op->eol = g_strdup (resolve->eol);
- op->eol_rebase = g_strdup (resolve->eol_rebase);
- op->token_type = resolve->token_type;
-
- resolve_op_end (self, op, resolve->resolved_commit, resolve->resolved_metadata);
- }
-
- return TRUE;
-}
-
/* Resolving an operation means figuring out the target commit
checksum and the metadata for that commit, so that we can handle
dependencies from it, and verify versions. */
@@ -2775,7 +2610,7 @@ resolve_ops (FlatpakTransaction *self,
resolve_op_from_commit (self, op, checksum, commit_data);
}
- else if (state->collection_id == NULL) /* In the non-p2p case we have all the info available in the summary, so use it */
+ else
{
g_autoptr(GError) local_error = NULL;
@@ -2803,17 +2638,8 @@ resolve_ops (FlatpakTransaction *self,
where the user specified a commit, or p2p doesn't have the latest commit available */
resolve_op_from_metadata (self, op, checksum, state);
}
- else
- {
- /* This is a (potential) p2p operation, so rather than do these individually we queue them up in an operation later */
- collection_id_ops = g_list_prepend (collection_id_ops, op);
- }
}
- if (collection_id_ops != NULL &&
- !resolve_p2p_ops (self, collection_id_ops, cancellable, error))
- return FALSE;
-
return TRUE;
}
diff --git a/tests/Makefile-test-matrix.am.inc b/tests/Makefile-test-matrix.am.inc
index 9b02f1a9..7ce305d5 100644
--- a/tests/Makefile-test-matrix.am.inc
+++ b/tests/Makefile-test-matrix.am.inc
@@ -11,15 +11,11 @@ TEST_MATRIX= \
tests/test-repo@user.wrap \
tests/test-repo@system.wrap \
tests/test-repo@system-norevokefs.wrap \
- tests/test-repo@collections.wrap \
- tests/test-repo@collections-server-only.wrap \
tests/test-bundle@user.wrap \
tests/test-bundle@system.wrap \
tests/test-bundle@system-norevokefs.wrap \
tests/test-oci-registry@user.wrap \
tests/test-oci-registry@system.wrap \
- tests/test-auth@nocollections.wrap \
- tests/test-auth@collections.wrap \
$(NULL)
TEST_MATRIX_DIST= \
tests/test-basic.sh \
@@ -34,6 +30,7 @@ TEST_MATRIX_DIST= \
tests/test-update-remote-configuration.sh \
tests/test-override.sh \
tests/test-update-portal.sh \
+ tests/test-auth.sh \
$(NULL)
TEST_MATRIX_EXTRA_DIST= \
tests/test-run.sh \
@@ -41,5 +38,4 @@ TEST_MATRIX_EXTRA_DIST= \
tests/test-repo.sh \
tests/test-bundle.sh \
tests/test-oci-registry.sh \
- tests/test-auth.sh \
$(NULL)
diff --git a/tests/Makefile.am.inc b/tests/Makefile.am.inc
index 7c2e8271..29977272 100644
--- a/tests/Makefile.am.inc
+++ b/tests/Makefile.am.inc
@@ -177,7 +177,7 @@ 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+collections+collections-server-only} \
+ tests/test-repo.sh{user+system+system-norevokefs} \
tests/test-default-remotes.sh \
tests/test-extensions.sh \
tests/test-bundle.sh{user+system+system-norevokefs} \
@@ -187,7 +187,7 @@ TEST_MATRIX_SOURCE = \
tests/test-update-remote-configuration.sh \
tests/test-override.sh \
tests/test-update-portal.sh \
- tests/test-auth.sh{nocollections+collections} \
+ tests/test-auth.sh \
$(NULL)
update-test-matrix:
diff --git a/tests/test-wrapper.sh b/tests/test-wrapper.sh
index a7cc6e10..e2cc6286 100755
--- a/tests/test-wrapper.sh
+++ b/tests/test-wrapper.sh
@@ -18,18 +18,6 @@ for feature in $(echo $1 | sed "s/^.*@\(.*\).wrap/\1/" | tr "," "\n"); do
nodeltas)
export USE_DELTAS=no
;;
- nocollections)
- export USE_COLLECTIONS_IN_SERVER=no
- export USE_COLLECTIONS_IN_CLIENT=no
- ;;
- collections)
- export USE_COLLECTIONS_IN_SERVER=yes
- export USE_COLLECTIONS_IN_CLIENT=yes
- ;;
- collections-server-only)
- export USE_COLLECTIONS_IN_SERVER=yes
- export USE_COLLECTIONS_IN_CLIENT=no
- ;;
labels)
export USE_OCI_LABELS=yes
;;