tests/repo-finder: Explicitly commit empty dir
authorColin Walters <walters@verbum.org>
Sat, 1 Aug 2020 18:47:36 +0000 (18:47 +0000)
committerColin Walters <walters@verbum.org>
Sun, 2 Aug 2020 12:54:11 +0000 (12:54 +0000)
We were committing the whole tempdir, which seems to fail
in Travis because the GPG agent Unix domain socket ends up there too,
and ostree refuses to commit sockets.

tests/test-repo-finder-config.c
tests/test-repo-finder-mount.c

index 0a2e9e607e4d2b9278f367660ed23426ef9c755a..ead9e9077f02da5aa4ae58cc576a31882c40fa07 100644 (file)
@@ -173,6 +173,9 @@ assert_create_remote (Fixture     *fixture,
   glnx_shutil_mkdir_p_at (fixture->tmpdir.fd, repo_name, 0700, NULL, &error);
   g_assert_no_error (error);
 
+  glnx_shutil_mkdir_p_at (fixture->tmpdir.fd, "empty", 0700, NULL, &error);
+  g_assert_no_error (error);
+
   g_autoptr(GFile) repo_path = g_file_get_child (fixture->working_dir, repo_name);
   g_autoptr(OstreeRepo) repo = ostree_repo_new (repo_path);
   ostree_repo_set_collection_id (repo, collection_id, &error);
@@ -193,7 +196,7 @@ assert_create_remote (Fixture     *fixture,
       g_autoptr(OstreeRepoFile) repo_file = NULL;
 
       mtree = ostree_mutable_tree_new ();
-      ostree_repo_write_dfd_to_mtree (repo, AT_FDCWD, ".", mtree, NULL, NULL, &error);
+      ostree_repo_write_dfd_to_mtree (repo, fixture->tmpdir.fd, "empty", mtree, NULL, NULL, &error);
       g_assert_no_error (error);
       ostree_repo_write_mtree (repo, mtree, (GFile **) &repo_file, NULL, &error);
       g_assert_no_error (error);
index af2f5e085f68adfef27857f9e4c4802b4933211a..e4130921a29ec8b0c43a159f5794751ca340496d 100644 (file)
@@ -190,6 +190,9 @@ assert_create_remote_va (Fixture *fixture,
   ostree_repo_create (repo, OSTREE_REPO_MODE_ARCHIVE, NULL, &error);
   g_assert_no_error (error);
 
+  glnx_shutil_mkdir_p_at (fixture->tmpdir.fd, "empty", 0700, NULL, &error);
+  g_assert_no_error (error);
+
   /* Set up the refs from @.... */
   for (const OstreeCollectionRef *ref = va_arg (args, const OstreeCollectionRef *);
        ref != NULL;
@@ -201,7 +204,7 @@ assert_create_remote_va (Fixture *fixture,
       gchar **out_checksum = va_arg (args, gchar **);
 
       mtree = ostree_mutable_tree_new ();
-      ostree_repo_write_dfd_to_mtree (repo, AT_FDCWD, ".", mtree, NULL, NULL, &error);
+      ostree_repo_write_dfd_to_mtree (repo, fixture->tmpdir.fd, "empty", mtree, NULL, NULL, &error);
       g_assert_no_error (error);
       ostree_repo_write_mtree (repo, mtree, (GFile **) &repo_file, NULL, &error);
       g_assert_no_error (error);