diff options
author | Colin Walters <walters@verbum.org> | 2023-02-09 08:24:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-09 08:24:58 -0500 |
commit | 8025a83b6dd5414d4211c2bfbee47bda42136c69 (patch) | |
tree | 17229f37068cfdb7d7eecfc810caa8b25fe4700d /tests | |
parent | cff0a1730aa753afc9fbcf323c10f7369ee925c6 (diff) | |
parent | 6f8669331d8dffa05296135443116268d21bac54 (diff) | |
download | ostree-8025a83b6dd5414d4211c2bfbee47bda42136c69.tar.gz |
Merge pull request #1946 from dbnicholson/ostree-metadata-api
ostree-metadata commit API
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-basic-c.c | 8 | ||||
-rw-r--r-- | tests/test-commit-sign-sh-ext.c | 12 | ||||
-rw-r--r-- | tests/test-libarchive-import.c | 2 | ||||
-rw-r--r-- | tests/test-pull-c.c | 6 | ||||
-rw-r--r-- | tests/test-repo.c | 6 | ||||
-rw-r--r-- | tests/test-sysroot-c.c | 4 |
6 files changed, 19 insertions, 19 deletions
diff --git a/tests/test-basic-c.c b/tests/test-basic-c.c index fc995298..99e1c547 100644 --- a/tests/test-basic-c.c +++ b/tests/test-basic-c.c @@ -512,7 +512,7 @@ test_read_xattrs (void) { g_autoptr(GVariant) current_xattrs = ostree_fs_get_all_xattrs (tmpd.fd, NULL, error); g_assert_no_error (local_error); - + int r = fsetxattr (tmpd.fd, "user.ostreetesting", value, sizeof (value), 0); if (r != 0) @@ -525,7 +525,7 @@ test_read_xattrs (void) g_autoptr(GVariant) new_xattrs = ostree_fs_get_all_xattrs (tmpd.fd, NULL, error); g_assert_no_error (local_error); - + compare_xattrs (current_xattrs, new_xattrs); } @@ -546,10 +546,10 @@ test_read_xattrs (void) // if (r < 0) // glnx_throw_errno_prefix (error, "lsetxattr"); // g_assert_no_error (local_error); - + // g_autoptr(GVariant) new_xattrs = ostree_fs_get_all_xattrs_at (tmpd.fd, "somelink", NULL, error); // g_assert_no_error (local_error); - + // compare_xattrs (current_xattrs, new_xattrs); } } diff --git a/tests/test-commit-sign-sh-ext.c b/tests/test-commit-sign-sh-ext.c index 22b6deca..c11bd0f1 100644 --- a/tests/test-commit-sign-sh-ext.c +++ b/tests/test-commit-sign-sh-ext.c @@ -73,31 +73,31 @@ run (GError **error) g_autoptr(GBytes) commit_bytes = g_variant_get_data_as_bytes (commit); g_autoptr(GBytes) detached_meta_bytes = g_variant_get_data_as_bytes (detached_meta); g_autofree char *verify_report = NULL; - if (!ostree_repo_signature_verify_commit_data (repo, "origin", commit_bytes, detached_meta_bytes, 0, + if (!ostree_repo_signature_verify_commit_data (repo, "origin", commit_bytes, detached_meta_bytes, 0, &verify_report, error)) return FALSE; - if (ostree_repo_signature_verify_commit_data (repo, "origin", commit_bytes, detached_meta_bytes, - OSTREE_REPO_VERIFY_FLAGS_NO_GPG | OSTREE_REPO_VERIFY_FLAGS_NO_SIGNAPI, + if (ostree_repo_signature_verify_commit_data (repo, "origin", commit_bytes, detached_meta_bytes, + OSTREE_REPO_VERIFY_FLAGS_NO_GPG | OSTREE_REPO_VERIFY_FLAGS_NO_SIGNAPI, &verify_report, error)) return glnx_throw (error, "Should not have validated"); assert_error_contains (error, "No commit verification types enabled"); // No signatures g_autoptr(GBytes) empty = g_bytes_new_static ("", 0); - if (ostree_repo_signature_verify_commit_data (repo, "origin", commit_bytes, empty, 0, + if (ostree_repo_signature_verify_commit_data (repo, "origin", commit_bytes, empty, 0, &verify_report, error)) return glnx_throw (error, "Should not have validated"); assert_error_contains (error, "no signatures found"); // No such remote - if (ostree_repo_signature_verify_commit_data (repo, "nosuchremote", commit_bytes, detached_meta_bytes, 0, + if (ostree_repo_signature_verify_commit_data (repo, "nosuchremote", commit_bytes, detached_meta_bytes, 0, &verify_report, error)) return glnx_throw (error, "Should not have validated"); assert_error_contains (error, "Remote \"nosuchremote\" not found"); // Corrupted commit g_autoptr(GBytes) corrupted_commit = corrupt (commit_bytes); - if (ostree_repo_signature_verify_commit_data (repo, "origin", corrupted_commit, detached_meta_bytes, 0, + if (ostree_repo_signature_verify_commit_data (repo, "origin", corrupted_commit, detached_meta_bytes, 0, &verify_report, error)) return glnx_throw (error, "Should not have validated"); assert_error_contains (error, "BAD signature"); diff --git a/tests/test-libarchive-import.c b/tests/test-libarchive-import.c index 716aa306..a89fcc24 100644 --- a/tests/test-libarchive-import.c +++ b/tests/test-libarchive-import.c @@ -54,7 +54,7 @@ test_data_init (TestData *td) g_assert_no_error (error); g_assert (td->fd >= 0); - + g_assert_cmpint (0, ==, archive_write_set_format_pax (a)); g_assert_cmpint (0, ==, archive_write_add_filter_gzip (a)); g_assert_cmpint (0, ==, archive_write_open_fd (a, td->fd)); diff --git a/tests/test-pull-c.c b/tests/test-pull-c.c index 3957e43b..037a1789 100644 --- a/tests/test-pull-c.c +++ b/tests/test-pull-c.c @@ -81,7 +81,7 @@ test_pull_multi_nochange (gconstpointer data) goto out; if (!ostree_repo_pull (td->repo, "origin", (char**)&refs, 0, NULL, NULL, error)) goto out; - + out: g_assert_no_error (local_error); } @@ -91,7 +91,7 @@ test_pull_multi_error_then_ok (gconstpointer data) { GError *local_error = NULL; GError **error = &local_error; - + TestData *td = (void*)data; char *ok_refs[] = { "main", NULL }; char *bad_refs[] = { "nosuchbranch", NULL }; @@ -110,7 +110,7 @@ test_pull_multi_error_then_ok (gconstpointer data) if (!ostree_repo_pull (td->repo, "origin", (char**)&ok_refs, 0, NULL, NULL, error)) goto out; } - + out: g_assert_no_error (local_error); } diff --git a/tests/test-repo.c b/tests/test-repo.c index 4a7a44a0..b8365ea9 100644 --- a/tests/test-repo.c +++ b/tests/test-repo.c @@ -245,13 +245,13 @@ test_write_regfile_api (Fixture *fixture, g_clear_pointer (&checksum, g_free); // Invalid checksum - checksum = ostree_repo_write_regfile_inline (repo, "3272139f889f6a7007b3d64adc74be9e2979bf6bbe663d1512e5bd43f4de24a1", + checksum = ostree_repo_write_regfile_inline (repo, "3272139f889f6a7007b3d64adc74be9e2979bf6bbe663d1512e5bd43f4de24a1", 0, 0, S_IFREG | 0644, NULL, (const guint8*)contents, sizeof (contents)-1, NULL, &error); g_assert (checksum == NULL); g_assert (error != NULL); g_clear_error (&error); - - // Now with xattrs + + // Now with xattrs g_clear_pointer (&checksum, g_free); checksum = ostree_repo_write_regfile_inline (repo, NULL, 0, 0, S_IFREG | 0644, xattrs, (const guint8*)contents, sizeof (contents)-1, NULL, &error); g_assert_no_error (error); diff --git a/tests/test-sysroot-c.c b/tests/test-sysroot-c.c index 2b1fc710..82b4b1bf 100644 --- a/tests/test-sysroot-c.c +++ b/tests/test-sysroot-c.c @@ -77,10 +77,10 @@ int main (int argc, char **argv) g_test_init (&argc, &argv, NULL); - sysroot = ot_test_setup_sysroot (NULL, &error); + sysroot = ot_test_setup_sysroot (NULL, &error); if (!sysroot) goto out; - + g_test_add_data_func ("/sysroot-reload", sysroot, test_sysroot_reload); return g_test_run(); |