NetworkManager/libnm-core/tests
Thomas Haller 837d44ffa4 keyfile: split automatically setting ID/UUID for keyfile
keyfile already supports omitting the "connection.id" and
"connection.uuid". In that case, the ID would be taken from the
keyfile's name, and the UUID was generated by md5 hashing the
full filename.

No longer do this during nm_keyfile_read(), instead let all
callers call nm_keyfile_read_ensure_*() to their liking. This is done
for two reasons:

 - a minor reason is, that one day we want to expose keyfile API
   as public API. That means, we also want to read keyfiles from
   stdin, where there is no filename available. The implementation
   which parses stdio needs to define their own way of auto-generating
   ID and UUID. Note how nm_keyfile_read()'s API no longer takes a
   filename as argument, which would be awkward for the stdin case.

 - Currently, we only support one keyfile directory, which (configurably)
   is "/etc/NetworkManager/system-connections".
   In the future, we want to support multiple keyfile dirctories, like
   "/var/run/NetworkManager/profiles" or "/usr/lib/NetworkManager/profiles".
   Here we want that a file "foo" (which does not specify a UUID) gets the
   same UUID regardless of the directory it is in. That seems better, because
   then the UUID won't change as you move the file between directories.
   Yes, that means, that the same UUID will be provided by multiple
   files, but NetworkManager must already cope with that situation anyway.
   Unfortunately, the UUID generation scheme hashes the full path. That
   means, we must hash the path name of the file "foo" inside the
   original "system-connections" directory.
   Refactor the code so that it accounds for a difference between the
   filename of the keyfile, and the profile_dir used for generating
   the UUID.
2018-10-04 11:03:23 +02:00
..
certs libnm-core: support private keys encrypted with AES-{192,256}-CBC 2018-08-28 11:05:01 +02:00
meson.build build: create "config-extra.h" header instead of passing directory variables via CFLAGS 2018-07-17 17:46:39 +02:00
nm-core-tests-enum-types.c.template build: use template files for enum types' sources generation 2017-12-18 11:25:06 +01:00
nm-core-tests-enum-types.h.template build: use template files for enum types' sources generation 2017-12-18 11:25:06 +01:00
test-compare.c shared: move shared files to subdirectory "shared/nm-utils/" 2016-06-16 10:45:53 +02:00
test-crypto.c libnm/crypto: refactor nmtst_crypto_rsa_key_encrypt() and clear memory 2018-09-04 07:38:30 +02:00
test-general-enums.h utils: support unknown numeric values in nm_utils_enum_to_str() and nm_utils_enum_from_str() 2017-02-20 13:45:32 +01:00
test-general.c core/tests: remove an unused variable 2018-09-19 14:28:08 +02:00
test-keyfile.c keyfile: split automatically setting ID/UUID for keyfile 2018-10-04 11:03:23 +02:00
test-secrets.c build: use default NM_BUILD_* defines for tests 2018-05-31 15:59:38 +02:00
test-setting.c keyfile: split automatically setting ID/UUID for keyfile 2018-10-04 11:03:23 +02:00
test-settings-defaults.c shared: move shared files to subdirectory "shared/nm-utils/" 2016-06-16 10:45:53 +02:00