~curtin-dev/curtin/trunk

« back to all changes in this revision

Viewing changes to examples/tests/network_alias.yaml

  • Committer: Ryan Harper
  • Date: 2016-08-29 21:06:46 UTC
  • mfrom: (416.4.28 trunk.more-ipv6)
  • Revision ID: ryan.harper@canonical.com-20160829210646-1f9pv8r691iggedz
curtin/net: overhaul of eni rendering to handle mixed ipv4/ipv6 configs

To ensure complete ipv4/ipv6 support for advanced and stacked
configurations update how curtin.net renders /etc/network/interfaces for
different releases (precise -> yakkety). ifupdown has subtle issues with
various networking features and curtin needs to ensure consistent
behavior.

- Propery handle emitting the 'auto' control tag for stacked interfaces,
  like vlans over bonds
- Workaround LP:1609367 by rendering ifupdown hooks to handle the various
  cases. This works generically in all ubuntu releases 
- Add vmtests for mtu settings
- Drop the use of ipv4 alias interfaces (eth0:1, eth0:2) and instead just
  add additional e/n/i stanzas. ifupdown already uses iproute2's /sbin/ip
  which supports adding additional ip addresses to an interface without the
  use of the v4-only interface alias structure. This provides consistent
  behavior for all types of interfaces (physical, vlan, bonds, and stacked
  interfaces) across all releases. Two side-effects: 1) users can no longer
  `ifdown eth0:1` to remove a single ip address from an interface; if down
  eth0 will take _all_ ip addresses on that interface. 2) ifconfig output
  only shows *one* ipv4 address, so users will need to use /sbin/ip addr
  show <interface> to see all ip addresses assigned to an interface.
- Add vmtests for alias settings
- Restructure all of the common network testcases into a single class
  TestNetworkTestBaseAbs, all varients testing network inherit from this
  class and override only the config file and any special case test-cases
  and file collection
- Global replace of testcase use of 'with open' and instead use
  load_collect_file()
  - Fix falsepositive uefi and multipath test this replacement exposed.
- Add ip_a_to_dict parser for `/sbin/ip a` output
  - drop ifconfig_a parser

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
showtrace: true
 
2
network:
 
3
    version: 1
 
4
    config:
 
5
        # no-alias: single v4 and v6 on same interface
 
6
        - type: physical
 
7
          name: interface0
 
8
          mac_address: "52:54:00:12:34:00"
 
9
          subnets:
 
10
              - type: static
 
11
                address: 192.168.1.2/24
 
12
                mtu: 1501
 
13
              - type: static
 
14
                address: 2001:4800:78ff:1b:be76:4eff:fe06:ffac
 
15
                netmask: 'ffff:ffff:ffff:ffff::'
 
16
                mtu: 1480
 
17
        # multi_v4_alias: multiple v4 addrs on same interface
 
18
        - type: physical
 
19
          name: interface1
 
20
          mac_address: "52:54:00:12:34:02"
 
21
          subnets:
 
22
              - type: static
 
23
                address: 192.168.2.2/22
 
24
                routes:
 
25
                  - network: 192.168.0.0
 
26
                    netmask: 255.255.252.0
 
27
                    gateway: 192.168.2.1
 
28
              - type: static
 
29
                address: 10.23.23.7/23
 
30
                routes:
 
31
                  - gateway: 10.23.23.1
 
32
                    netmask: 255.255.254.0
 
33
                    network: 10.23.22.0
 
34
        # multi_v6_alias: multiple v6 addrs on same interface
 
35
        - type: physical
 
36
          name: interface2
 
37
          mac_address: "52:54:00:12:34:04"
 
38
          subnets:
 
39
              - type: static
 
40
                address: 2001:4800:78ff:1b:be76:4eff:dead:1000
 
41
                netmask: 'ffff:ffff:ffff:ffff::'
 
42
              - type: static
 
43
                address: 2001:4800:78ff:1b:be76:4eff:dead:2000
 
44
                netmask: 'ffff:ffff:ffff:ffff::'
 
