mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-01 06:50:30 +01:00
keyfile/tests: assert against auto generated UUID for keyfile
The algorithm for generating the UUID must be stable. Assert against that.
This commit is contained in:
parent
e886e5364e
commit
2e0a95530f
1 changed files with 6 additions and 3 deletions
|
|
@ -2152,12 +2152,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