~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

« back to all changes in this revision

Viewing changes to unit_tests/test_nova_cc_hooks.py

  • Committer: james.page at ubuntu
  • Date: 2015-01-13 15:18:39 UTC
  • mfrom: (123.5.5 nova-cloud-controller)
  • Revision ID: james.page@ubuntu.com-20150113151839-9p0rzcmg0upcl1m1
[james-page,r=gnuoy] Add fallback configuration options for vip cidr and iface for non-standard deployments

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
    'migrate_nova_database',
65
65
    'migrate_neutron_database',
66
66
    'uuid',
 
67
    'get_hacluster_config',
 
68
    'get_iface_for_address',
 
69
    'get_netmask_for_address',
67
70
    'update_nrpe_config',
68
71
]
69
72
 
607
610
            'Not running neutron database migration as migrations are handled'
608
611
            'by the neutron-server process.'
609
612
        )
 
613
 
 
614
    def test_ha_relation_joined_no_bound_ip(self):
 
615
        self.get_hacluster_config.return_value = {
 
616
            'ha-bindiface': 'em0',
 
617
            'ha-mcastport': '8080',
 
618
            'vip': '10.10.10.10',
 
619
        }
 
620
        self.test_config.set('vip_iface', 'eth120')
 
621
        self.test_config.set('vip_cidr', '21')
 
622
        self.get_iface_for_address.return_value = None
 
623
        self.get_netmask_for_address.return_value = None
 
624
        hooks.ha_joined()
 
625
        args = {
 
626
            'corosync_bindiface': 'em0',
 
627
            'corosync_mcastport': '8080',
 
628
            'init_services': {'res_nova_haproxy': 'haproxy'},
 
629
            'resources': {'res_nova_eth120_vip': 'ocf:heartbeat:IPaddr2',
 
630
                          'res_nova_haproxy': 'lsb:haproxy'},
 
631
            'resource_params': {
 
632
                'res_nova_eth120_vip': 'params ip="10.10.10.10"'
 
633
                ' cidr_netmask="21" nic="eth120"',
 
634
                'res_nova_haproxy': 'op monitor interval="5s"'},
 
635
            'clones': {'cl_nova_haproxy': 'res_nova_haproxy'}
 
636
        }
 
637
        self.relation_set.assert_has_calls([
 
638
            call(groups={'grp_nova_vips': 'res_nova_eth120_vip'}),
 
639
            call(**args),
 
640
        ])