|
| 1 | +# This is a network configuration data that is used to validate that the |
| 2 | +# configuration can be applied automatically when the device boots. |
| 3 | +# |
| 4 | +# In this test, we have multiple devices and network interface. The test |
| 5 | +# enables the network config library, it reads the configuration when the |
| 6 | +# device boots, and then the test checks that the configuration is applied |
| 7 | +# correctly to the network stack. |
| 8 | +# |
| 9 | +# Some of the network interfaces are dummy ones and some Ethernet ones. |
| 10 | +# The Ethernet devices are needed to validate the VLAN configuration. |
| 11 | +# The virtual interface is used to verity that it can be bound to some |
| 12 | +# other network interface. |
| 13 | +# |
| 14 | +net_init_config: |
| 15 | + network_interfaces: |
| 16 | + # First Ethernet interface in the system. We change its name in the |
| 17 | + # testing process. |
| 18 | + - &main-interface |
| 19 | + name: eth0 |
| 20 | + set_name: test-eth0 |
| 21 | + set_default: true |
| 22 | + ipv6: |
| 23 | + status: true |
| 24 | + ipv6_addresses: |
| 25 | + - 2001:db8:110::1 |
| 26 | + ipv6_multicast_addresses: |
| 27 | + - ff05::114 |
| 28 | + - ff15::115 |
| 29 | + prefixes: |
| 30 | + - address: "2001:db8::" |
| 31 | + len: 64 |
| 32 | + lifetime: 1024 |
| 33 | + hop_limit: 48 |
| 34 | + multicast_hop_limit: 2 |
| 35 | + dhcpv6: |
| 36 | + status: true |
| 37 | + do_request_address: true |
| 38 | + do_request_prefix: false |
| 39 | + ipv4: |
| 40 | + status: true |
| 41 | + ipv4_addresses: |
| 42 | + - 192.0.2.10/24 |
| 43 | + ipv4_multicast_addresses: |
| 44 | + - 234.0.0.10 |
| 45 | + gateway: 192.0.2.1 |
| 46 | + time_to_live: 128 |
| 47 | + multicast_time_to_live: 3 |
| 48 | + dhcpv4_enabled: true |
| 49 | + ipv4_autoconf_enabled: true |
| 50 | + |
| 51 | + # For this interface we do not know its name, but we know what device |
| 52 | + # it is bound to. |
| 53 | + - &device-interface |
| 54 | + device_name: eth_2 |
| 55 | + set_name: test-eth1 |
| 56 | + flags: |
| 57 | + - NET_IF_NO_AUTO_START |
| 58 | + - NET_IF_PROMISC |
| 59 | + ipv4: |
| 60 | + status: true |
| 61 | + ipv4_addresses: |
| 62 | + - 192.0.2.22/24 |
| 63 | + gateway: 192.0.2.2 |
| 64 | + time_to_live: 10 |
| 65 | + multicast_time_to_live: 1 |
| 66 | + dhcpv4_enabled: false |
| 67 | + dhcpv4_server: |
| 68 | + status: true |
| 69 | + base_address: 192.0.2.32 |
| 70 | + |
| 71 | + # This virtual interface bound to the first one |
| 72 | + - name: virt0 |
| 73 | + bind_to: *main-interface |
| 74 | + flags: |
| 75 | + - NET_IF_IPV6_NO_MLD |
| 76 | + - NET_IF_NO_AUTO_START |
| 77 | + - ^NET_IF_PROMISC |
| 78 | + ipv6: |
| 79 | + status: true |
| 80 | + ipv6_addresses: |
| 81 | + - 2001:db8:111::2 |
| 82 | + ipv4: |
| 83 | + status: false |
| 84 | + |
| 85 | + # This VLAN interface that attaches to second Ethernet interface |
| 86 | + - &vlan-interface |
| 87 | + set_name: vlan0 |
| 88 | + bind_to: *device-interface |
| 89 | + vlan: |
| 90 | + status: true |
| 91 | + tag: 2432 |
| 92 | + ipv4: |
| 93 | + status: true |
| 94 | + dhcpv4_enabled: true |
| 95 | + |
| 96 | + # This 2nd VLAN interface is attached to one of the Ethernet interfaces |
| 97 | + - set_name: vlan1 |
| 98 | + bind_to: *main-interface |
| 99 | + vlan: |
| 100 | + status: true |
| 101 | + tag: 1234 |
| 102 | + ipv4: |
| 103 | + status: true |
| 104 | + dhcpv4_enabled: true |
| 105 | + |
| 106 | + # This virtual interface bound to the VLAN interface |
| 107 | + - name: virt1 |
| 108 | + set_name: virt-over-vlan |
| 109 | + bind_to: *vlan-interface |
| 110 | + ipv6: |
| 111 | + status: true |
| 112 | + ipv6_addresses: |
| 113 | + - 2001:db8:abcd::11 |
| 114 | + |
| 115 | + # This interface IPv4 configuration is set to disabled |
| 116 | + # in which case its IPv4 configuration is skipped |
| 117 | + - name: dummy0 |
| 118 | + ipv6: |
| 119 | + status: true |
| 120 | + ipv4: |
| 121 | + status: false |
| 122 | + ipv4_addresses: |
| 123 | + - 192.2.0.2 |
| 124 | + gateway: 192.2.0.1 |
| 125 | + time_to_live: 10 |
| 126 | + multicast_time_to_live: 2 |
| 127 | + |
| 128 | + # This interface IPv4 and IPv6 configuration are both disabled. |
| 129 | + # Basically the interface is non functional for IP connectivity. |
| 130 | + - name: dummy1 |
| 131 | + ipv6: |
| 132 | + status: false |
| 133 | + ipv4: |
| 134 | + status: false |
| 135 | + |
| 136 | + ieee_802_15_4: |
| 137 | + status: true |
| 138 | + pan_id: 0xabcd |
| 139 | + channel: 26 |
| 140 | + tx_power: 1 |
| 141 | + security_key: [0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, |
| 142 | + 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf] |
| 143 | + security_key_mode: 0 |
| 144 | + security_level: 1 |
| 145 | + ack_required: true |
| 146 | + bind_to: *device-interface |
| 147 | + |
| 148 | + sntp: |
| 149 | + server: sntp.foo.bar |
| 150 | + timeout: 30 |
| 151 | + bind_to: *vlan-interface |
0 commit comments