File: test_networkd.py

package info (click to toggle)
cloud-init 25.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,412 kB
  • sloc: python: 135,894; sh: 3,883; makefile: 141; javascript: 30; xml: 22
file content (732 lines) | stat: -rw-r--r-- 18,813 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
# This file is part of cloud-init. See LICENSE file for license information.

from configparser import ConfigParser
from string import Template
from unittest import mock

import pytest
import yaml

from cloudinit import safeyaml
from cloudinit.net import network_state, networkd

V2_CONFIG_OPTIONAL = """\
network:
  version: 2
  ethernets:
    eth0:
      optional: true
    eth1:
      optional: false
"""

V2_CONFIG_OPTIONAL_RENDERED_ETH0 = """[Link]
RequiredForOnline=no

[Match]
Name=eth0

[Network]
DHCP=no

"""

V2_CONFIG_OPTIONAL_RENDERED_ETH1 = """[Match]
Name=eth1

[Network]
DHCP=no

"""

V2_CONFIG_SET_NAME = """\
network:
  version: 2
  ethernets:
    eth0:
      match:
        macaddress: '00:11:22:33:44:55'
      addresses: [172.16.10.2/12, 172.16.10.3/12]
      nameservers:
        search: [spam.local, eggs.local]
        addresses: [8.8.8.8]
    eth1:
      match:
        macaddress: '66:77:88:99:00:11'
      set-name: "ens92"
      nameservers:
        search: [foo.local, bar.local]
        addresses: [4.4.4.4]
"""

V2_CONFIG_SET_NAME_RENDERED_ETH0 = """[Address]
Address=172.16.10.2/12

[Address]
Address=172.16.10.3/12

[Match]
MACAddress=00:11:22:33:44:55
Name=eth0

[Network]
DHCP=no
DNS=8.8.8.8
Domains=spam.local eggs.local

"""

V2_CONFIG_SET_NAME_RENDERED_ETH1 = """[Match]
MACAddress=66:77:88:99:00:11
Name=ens92

[Network]
DHCP=no
DNS=4.4.4.4
Domains=foo.local bar.local

"""

V2_CONFIG_DHCP_YES_OVERRIDES = """\
network:
  version: 2
  ethernets:
    eth0:
      dhcp4: true
      dhcp4-overrides:
        hostname: hal
        route-metric: 1100
        send-hostname: false
        use-dns: false
        use-domains: false
        use-hostname: false
        use-mtu: false
        use-ntp: false
        use-routes: false
      dhcp6: true
      dhcp6-overrides:
        use-dns: false
        use-domains: false
        use-hostname: false
        use-ntp: false
      match:
        macaddress: "00:11:22:33:44:55"
      nameservers:
        addresses: ["8.8.8.8", "2001:4860:4860::8888"]
"""

V2_CONFIG_DHCP_YES_OVERRIDES_RENDERED = """[DHCPv4]
Hostname=hal
RouteMetric=1100
SendHostname=False
UseDNS=False
UseDomains=False
UseHostname=False
UseMTU=False
UseNTP=False
UseRoutes=False

[DHCPv6]
UseDNS=False
UseDomains=False
UseHostname=False
UseNTP=False

[Match]
MACAddress=00:11:22:33:44:55
Name=eth0

[Network]
DHCP=yes
DNS=8.8.8.8 2001:4860:4860::8888

"""

V2_CONFIG_DHCP_DOMAIN_VS_OVERRIDE = Template(
    """\
network:
  version: 2
  ethernets:
    eth0:
      dhcp${dhcp_version}domain: true
      dhcp${dhcp_version}: true
      dhcp${dhcp_version}-overrides:
        use-domains: route
"""
)

V2_CONFIG_DHCP_OVERRIDES = Template(
    """\
network:
  version: 2
  ethernets:
    eth0:
      dhcp${dhcp_version}: true
      dhcp${dhcp_version}-overrides:
        ${key}: ${value}
      match:
        macaddress: "00:11:22:33:44:55"
      nameservers:
        addresses: ["8.8.8.8", "2001:4860:4860::8888"]
"""
)

V2_CONFIG_DHCP_OVERRIDES_RENDERED = Template(
    """[DHCPv${dhcp_version}]
${key}=${value}

[Match]
MACAddress=00:11:22:33:44:55
Name=eth0

[Network]
DHCP=ipv${dhcp_version}
DNS=8.8.8.8 2001:4860:4860::8888

"""
)

