Fixup package names for >= liberty, add unit tests
This commit is contained in:
parent
200e6fe388
commit
20ff2ce6e0
@ -250,6 +250,13 @@ def get_packages():
|
||||
packages.append('openswan')
|
||||
if source >= 'kilo':
|
||||
packages.append('python-neutron-fwaas')
|
||||
if source >= 'liberty':
|
||||
# Switch out mysql driver
|
||||
packages.remove('python-mysqldb')
|
||||
packages.append('python-pymysql')
|
||||
# Switch out to actual metering agent package
|
||||
packages.remove('neutron-plugin-metering-agent')
|
||||
packages.append('neutron-metering-agent')
|
||||
packages.extend(determine_l3ha_packages())
|
||||
|
||||
if git_install_requested():
|
||||
|
@ -162,7 +162,7 @@ class TestQuantumHooks(CharmTestCase):
|
||||
self.assertTrue(_amqp_joined.called)
|
||||
self.assertTrue(_amqp_nova_joined.called)
|
||||
self.assertTrue(_zmq_joined.called)
|
||||
self.create_sysctl.assert_called()
|
||||
self.assertTrue(self.create_sysctl.called)
|
||||
|
||||
@patch.object(hooks, 'git_install_requested')
|
||||
def test_config_changed_upgrade(self, git_requested):
|
||||
@ -235,7 +235,7 @@ class TestQuantumHooks(CharmTestCase):
|
||||
self.assertTrue(_amqp_joined.called)
|
||||
self.assertTrue(_amqp_nova_joined.called)
|
||||
self.assertTrue(_zmq_joined.called)
|
||||
self.create_sysctl.assert_called()
|
||||
self.assertTrue(self.create_sysctl.called)
|
||||
|
||||
def test_upgrade_charm(self):
|
||||
_install = self.patch('install')
|
||||
|
@ -158,6 +158,17 @@ class TestQuantumUtils(CharmTestCase):
|
||||
self.get_os_codename_install_source.return_value = 'kilo'
|
||||
self.assertTrue('python-neutron-fwaas' in neutron_utils.get_packages())
|
||||
|
||||
@patch.object(neutron_utils, 'git_install_requested')
|
||||
def test_get_packages_ovs_liberty(self, git_requested):
|
||||
git_requested.return_value = False
|
||||
self.config.return_value = 'ovs'
|
||||
self.get_os_codename_install_source.return_value = 'liberty'
|
||||
packages = neutron_utils.get_packages()
|
||||
self.assertTrue('neutron-metering-agent' in packages)
|
||||
self.assertFalse('neutron-plugin-metering-agent' in packages)
|
||||
self.assertFalse('python-mysqldb' in packages)
|
||||
self.assertTrue('python-pymysql' in packages)
|
||||
|
||||
@patch.object(neutron_utils, 'git_install_requested')
|
||||
def test_get_packages_l3ha(self, git_requested):
|
||||
git_requested.return_value = False
|
||||
|
Loading…
Reference in New Issue
Block a user