~openstack-charmers-next/charms/vivid/nova-compute/trunk

« back to all changes in this revision

Viewing changes to unit_tests/test_nova_compute_contexts.py

  • Committer: James Page
  • Date: 2016-04-08 10:06:51 UTC
  • Revision ID: james.page@ubuntu.com-20160408100651-t18z7xdyuue1w1m4
Drop support for legacy Neutron management

The nova-compute charm originally managed the Neutron services
and configuration files for the hypervisor units; this has be
devolved into subordinate charms such as neutron-openvswitch
providing a nicer separation between Nova and Neutron.

Drop remaining legacy Neutron support from this charm as it was
deprecated for removal last cycle.

Change-Id: If3bd62d169c8e8804570c75e7311bf005c13683a

Show diffs side-by-side

added added

removed removed

Lines of Context:
168
168
        self._save_flag_file.assert_called_with(
169
169
            path='/etc/nova/nm.conf', data='neutron')
170
170
 
171
 
    @patch.object(context.NeutronComputeContext, 'network_manager')
172
 
    @patch.object(context.NeutronComputeContext, 'plugin')
 
171
    @patch.object(context, '_network_manager')
 
172
    @patch.object(context, '_neutron_plugin')
173
173
    def test_neutron_plugin_context_no_setting(self, plugin, nm):
174
174
        plugin.return_value = None
 
175
        nm.return_Value = None
175
176
        qplugin = context.NeutronComputeContext()
176
 
        with patch.object(qplugin, '_ensure_packages'):
177
 
            self.assertEquals({}, qplugin())
 
177
        self.assertEquals({}, qplugin())
178
178
 
179
179
    def test_libvirt_bin_context_no_migration(self):
180
180
        self.kv.return_value = FakeUnitdata(**{'host_uuid': self.host_uuid})
244
244
        libvirt = context.NovaComputeLibvirtContext()
245
245
        self.assertFalse('cpu-mode' in libvirt())
246
246
 
247
 
    @patch.object(context.NeutronComputeContext, 'network_manager')
248
 
    @patch.object(context.NeutronComputeContext, 'plugin')
249
 
    def test_disable_security_groups_true(self, plugin, nm):
250
 
        plugin.return_value = "ovs"
251
 
        nm.return_value = "neutron"
252
 
        self.test_config.set('disable-neutron-security-groups', True)
253
 
        qplugin = context.NeutronComputeContext()
254
 
        with patch.object(qplugin, '_ensure_packages'):
255
 
            self.assertEquals({'disable_neutron_security_groups': True},
256
 
                              qplugin())
257
 
        self.test_config.set('disable-neutron-security-groups', False)
258
 
        qplugin = context.NeutronComputeContext()
259
 
        with patch.object(qplugin, '_ensure_packages'):
260
 
            self.assertEquals({}, qplugin())
261
 
 
262
247
    @patch('subprocess.call')
263
248
    def test_host_IP_context(self, _call):
264
249
        self.log = fake_log