예제 #1
0
 def _main_group(self, policies=None, members=None, **values):
     vals = {
         'user_id': self.context.user_id,
         'project_id': self.context.project_id,
         'name': 'foogroup',
     }
     vals.update(values)
     policies = policies or ['foo1', 'foo2']
     members = members or ['memberfoo']
     return db_api.instance_group_create(self.context, vals,
                                         policies=policies,
                                         members=members)
예제 #2
0
 def test_upgrade_with_deleted_instance_groups(self):
     group = db_api.instance_group_create(self.context, self.ig_values)
     db_api.instance_group_delete(self.context, group['uuid'])
     self.migration.upgrade(self.engine)
예제 #3
0
 def test_upgrade_dirty_instance_groups(self):
     db_api.instance_group_create(self.context, self.ig_values)
     self.assertRaises(exception.ValidationError, self.migration.upgrade,
                       self.engine)
예제 #4
0
 def test_upgrade_with_deleted_instance_groups(self):
     group = db_api.instance_group_create(self.context, self.ig_values)
     db_api.instance_group_delete(self.context, group['uuid'])
     self.migration.upgrade(self.engine)
예제 #5
0
 def test_upgrade_dirty_instance_groups(self):
     db_api.instance_group_create(self.context, self.ig_values)
     self.assertRaises(exception.ValidationError,
                       self.migration.upgrade, self.engine)