def test_db_migrate(self, is_leader, check_call, db_sync_done):
     c = placement.PlacementCharm()
     is_leader.return_value = True
     db_sync_done.return_value = False
     result = c.db_migrate()
     check_call.assert_called_with([
         '/usr/share/placement/mysql-migrate-db.sh', '--migrate',
         '--skip-locks', '/etc/placement/migrate-db.rc'
     ])
Esempio n. 2
0
 def test_get_database_setup(self):
     c = placement.PlacementCharm()
     result = c.get_database_setup()
     self.assertEqual(result, [{'database': 'placement',
                                'username': '******',
                                'prefix': 'placement'},
                               {'database': 'nova_api',
                                'username': '******',
                                'prefix': 'novaapi'}])
 def test_enable_services(self, service_resume):
     c = placement.PlacementCharm()
     result = c.enable_services()
     service_resume.assert_has_calls([call('apache2'), call('haproxy')])
 def test_db_sync(self, leader_set, is_leader, check_call, db_sync_done):
     c = placement.PlacementCharm()
     is_leader.return_value = True
     db_sync_done.return_value = False
     result = c.db_sync()
     check_call.assert_called_with(['placement-manage', 'db', 'sync'])
Esempio n. 5
0
 def test_disable_services(self, service_pause):
     c = placement.PlacementCharm()
     c.disable_services()
     service_pause.assert_has_calls([call('apache2'), call('haproxy')])