diff options
author | Thomas Haller <thaller@redhat.com> | 2018-10-03 00:02:30 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-10-19 00:14:54 +0200 |
commit | 12f78af0ec16ddfefc28ec28ccabbff25db3670d (patch) | |
tree | 07b4d2253ce8008eae6a9861030bbe7254b37431 | |
parent | f8f7b3d160c7f59baa3ba99c345622d66004f37b (diff) | |
download | NetworkManager-12f78af0ec16ddfefc28ec28ccabbff25db3670d.tar.gz |
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 2e0a95530f4150465ffd18f08bb0fe73891913f3)
-rw-r--r-- | src/settings/plugins/keyfile/tests/test-keyfile.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/settings/plugins/keyfile/tests/test-keyfile.c b/src/settings/plugins/keyfile/tests/test-keyfile.c index b825e0d7df..f91df96ce6 100644 --- a/src/settings/plugins/keyfile/tests/test-keyfile.c +++ b/src/settings/plugins/keyfile/tests/test-keyfile.c @@ -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 |