~powersj/curtin/lxctest

« back to all changes in this revision

Viewing changes to examples/tests/network_source.yaml

curtin.net: emit source /etc/network/interfaces.d/*.cfg in eni

- Play nice with users and have eni source interfaces.d configurations.
- Fix up network unittests
  - Remove restriction in curtin's eni parser about iface redefinition;
    man (5) interfaces says this is allowed.
  - Update output of render_interfaces to account for source line
- Add vmtest to test user-defined network config in interfaces.d

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
network:
 
2
    version: 1
 
3
    config:
 
4
        # Physical interfaces.
 
5
        - type: physical
 
6
          name: eth0
 
7
          mac_address: "52:54:00:12:34:00"
 
8
          subnets:
 
9
              - type: dhcp4
 
10
        - type: physical
 
11
          name: eth1
 
12
          mtu: 1492
 
13
          mac_address: "52:54:00:12:34:02"
 
14
          subnets:
 
15
              - type: static
 
16
                address: 10.0.2.100/24
 
17
              - type: static
 
18
                address: 10.0.2.200/24
 
19
                dns_nameservers:
 
20
                  - 8.8.8.8
 
21
                dns_search:
 
22
                  - barley.maas
 
23
        - type: physical
 
24
          name: eth2
 
25
          mac_address: "52:54:00:12:34:04"
 
26
 
 
27
curthooks_commands:
 
28
    # use curtin to inject a eni config file outside of the network yaml
 
29
    # this allows us to test user installed configurations outside of
 
30
    # curtin's control
 
31
    aa_cleanup: ['curtin', 'in-target', '--', 'sh', '-c', "rm -f /etc/network/interfaces.d/eth0.cfg; /bin/echo -e 'auto eth2\niface eth2 inet static\n address 192.168.23.23/24\n' > /etc/network/interfaces.d/eth2.cfg"]