From: Michael Tremer Date: Wed, 1 Nov 2023 14:33:50 +0000 (+0000) Subject: tests: keys are anchored to the context and no longer Pakfire X-Git-Tag: 0.9.30~1344 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ff9eb8262d8e674652b278c6e237c06c54b5a6e9;p=pakfire.git tests: keys are anchored to the context and no longer Pakfire Signed-off-by: Michael Tremer --- diff --git a/tests/libpakfire/key.c b/tests/libpakfire/key.c index 54b309c83..c6ea5134a 100644 --- a/tests/libpakfire/key.c +++ b/tests/libpakfire/key.c @@ -34,11 +34,11 @@ static int test_generate(const struct test* t) { int r = EXIT_FAILURE; // Try to call pakfire_key_generate() with some invalid inputs - ASSERT_ERRNO(pakfire_key_generate(&key, t->pakfire, + ASSERT_ERRNO(pakfire_key_generate(&key, t->ctx, PAKFIRE_KEY_ALGO_NULL, "Key 1"), EINVAL); // Generate a new key using ed25519 - ASSERT_SUCCESS(pakfire_key_generate(&key, t->pakfire, + ASSERT_SUCCESS(pakfire_key_generate(&key, t->ctx, PAKFIRE_KEY_ALGO_ED25519, "Key 2")); // Write the public key to the console @@ -69,7 +69,7 @@ static int test_sign_and_verify(const struct test* t) { ASSERT(f = test_mktemp(NULL)); // Generate a new key using ed25519 - ASSERT_SUCCESS(pakfire_key_generate(&key, t->pakfire, + ASSERT_SUCCESS(pakfire_key_generate(&key, t->ctx, PAKFIRE_KEY_ALGO_ED25519, "Key 1")); // Write the public key to the console @@ -108,7 +108,7 @@ static int test_import_public(const struct test* t) { ASSERT(f = fopen(TEST_DATA_DIR "/keys/key1.pub", "r")); // Try to import the key - ASSERT_SUCCESS(pakfire_key_import(&key, t->pakfire, f)); + ASSERT_SUCCESS(pakfire_key_import(&key, t->ctx, f)); // Write the imported key to the console ASSERT_SUCCESS(pakfire_key_export(key, stdout, PAKFIRE_KEY_EXPORT_MODE_PUBLIC)); @@ -134,7 +134,7 @@ static int test_import_secret(const struct test* t) { ASSERT(f = fopen(TEST_DATA_DIR "/keys/key1.sec", "r")); // Try to import the key - ASSERT_SUCCESS(pakfire_key_import(&key, t->pakfire, f)); + ASSERT_SUCCESS(pakfire_key_import(&key, t->ctx, f)); // Write the imported key to the console ASSERT_SUCCESS(pakfire_key_export(key, stdout, PAKFIRE_KEY_EXPORT_MODE_PRIVATE)); @@ -152,10 +152,10 @@ FAIL: } int main(int argc, const char* argv[]) { - testsuite_add_test(test_generate, TEST_WANTS_PAKFIRE); - testsuite_add_test(test_sign_and_verify, TEST_WANTS_PAKFIRE); - testsuite_add_test(test_import_public, TEST_WANTS_PAKFIRE); - testsuite_add_test(test_import_secret, TEST_WANTS_PAKFIRE); + testsuite_add_test(test_generate, 0); + testsuite_add_test(test_sign_and_verify, 0); + testsuite_add_test(test_import_public, 0); + testsuite_add_test(test_import_secret, 0); return testsuite_run(argc, argv); }