NetworkManager/src/tests/client/test-client.check-on-disk/test_offline.expected
Thomas Haller e6a33c04eb
all: make "ipv6.addr-gen-mode" configurable by global default
It can be useful to choose a different "ipv6.addr-gen-mode". And it can be
useful to override the default for a set of profiles.

For example, in cloud or in a data center, stable-privacy might not be
the best choice. Add a mechanism to override the default via global defaults
in NetworkManager.conf:

  # /etc/NetworkManager/conf.d/90-ipv6-addr-gen-mode-override.conf
  [connection-90-ipv6-addr-gen-mode-override]
  match-device=type:ethernet
  ipv6.addr-gen-mode=0

"ipv6.addr-gen-mode" is a special property, because its default depends on
the component that configures the profile.

- when read from disk (keyfile and ifcfg-rh), a missing addr-gen-mode
  key means to default to "eui64".
- when configured via D-Bus, a missing addr-gen-mode property means to
  default to "stable-privacy".
- libnm's ip6-config::addr-gen-mode property defaults to
  "stable-privacy".
- when some tool creates a profile, they either can explicitly
  set the mode, or they get the default of the underlying mechanisms
  above.

  - nm-initrd-generator explicitly sets "eui64" for profiles it creates.
  - nmcli doesn' explicitly set it, but inherits the default form
    libnm's ip6-config::addr-gen-mode.
  - when NM creates a auto-default-connection for ethernet ("Wired connection 1"),
    it inherits the default from libnm's ip6-config::addr-gen-mode.

Global connection defaults only take effect when the per-profile
value is set to a special default/unset value. To account for the
different cases above, we add two such special values: "default" and
"default-or-eui64". That's something we didn't do before, but it seams
useful and easy to understand.

Also, this neatly expresses the current behaviors we already have. E.g.
if you don't specify the "addr-gen-mode" in a keyfile, "default-or-eui64"
is a pretty clear thing.

Note that usually we cannot change default values, in particular not for
libnm's properties. That is because we don't serialize the default
values to D-Bus/keyfile, so if we change the default, we change
behavior. Here we change from "stable-privacy" to "default" and
from "eui64" to "default-or-eui64". That means, the user only experiences
a change in behavior, if they have a ".conf" file that overrides the default.

https://bugzilla.redhat.com/show_bug.cgi?id=1743161
https://bugzilla.redhat.com/show_bug.cgi?id=2082682

See-also: https://github.com/coreos/fedora-coreos-tracker/issues/907

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1213
2022-06-29 07:38:48 +02:00

137 lines
2.2 KiB
Text

size: 258
location: src/tests/client/test-client.py:test_offline()/1
cmd: $NMCLI g
lang: C
returncode: 1
stderr: 136 bytes
>>>
Error: Could not create NMClient object: Key/Value pair 0, 'invalid', in address element 'very:invalid' does not contain an equal sign.
<<<
size: 312
location: src/tests/client/test-client.py:test_offline()/2
cmd: $NMCLI --offline c add type ethernet
lang: C
returncode: 0
stdout: 162 bytes
>>>
[connection]
id=ethernet
uuid=UUID-WAS-HERE-BUT-IS-NO-MORE-SADLY
type=ethernet
[ethernet]
[ipv4]
method=auto
[ipv6]
addr-gen-mode=default
method=auto
[proxy]
<<<
size: 183
location: src/tests/client/test-client.py:test_offline()/3
cmd: $NMCLI --offline c show
lang: C
returncode: 2
stderr: 47 bytes
>>>
Error: command doesn't support --offline mode.
<<<
size: 178
location: src/tests/client/test-client.py:test_offline()/4
cmd: $NMCLI --offline g
lang: C
returncode: 2
stderr: 47 bytes
>>>
Error: command doesn't support --offline mode.
<<<
size: 176
location: src/tests/client/test-client.py:test_offline()/5
cmd: $NMCLI --offline
lang: C
returncode: 2
stderr: 47 bytes
>>>
Error: command doesn't support --offline mode.
<<<
size: 436
location: src/tests/client/test-client.py:test_offline()/6
cmd: $NMCLI --offline c add type wifi ssid lala 802-1x.eap pwd 802-1x.identity foo 802-1x.password bar
lang: C
returncode: 0
stdout: 225 bytes
>>>
[connection]
id=wifi
uuid=UUID-WAS-HERE-BUT-IS-NO-MORE-SADLY
type=wifi
[wifi]
mode=infrastructure
ssid=lala
[802-1x]
eap=pwd;
identity=foo
password=bar
[ipv4]
method=auto
[ipv6]
addr-gen-mode=default
method=auto
[proxy]
<<<
size: 474
location: src/tests/client/test-client.py:test_offline()/7
cmd: $NMCLI --offline c add type wifi ssid lala 802-1x.eap pwd 802-1x.identity foo 802-1x.password bar 802-1x.password-flags agent-owned
lang: C
returncode: 0
stdout: 229 bytes
>>>
[connection]
id=wifi
uuid=UUID-WAS-HERE-BUT-IS-NO-MORE-SADLY
type=wifi
[wifi]
mode=infrastructure
ssid=lala
[802-1x]
eap=pwd;
identity=foo
password-flags=1
[ipv4]
method=auto
[ipv6]
addr-gen-mode=default
method=auto
[proxy]
<<<
size: 199
location: src/tests/client/test-client.py:test_offline()/8
cmd: $NMCLI --complete-args --offline conn modify ipv6.ad
lang: C
returncode: 0
stdout: 34 bytes
>>>
ipv6.addresses
ipv6.addr-gen-mode
<<<