NetworkManager/src/tests
Thomas Haller ba1cc6a288 core: refactor evaluation of device's match-spec
Previously, we would have different functions like
  - nm_match_spec_device_type()
  - nm_match_spec_hwaddr()
  - nm_match_spec_s390_subchannels()
  - nm_match_spec_interface_name()
which all would handle one type of match-spec.

So, to get the overall result whether the arguments
match or not, nm_device_spec_match_list() had to stich
them together and iterate the list multiple times.

Refactor the code to have one nm_match_spec_device()
function that gets all relevant paramters.

The upside is:

  - the logic how to evaluate the match-spec is all at one place
    (match_device_eval()) instead of spread over multiple
    functions.

  - It requires iterating the list at most twice. Twice, because
    we do a fast pre-search for "*".

One downside could be, that we have to pass all 4 arguments
for the evaluation, even if the might no be needed. That is,
because "nm-core-utils.c" shall be independend from NMDevice, it
cannot receive a device instance to get the parameters as needed.
As we would add new match-types, the argument list would grow.
However, all arguments are cached and fetching them from the
device's private data is very cheap.

(cherry picked from commit b957403efd)
2017-01-20 21:18:30 +01:00
..
config config: drop nm_config_get_dhcp_client() and access config directly 2016-11-25 18:02:38 +01:00
test-dcb.c all: modify line separator comments to be 80 chars wide 2016-10-03 12:01:15 +02:00
test-general-with-expect.c all: use O_CLOEXEC for file descriptors 2016-12-13 11:26:59 +01:00
test-general.c core: refactor evaluation of device's match-spec 2017-01-20 21:18:30 +01:00
test-ip4-config.c build: don't add subdirectories to include search path but require qualified include 2016-11-21 14:26:37 +01:00
test-ip6-config.c ip6-config: add nm_ip6_config_set_privacy() 2016-12-05 10:56:51 +01:00
test-resolvconf-capture.c build: don't add subdirectories to include search path but require qualified include 2016-11-21 14:26:37 +01:00
test-route-manager.c build: don't add subdirectories to include search path but require qualified include 2016-11-21 14:26:37 +01:00
test-secret-agent.py python: make test-secret-agent.py python3 ready 2016-12-14 19:00:42 +01:00
test-systemd.c build: don't add systemd path the include search path 2016-09-27 14:13:21 +02:00
test-utils.c core: add assertions for network_id/stable_type 2017-01-09 14:50:33 +01:00
test-wired-defname.c build: don't add subdirectories to include search path but require qualified include 2016-11-21 14:26:37 +01:00