def setUp(self): self.user = None self.alarm_definition_id = None self.notification_id = None self.token = get_token_from_env() self.mock_moncli = MagicMock(spec=msclient.Client)
def test_hypervisor_stats(self): self.token = get_token_from_env() reply = self.nova_operation('hypervisor-stats') self.assertEqual(api.COMPLETE, reply[api.STATUS]) self.assertIn('total', reply[api.DATA]) self.assertIn('used', reply[api.DATA])
def test_service_list(self): self.token = get_token_from_env() reply = self.nova_operation('service-list') self.assertEqual(api.COMPLETE, reply[api.STATUS]) self.assertIn('total', reply[api.DATA]) self.assertIn('ok', reply[api.DATA]) self.assertIn('error', reply[api.DATA])
def test_servers_list(self): self.token = get_token_from_env() end_date = date.today() start_date = end_date + timedelta(-1) reply = self.nova_operation('servers-list', { 'start_date': start_date.isoformat(), 'end_date': end_date.isoformat(), }) self.assertEqual(api.COMPLETE, reply[api.STATUS]) self.assertIn('created', reply[api.DATA]) self.assertIn('deleted', reply[api.DATA])
def test_get_regions(self): token = get_token_from_env() request = { 'target': 'catalog', 'data': { 'operation': 'get_regions' }, 'auth_token': token } catalog_service = CatalogSvc(bll_request=BllRequest(request)) reply = catalog_service.handle() self.assertEqual('complete', reply[api.STATUS]) regions = reply[api.DATA] self.assertGreater(len(regions), 0) self.assertEqual('region1', regions[0]['id'])
def test_get_real_plugins(self): token = get_token_from_env() request = { 'target': 'catalog', 'data': { 'operation': 'get_plugins' }, 'auth_token': token } catalog_service = CatalogSvc(bll_request=BllRequest(request)) reply = catalog_service.handle() self.assertEqual('complete', reply[api.STATUS]) plugins = reply[api.DATA] # print plugins self.assertIn('general', plugins) self.assertNotIn('unavailable', plugins)
def test_get_services(self): token = get_token_from_env() request = { 'target': 'catalog', 'data': { 'operation': 'get_services' }, 'auth_token': token } catalog_service = CatalogSvc(bll_request=BllRequest(request)) reply = catalog_service.handle() self.assertEqual('complete', reply[api.STATUS]) services = reply[api.DATA] self.assertGreater(len(services), 2) self.assertIn('identity', services) self.assertIn('keystone', services) self.assertIn('monitoring', services)
def setUp(self): self.user = None self.token = get_token_from_env()
def test_instance_list(self): self.token = get_token_from_env() reply = self.nova_operation('instance-list') self.assertEqual(api.COMPLETE, reply[api.STATUS]) self.assertIn('instances', reply[api.DATA])
def setUp(self): self.token = get_token_from_env()