V1_CONFIG_MULTI_SUBNETS = """
network:
  version: 1
  config:
    - type: physical
      name: eth0
      mac_address: 'ae:98:25:fa:36:9e'
      subnets:
      - type: static
        address: '10.0.0.2'
        netmask: '255.255.255.255'
        gateway: '10.0.0.1'
      - type: static6
        address: '2a01:4f8:10a:19d2::4/64'
        gateway: '2a01:4f8:10a:19d2::2'
    - type: nameserver
      address:
      - '100.100.100.100'
      search:
      - 'rgrunbla.github.beta.tailscale.net'
"""

V1_CONFIG_MULTI_SUBNETS_RENDERED = """\
[Address]
Address=10.0.0.2/32

[Address]
Address=2a01:4f8:10a:19d2::4/64

[Match]
MACAddress=ae:98:25:fa:36:9e
Name=eth0

[Network]
DHCP=no
DNS=100.100.100.100
Domains=rgrunbla.github.beta.tailscale.net

[Route]
Gateway=10.0.0.1
GatewayOnLink=yes

[Route]
Gateway=2a01:4f8:10a:19d2::2

"""

V2_CONFIG_MULTI_SUBNETS = """
network:
  version: 2
  ethernets:
    eth0:
      addresses:
        - 192.168.1.1/24
        - fec0::1/64
      gateway4: 192.168.254.254
      gateway6: "fec0::ffff"
      routes:
        - to: 169.254.1.1/32
        - to: "fe80::1/128"
"""

V2_CONFIG_MULTI_SUBNETS_RENDERED = """\
[Address]
Address=192.168.1.1/24

[Address]
Address=fec0::1/64

[Match]
Name=eth0

[Network]
DHCP=no

[Route]
Gateway=192.168.254.254
GatewayOnLink=yes

[Route]
Gateway=fec0::ffff

[Route]
Destination=169.254.1.1/32

[Route]
Destination=fe80::1/128

"""

V1_CONFIG_MULTI_SUBNETS_NOT_ONLINK = """
network:
  version: 1
  config:
    - type: physical
      name: eth0
      mac_address: 'ae:98:25:fa:36:9e'
      subnets:
      - type: static
        address: '10.0.0.2'
        netmask: '255.255.255.0'
        gateway: '10.0.0.1'
      - type: static6
        address: '2a01:4f8:10a:19d2::4/64'
        gateway: '2a01:4f8:10a:19d2::2'
    - type: nameserver
      address:
      - '100.100.100.100'
      search:
      - 'rgrunbla.github.beta.tailscale.net'
"""

V1_CONFIG_MULTI_SUBNETS_NOT_ONLINK_RENDERED = """\
[Address]
Address=10.0.0.2/24

[Address]
Address=2a01:4f8:10a:19d2::4/64

[Match]
MACAddress=ae:98:25:fa:36:9e
Name=eth0

[Network]
DHCP=no
DNS=100.100.100.100
Domains=rgrunbla.github.beta.tailscale.net

[Route]
Gateway=10.0.0.1

[Route]
Gateway=2a01:4f8:10a:19d2::2

"""

V2_CONFIG_MULTI_SUBNETS_NOT_ONLINK = """
network:
  version: 2
  ethernets:
    eth0:
      addresses:
        - 192.168.1.1/24
        - fec0::1/64
      gateway4: 192.168.1.254
      gateway6: "fec0::ffff"
      routes:
        - to: 169.254.1.1/32
        - to: "fe80::1/128"
"""

V2_CONFIG_MULTI_SUBNETS_NOT_ONLINK_RENDERED = """\
[Address]
Address=192.168.1.1/24

[Address]
Address=fec0::1/64

[Match]
Name=eth0

[Network]
DHCP=no

[Route]
Gateway=192.168.1.254

[Route]
Gateway=fec0::ffff

[Route]
Destination=169.254.1.1/32

[Route]
Destination=fe80::1/128

"""

V1_CONFIG_MULTI_SUBNETS_ONLINK = """
network:
  version: 1
  config:
    - type: physical
      name: eth0
      mac_address: 'ae:98:25:fa:36:9e'
      subnets:
      - type: static
        address: '10.0.0.2'
        netmask: '255.255.255.0'
        gateway: '192.168.0.1'
      - type: static6
        address: '2a01:4f8:10a:19d2::4/64'
        gateway: '2000:4f8:10a:19d2::2'
    - type: nameserver
      address:
      - '100.100.100.100'
      search:
      - 'rgrunbla.github.beta.tailscale.net'
"""

V1_CONFIG_MULTI_SUBNETS_ONLINK_RENDERED = """\
[Address]
Address=10.0.0.2/24

[Address]
Address=2a01:4f8:10a:19d2::4/64

[Match]
MACAddress=ae:98:25:fa:36:9e
Name=eth0

[Network]
DHCP=no
DNS=100.100.100.100
Domains=rgrunbla.github.beta.tailscale.net

[Route]
Gateway=192.168.0.1
GatewayOnLink=yes

[Route]
Gateway=2000:4f8:10a:19d2::2
GatewayOnLink=yes

"""

V2_CONFIG_MULTI_SUBNETS_ONLINK = """
network:
  version: 2
  ethernets:
    eth0:
      addresses:
        - 192.168.1.1/32
        - fec0::1/128
      gateway4: 192.168.254.254
      gateway6: "fec0::ffff"
      routes:
        - to: 169.254.1.1/32
        - to: "fe80::1/128"
"""

V2_CONFIG_MULTI_SUBNETS_ONLINK_RENDERED = """\
[Address]
Address=192.168.1.1/32

[Address]
Address=fec0::1/128

[Match]
Name=eth0

[Network]
DHCP=no

[Route]
Gateway=192.168.254.254
GatewayOnLink=yes

[Route]
Gateway=fec0::ffff
GatewayOnLink=yes

[Route]
Destination=169.254.1.1/32

[Route]
Destination=fe80::1/128

"""

V1_CONFIG_ACCEPT_RA_YAML = """\
network:
  version: 1
  config:
    - type: physical
      name: eth0
      mac_address: "00:11:22:33:44:55"
"""

V2_CONFIG_ACCEPT_RA_YAML = """\
network:
  version: 2
  ethernets:
    eth0:
      match:
        macaddress: "00:11:22:33:44:55"
"""