45
              - type: static
 
46
                address: 2001:4800:78ff:1b:be76:4eff:dead:3000
 
47
                netmask: 'ffff:ffff:ffff:ffff::'
 
48
        # multi_v4_and_v6_alias: multiple v4 and v6 addrs on same interface
 
49
        - type: physical
 
50
          name: interface3
 
51
          mac_address: "52:54:00:12:34:06"
 
52
          subnets:
 
53
              - type: static
 
54
                address: 192.168.7.7/22
 
55
                routes:
 
56
                  - network: 192.168.0.0
 
57
                    netmask: 255.255.252.0
 
58
                    gateway: 192.168.7.1
 
59
              - type: static
 
60
                address: 10.99.99.23/23
 
61
                routes:
 
62
                  - gateway: 10.99.99.1
 
63
                    netmask: 255.255.254.0
 
64
                    network: 10.99.98.0
 
65
              - type: static
 
66
                address: 2001:4800:78ff:1b:be76:4eff:beef:4000
 
67
                netmask: 'ffff:ffff:ffff:ffff::'
 
68
              - type: static
 
69
                address: 2001:4800:78ff:1b:be76:4eff:beef:5000
 
70
                netmask: 'ffff:ffff:ffff:ffff::'
 
71
              - type: static
 
72
                address: 2001:4800:78ff:1b:be76:4eff:beef:6000
 
73
                netmask: 'ffff:ffff:ffff:ffff::'
 
74
        # multi_v6_and_v4_revorder_alias: multiple v4 and v6 addr, rev order
 
75
        - type: physical
 
76
          name: interface4
 
77
          mac_address: "52:54:00:12:34:08"
 
78
          subnets:
 
79
              - type: static
 
80
                address: 2001:4800:78ff:1b:be76:4eff:debe:7000
 
81
                netmask: 'ffff:ffff:ffff:ffff::'
 
82
              - type: static
 
83
                address: 2001:4800:78ff:1b:be76:4eff:debe:8000
 
84
                netmask: 'ffff:ffff:ffff:ffff::'
 
85
              - type: static
 
86
                address: 2001:4800:78ff:1b:be76:4eff:debe:9000
 
87
                netmask: 'ffff:ffff:ffff:ffff::'
 
88
              - type: static
 
89
                address: 192.168.100.100/22
 
90
                routes:
 
91
                  - network: 192.168.0.0
 
92
                    netmask: 255.255.252.0
 
93
                    gateway: 192.168.100.1
 
94
              - type: static
 
95
                address: 10.17.142.2/23
 
96
                routes:
 
97
                  - gateway: 10.17.142.1
 
98
                    netmask: 255.255.254.0
 
99
                    network: 10.17.142.0
 
100
        # multi_v6_and_v4_mix_order: multiple v4 and v6 addr, mixed order
 
101
        - type: physical
 
102
          name: interface5
 
103
          mac_address: "52:54:00:12:34:0a"
 
104
          subnets:
 
105
              - type: static
 
106
                address: 2001:4800:78ff:1b:be76:4eff:baaf:a000
 
107
                netmask: 'ffff:ffff:ffff:ffff::'
 
108
              - type: static
 
109
                address: 2001:4800:78ff:1b:be76:4eff:baaf:c000
 
110
                netmask: 'ffff:ffff:ffff:ffff::'
 
111
              - type: static
 
112
                address: 192.168.200.200/22
 
113
                routes:
 
114
                  - network: 192.168.0.0
 
115
                    netmask: 255.255.252.0
 
116
                    gateway: 192.168.200.1
 
117
              - type: static
 
118
                address: 10.252.2.2/23
 
119
                routes:
 
120
                  - gateway: 10.252.2.1
 
121
                    netmask: 255.255.254.0
 
122
                    network: 10.252.2.0
 
123
              - type: static
 
124
                address: 2001:4800:78ff:1b:be76:4eff:baaf:b000
 
125
                netmask: 'ffff:ffff:ffff:ffff::'