NetworkManager/libnm-core/tests
Antonio Cardace 97d3f1b4b9 nm-setting-bond: don't take default values into account when comparing options
This solves a bug exposed by the following cmds:
$ nmcli c add type bond ifname bond0 con-name bond0
$ nmcli c modify bond0 +bond.options miimon=100
$ nmcli -f bond.options c show bond0
bond.options:                           mode=balance-rr

Here we just added the option 'miimon=100', but it doesn't get saved in
because nm_settings_connection_set_connection() which is responsible for
actually updating the connection compares the new connection with old
one and if and only if the 2 are different the update is carried out.

The bug is triggered because when comparing, if default values are taken into
account, then having 'miimon=100' or not having it it's essentially the
same for compare(). While this doesn't cause a bond to have a wrong
setting when activated it's wrong from a user experience point of view
and thus must be fixed.

When this patch is applied, the above
commands will give the following results:
$ nmcli c add type bond ifname bond0 con-name bond0
$ nmcli c modify bond0 +bond.options miimon=100
$ nmcli -f bond.options c show bond0
bond.options:                           mode=balance-rr,miimon=100

Fix unit tests and also add a new case covering this bug.

https://bugzilla.redhat.com/show_bug.cgi?id=1806549
2020-03-19 17:26:08 +01:00
..
certs libnm/crypto: accept TPM2-wrapped PEM keys 2019-07-10 17:31:48 +02:00
meson.build libnm/keyfile: build keyfile code as separate GPL licensed internal library 2020-01-07 13:17:47 +01: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 all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
test-crypto.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
test-general-enums.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
test-general.c settings: simplify property setter from GVariant to NMSettingConnection:interface-name 2020-02-26 17:51:13 +01:00
test-keyfile.c libnm/keyfile: build keyfile code as separate GPL licensed internal library 2020-01-07 13:17:47 +01:00
test-secrets.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
test-setting.c nm-setting-bond: don't take default values into account when comparing options 2020-03-19 17:26:08 +01:00
test-settings-defaults.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00