class TestNetworkdRenderState:
    def _parse_network_state_from_config(self, config):
        with mock.patch("cloudinit.net.network_state.get_interfaces_by_mac"):
            config = yaml.safe_load(config)
            return network_state.parse_net_config_data(config["network"])

    def test_networkd_render_with_optional(self):
        with mock.patch("cloudinit.net.get_interfaces_by_mac"):
            ns = self._parse_network_state_from_config(V2_CONFIG_OPTIONAL)
            renderer = networkd.Renderer()
            rendered_content = renderer._render_content(ns)

        assert "eth0" in rendered_content
        assert rendered_content["eth0"] == V2_CONFIG_OPTIONAL_RENDERED_ETH0
        assert "eth1" in rendered_content
        assert rendered_content["eth1"] == V2_CONFIG_OPTIONAL_RENDERED_ETH1

    def test_networkd_render_with_set_name(self):
        with mock.patch("cloudinit.net.get_interfaces_by_mac"):
            ns = self._parse_network_state_from_config(V2_CONFIG_SET_NAME)
            renderer = networkd.Renderer()
            rendered_content = renderer._render_content(ns)

        assert "eth0" in rendered_content
        assert rendered_content["eth0"] == V2_CONFIG_SET_NAME_RENDERED_ETH0
        assert "ens92" in rendered_content
        assert rendered_content["ens92"] == V2_CONFIG_SET_NAME_RENDERED_ETH1

    def test_networkd_render_dhcp_yes_with_dhcp_overrides(self):
        with mock.patch("cloudinit.net.get_interfaces_by_mac"):
            ns = self._parse_network_state_from_config(
                V2_CONFIG_DHCP_YES_OVERRIDES
            )
            renderer = networkd.Renderer()
            rendered_content = renderer._render_content(ns)

        assert (
            rendered_content["eth0"] == V2_CONFIG_DHCP_YES_OVERRIDES_RENDERED
        )

    @pytest.mark.parametrize("dhcp_version", [("4"), ("6")])
    def test_networkd_render_dhcp_domains_vs_overrides(self, dhcp_version):
        expected_exception = (
            f"eth0 has both dhcp{dhcp_version}domain and"
            f" dhcp{dhcp_version}-overrides.use-domains configured. Use one"
        )
        with pytest.raises(Exception, match=expected_exception):
            with mock.patch("cloudinit.net.get_interfaces_by_mac"):
                config = V2_CONFIG_DHCP_DOMAIN_VS_OVERRIDE.substitute(
                    dhcp_version=dhcp_version
                )
                ns = self._parse_network_state_from_config(config)
                renderer = networkd.Renderer()
                renderer._render_content(ns)

    @pytest.mark.parametrize(
        "dhcp_version,spec_key,spec_value,rendered_key,rendered_value",
        [
            ("4", "use-dns", "false", "UseDNS", "False"),
            ("4", "use-dns", "true", "UseDNS", "True"),
            ("4", "use-ntp", "false", "UseNTP", "False"),
            ("4", "use-ntp", "true", "UseNTP", "True"),
            ("4", "send-hostname", "false", "SendHostname", "False"),
            ("4", "send-hostname", "true", "SendHostname", "True"),
            ("4", "use-hostname", "false", "UseHostname", "False"),
            ("4", "use-hostname", "true", "UseHostname", "True"),
            ("4", "hostname", "olivaw", "Hostname", "olivaw"),
            ("4", "route-metric", "12345", "RouteMetric", "12345"),
            ("4", "use-domains", "false", "UseDomains", "False"),
            ("4", "use-domains", "true", "UseDomains", "True"),
            ("4", "use-domains", "route", "UseDomains", "route"),
            ("4", "use-mtu", "false", "UseMTU", "False"),
            ("4", "use-mtu", "true", "UseMTU", "True"),
            ("4", "use-routes", "false", "UseRoutes", "False"),
            ("4", "use-routes", "true", "UseRoutes", "True"),
            ("6", "use-dns", "false", "UseDNS", "False"),
            ("6", "use-dns", "true", "UseDNS", "True"),
            ("6", "use-ntp", "false", "UseNTP", "False"),
            ("6", "use-ntp", "true", "UseNTP", "True"),
            ("6", "use-hostname", "false", "UseHostname", "False"),
            ("6", "use-hostname", "true", "UseHostname", "True"),
            ("6", "use-domains", "false", "UseDomains", "False"),
            ("6", "use-domains", "true", "UseDomains", "True"),
            ("6", "use-domains", "route", "UseDomains", "route"),
        ],
    )
    def test_networkd_render_dhcp_overrides(
        self, dhcp_version, spec_key, spec_value, rendered_key, rendered_value
    ):
        with mock.patch("cloudinit.net.get_interfaces_by_mac"):
            ns = self._parse_network_state_from_config(
                V2_CONFIG_DHCP_OVERRIDES.substitute(
                    dhcp_version=dhcp_version, key=spec_key, value=spec_value
                )
            )
            renderer = networkd.Renderer()
            rendered_content = renderer._render_content(ns)

        assert rendered_content[
            "eth0"
        ] == V2_CONFIG_DHCP_OVERRIDES_RENDERED.substitute(
            dhcp_version=dhcp_version, key=rendered_key, value=rendered_value
        )

    def test_networkd_render_v1_multi_subnets(self):
        """
        Ensure a device with multiple subnets gets correctly rendered.

        Per systemd-networkd docs, [Address] can only contain a single instance
        of Address.
        """
        with mock.patch("cloudinit.net.get_interfaces_by_mac"):
            ns = self._parse_network_state_from_config(V1_CONFIG_MULTI_SUBNETS)
            renderer = networkd.Renderer()
            rendered_content = renderer._render_content(ns)

        assert rendered_content["eth0"] == V1_CONFIG_MULTI_SUBNETS_RENDERED

    def test_networkd_render_v2_multi_subnets(self):
        """
        Ensure a device with multiple subnets gets correctly rendered.

        Per systemd-networkd docs, [Route] can only contain a single instance
        of Gateway.
        """
        with mock.patch("cloudinit.net.get_interfaces_by_mac"):
            ns = self._parse_network_state_from_config(V2_CONFIG_MULTI_SUBNETS)
            renderer = networkd.Renderer()
            rendered_content = renderer._render_content(ns)

        assert rendered_content["eth0"] == V2_CONFIG_MULTI_SUBNETS_RENDERED

    def test_networkd_render_v1_multi_subnets_not_onlink(self):
        with mock.patch("cloudinit.net.get_interfaces_by_mac"):
            ns = self._parse_network_state_from_config(
                V1_CONFIG_MULTI_SUBNETS_NOT_ONLINK
            )
            renderer = networkd.Renderer()
            rendered_content = renderer._render_content(ns)

        assert (
            rendered_content["eth0"]
            == V1_CONFIG_MULTI_SUBNETS_NOT_ONLINK_RENDERED
        )

    def test_networkd_render_v2_multi_subnets_not_onlink(self):
        with mock.patch("cloudinit.net.get_interfaces_by_mac"):
            ns = self._parse_network_state_from_config(
                V2_CONFIG_MULTI_SUBNETS_NOT_ONLINK
            )
            renderer = networkd.Renderer()
            rendered_content = renderer._render_content(ns)

        assert (
            rendered_content["eth0"]
            == V2_CONFIG_MULTI_SUBNETS_NOT_ONLINK_RENDERED
        )

    def test_networkd_render_v1_multi_subnets_onlink(self):
        with mock.patch("cloudinit.net.get_interfaces_by_mac"):
            ns = self._parse_network_state_from_config(
                V1_CONFIG_MULTI_SUBNETS_ONLINK
            )
            renderer = networkd.Renderer()
            rendered_content = renderer._render_content(ns)

        assert (
            rendered_content["eth0"] == V1_CONFIG_MULTI_SUBNETS_ONLINK_RENDERED
        )

    def test_networkd_render_v2_multi_subnets_onlink(self):
        with mock.patch("cloudinit.net.get_interfaces_by_mac"):
            ns = self._parse_network_state_from_config(
                V2_CONFIG_MULTI_SUBNETS_ONLINK
            )
            renderer = networkd.Renderer()
            rendered_content = renderer._render_content(ns)

        assert (
            rendered_content["eth0"] == V2_CONFIG_MULTI_SUBNETS_ONLINK_RENDERED
        )

    @pytest.mark.parametrize("version", ["v1", "v2"])
    @pytest.mark.parametrize(
        "address", ["4", "6", "10.0.0.10/24", "2001:db8::1/64"]
    )
    @pytest.mark.parametrize("accept_ra", [True, False, None])
    def test_networkd_render_accept_ra(self, version, address, accept_ra):
        with mock.patch("cloudinit.net.get_interfaces_by_mac"):
            # network-config v1 inputs
            if version == "v1":
                config = yaml.safe_load(V1_CONFIG_ACCEPT_RA_YAML)
                if address == "4" or address == "6":
                    config["network"]["config"][0]["subnets"] = [
                        {"type": f"dhcp{address}"}
                    ]
                else:
                    config["network"]["config"][0]["subnets"] = [
                        {"type": "static", "address": address}
                    ]
                if accept_ra is not None:
                    config["network"]["config"][0]["accept-ra"] = accept_ra
            # network-config v2 inputs
            elif version == "v2":
                config = yaml.safe_load(V2_CONFIG_ACCEPT_RA_YAML)
                if address == "4" or address == "6":
                    config["network"]["ethernets"]["eth0"][
                        f"dhcp{address}"
                    ] = True
                else:
                    config["network"]["ethernets"]["eth0"]["addresses"] = [
                        address
                    ]
                if isinstance(accept_ra, bool):
                    config["network"]["ethernets"]["eth0"][
                        "accept-ra"
                    ] = accept_ra
            else:
                raise ValueError(f"Unknown network-config version: {version}")
            config = safeyaml.dumps(config)

            # render
            ns = self._parse_network_state_from_config(config)
            renderer = networkd.Renderer()
            rendered_content = renderer._render_content(ns)

        # dump the input/output for debugging test failures
        print(config)
        print(rendered_content["eth0"])

        # validate the rendered content
        c = ConfigParser()
        c.read_string(rendered_content["eth0"])

        if address in ["4", "6"]:
            expected_dhcp = f"ipv{address}"
            expected_address = None
        else:
            expected_dhcp = False
            expected_address = address
        try:
            got_dhcp = c.getboolean("Network", "DHCP")
        except ValueError:
            got_dhcp = c.get("Network", "DHCP", fallback=None)
        got_address = c.get("Address", "Address", fallback=None)
        got_accept_ra = c.getboolean("Network", "IPv6AcceptRA", fallback=None)
        assert (
            got_dhcp == expected_dhcp
        ), f"DHCP={got_dhcp}, expected {expected_dhcp}"
        assert (
            got_address == expected_address
        ), f"Address={got_address}, expected {expected_address}"
        assert (
            got_accept_ra == accept_ra
        ), f"IPv6AcceptRA={got_accept_ra}, expected {accept_ra}"