mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 09:20:08 +01:00
keyfile/tests: assert against auto generated UUID for keyfile
The algorithm for generating the UUID must be stable. Assert
against that.
(cherry picked from commit 2e0a95530f)
This commit is contained in:
parent
f8f7b3d160
commit
12f78af0ec
1 changed files with 6 additions and 3 deletions
|
|
@ -2150,12 +2150,15 @@ static void
|
|||
test_read_missing_id_uuid (void)
|
||||
{
|
||||
gs_unref_object NMConnection *connection = NULL;
|
||||
gs_free char *expected_uuid = NULL;
|
||||
const char *FILENAME = TEST_KEYFILES_DIR"/Test_Missing_ID_UUID";
|
||||
|
||||
connection = keyfile_read_connection_from_file (TEST_KEYFILES_DIR"/Test_Missing_ID_UUID");
|
||||
expected_uuid = _nm_utils_uuid_generate_from_strings ("keyfile", FILENAME, NULL);
|
||||
|
||||
connection = keyfile_read_connection_from_file (FILENAME);
|
||||
|
||||
/* Ensure the ID and UUID properties are there */
|
||||
g_assert_cmpstr (nm_connection_get_id (connection), ==, "Test_Missing_ID_UUID");
|
||||
g_assert (nm_connection_get_uuid (connection));
|
||||
g_assert_cmpstr (nm_connection_get_uuid (connection), ==, expected_uuid);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue