예제 #1
0
 def _get_running_instance(self):
     instance_ref = test_utils.get_test_instance()
     network_info = test_utils.get_test_network_info()
     image_info = test_utils.get_test_image_info(None, instance_ref)
     self.connection.spawn(self.ctxt, instance=instance_ref,
                           image_meta=image_info,
                           network_info=network_info)
     return instance_ref, network_info
 def test_snapshot_not_running(self):
     instance_ref = test_utils.get_test_instance()
     img_ref = self.image_service.create(self.ctxt, {"name": "snap-1"})
     self.assertRaises(
         exception.InstanceNotRunning, self.connection.snapshot, self.ctxt, instance_ref, img_ref["id"]
     )
 def _get_running_instance(self):
     instance_ref = test_utils.get_test_instance()
     network_info = test_utils.get_test_network_info()
     image_info = test_utils.get_test_image_info(None, instance_ref)
     self.connection.spawn(self.ctxt, instance=instance_ref, image_meta=image_info, network_info=network_info)
     return instance_ref, network_info
 def test_unfilter_instance(self):
     instance_ref = test_utils.get_test_instance()
     network_info = test_utils.get_test_network_info()
     self.connection.unfilter_instance(instance_ref, network_info)
 def test_ensure_filtering_for_instance(self):
     instance_ref = test_utils.get_test_instance()
     network_info = test_utils.get_test_network_info()
     self.connection.ensure_filtering_rules_for_instance(instance_ref, network_info)
예제 #6
0
 def test_snapshot_not_running(self):
     instance_ref = test_utils.get_test_instance()
     img_ref = self.image_service.create(self.ctxt, {'name': 'snap-1'})
     self.assertRaises(exception.InstanceNotRunning,
                       self.connection.snapshot,
                       self.ctxt, instance_ref, img_ref['id'])
예제 #7
0
 def test_unfilter_instance(self):
     instance_ref = test_utils.get_test_instance()
     network_info = test_utils.get_test_network_info()
     self.connection.unfilter_instance(instance_ref, network_info)
예제 #8
0
 def test_ensure_filtering_for_instance(self):
     instance_ref = test_utils.get_test_instance()
     network_info = test_utils.get_test_network_info()
     self.connection.ensure_filtering_rules_for_instance(instance_ref,
                                                         network_info)
예제 #9
0
 def test_get_test_instance(self):
     """get_test_instance's return value looks like an instance_ref"""
     instance_ref = test_utils.get_test_instance()
     ctxt = test_utils.get_test_admin_context()
     db.instance_get(ctxt, instance_ref['id'])