~rvb/maas/release-notes-1.7-bis

« back to all changes in this revision

Viewing changes to src/provisioningserver/rpc/tests/test_osystems.py

  • Committer: MaaS Lander
  • Author(s): jtv at canonical
  • Date: 2014-10-10 12:41:33 UTC
  • mfrom: (3227.2.1 bug-1379641-pass-netmasks)
  • Revision ID: maas_lander-20141010124133-8sa90qp8obgcxpsf
[r=rvb,allenap][bug=1379641][author=jtv] Add parameter to generation of Curtin network preseeds: netmasks.  This is in support of non-64-bit IPv6 netmasks, but it also takes away an obstacle to static IPv4 configuration.

The new parameter is not yet used, nor is it populated.  I'm leaving that for separate branches because just the parameter-passing (esp. across RPC) generates so many boilerplate changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
 
206
206
    def make_args(self):
207
207
        mac = factory.make_mac_address()
 
208
        ipv4_net = factory.make_ipv4_network()
 
209
        ipv4_addr = factory.pick_ip_in_network(ipv4_net)
 
210
        ipv6_net = factory.make_ipv6_network()
 
211
        ipv6_addr = factory.pick_ip_in_network(ipv6_net)
208
212
        return {
209
213
            'interfaces': [(factory.make_name('eth'), mac)],
210
214
            'auto_interfaces': [mac],
211
 
            'ips_mapping': {
212
 
                mac: [
213
 
                    factory.make_ipv4_address(),
214
 
                    factory.make_ipv6_address(),
215
 
                    ],
216
 
                },
 
215
            'ips_mapping': {mac: [ipv4_addr, ipv6_addr]},
217
216
            'gateways_mapping': {
218
217
                mac: [
219
218
                    factory.make_ipv4_address(),
222
221
                },
223
222
            'disable_ipv4': factory.pick_bool(),
224
223
            'nameservers': [factory.make_ipv6_address()],
 
224
            'netmasks': {
 
225
                ipv4_addr: unicode(ipv4_net.netmask),
 
226
                ipv6_addr: unicode(ipv6_net.netmask),
 
227
                },
225
228
            }
226
229
 
227
230
    def test__forwards_to_OS_implementation(self):