Exemplo n.º 1
0
 def test_reaper_action_get_by_instance_uuid(self):
     requested = 'fake-instance-uuid'
     uuid1 = 'fake-action-uuid1'
     uuid2 = 'fake-action-uuid2'
     utils.create_test_reaper_action(uuid=uuid1,
                                     requested_instances=[requested])
     utils.create_test_reaper_action(uuid=uuid2,
                                     requested_instances=[requested])
     results = ra.ReaperAction.get_by_instance_uuid(requested)
     result_uuids = [res.uuid for res in results]
     self.assertTrue(uuid1 in result_uuids)
     self.assertTrue(uuid2 in result_uuids)
     self.assertEqual(2, len(result_uuids))
Exemplo n.º 2
0
 def test_reaper_action_update(self):
     action = utils.create_test_reaper_action(state="ONGOING")
     values = {'state': "SUCCESS"}
     dbapi = db_api.get_instance()
     dbapi.update_reaper_action(action.uuid, values)
     new = ra.ReaperAction.get_by_uuid(action.uuid)
     self.assertEqual(ra.ActionState.SUCCESS, new.state)
Exemplo n.º 3
0
 def test_reaper_action_get_by_victim(self):
     victim = 'fake-victim-uuid'
     act = utils.create_test_reaper_action(victims=[victim])
     results = ra.ReaperAction.get_by_victim_uuid(victim)
     for result in results:
         self.assertEqual(act.uuid, result.uuid)
Exemplo n.º 4
0
 def test_reaper_action_get_by_uuid(self):
     uuid = 'fake-uuid'
     action = utils.create_test_reaper_action(uuid=uuid)
     new = ra.ReaperAction.get_by_uuid(uuid)
     self.assertEqual(action.uuid, new.uuid)
Exemplo n.º 5
0
 def test_create_reaper_action_duplicate(self):
     utils.create_test_reaper_action()
     self.assertRaises(exception.ReaperActionAlreadyExists,
                       utils.create_test_reaper_action)
Exemplo n.º 6
0
 def test_create_reaper_action_rebuild(self):
     utils.create_test_reaper_action(event="REBUILD_REQUEST")
Exemplo n.º 7
0
 def test_create_reaper_action_state_calculation(self):
     utils.create_test_reaper_action(event="STATE_CALCULATION")
Exemplo n.º 8
0
 def test_create_reaper_action(self):
     utils.create_test_reaper_action()