~gandelman-a/ubuntu/precise/nova/UCA_2012.2.1

« back to all changes in this revision

Viewing changes to nova/tests/test_instance_types.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman
  • Date: 2012-06-22 12:39:57 UTC
  • mfrom: (1.1.57)
  • Revision ID: package-import@ubuntu.com-20120622123957-hbzwg84nt9rqwg8r
Tags: 2012.2~f2~20120621.14517-0ubuntu1
[ Chuck Short ]
* New upstream version.

[ Adam Gandelman ]
* debian/rules: Temporarily disable test suite while blocking
  tests are investigated. 
* debian/patches/kombu_tests_timeout.patch: Dropped.

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
        self.assertEqual(inst_type_name, inst_type["name"])
212
212
 
213
213
        # NOTE(jk0): The deleted flavor will show up here because the context
214
 
        # in get_instance_type_by_flavor_id() is set to use read_deleted.
 
214
        # in get_instance_type_by_flavor_id() is set to use read_deleted by
 
215
        # default.
215
216
        instance_types.destroy(inst_type["name"])
216
217
        deleted_inst_type = instance_types.get_instance_type_by_flavor_id(
217
218
                inst_type_flavor_id)
218
219
        self.assertEqual(inst_type_name, deleted_inst_type["name"])
219
220
 
 
221
    def test_read_deleted_false_converting_flavorid(self):
 
222
        """
 
223
        Ensure deleted instance types are not returned when not needed (for
 
224
        example when creating a server and attempting to translate from
 
225
        flavorid to instance_type_id.
 
226
        """
 
227
        instance_types.create("instance_type1", 256, 1, 120, 100, "test1")
 
228
        instance_types.destroy("instance_type1")
 
229
        instance_types.create("instance_type1_redo", 256, 1, 120, 100, "test1")
 
230
 
 
231
        instance_type = instance_types.get_instance_type_by_flavor_id(
 
232
                "test1", read_deleted="no")
 
233
        self.assertEqual("instance_type1_redo", instance_type["name"])
 
234
 
220
235
    def test_will_list_deleted_type_for_active_instance(self):
221
236
        """Ensure deleted instance types with active instances can be read"""
222
237
        ctxt = context.get_admin_context()