Kashyap & Venu | Updated Readme and test for snapshot

This commit is contained in:
VenuMurthy 2014-09-10 12:08:53 +05:30
parent be2724ef83
commit eb45e8536a
2 changed files with 33 additions and 0 deletions

View File

@ -31,5 +31,7 @@ Using the native OpenStack Dashboard or APIs you would be able to manage the EC2
The driver should now be loaded. The contents of the repository is mapped to `/opt/stack/nova/nova/virt/ec2/`, and you can edit it directly from your host computer with an IDE of your choice.
###Important notes
Suspend and resume In Amazons EC2 there is no concept of suspend and resume on instances. Therefore, we simply stop EC2 instances when suspended and start the instances when resumed and reusing the existing methods with tests.
##To Be Continued

View File

@ -145,7 +145,38 @@ class EC2DriverTest(unittest.TestCase):
dry_run=False, max_results=None)[0]
self.assertEqual(ec2_instance.instance_type, "t2.small")
# def test_snapshot(self):
#
# #Create an instance, which returns the instance
# instance = self.spawn_ec2_instance()
#
# #The AMI_Name of the instance is set to the instance id
# ami_image_name = instance.metadata['ec2_id']
#
# #Take a snapshot of the instance using Nova client on Openstack.
# openstack_image = self.nova.servers.create_image(instance, ami_image_name, metadata=None)
#
# #Check on EC2 if the instance has been snapshot
#
# # Get all images
# ami_images = self.ec2_conn.get_all_images()
#
# for image in ami_images:
#
# #Check the name of the image with the AMI_Name we set.
# if image.name == ami_image_name:
# self.assertEqual(image.name, ami_image_name)
#
# #Now tearing it down, deleting it from openStack and then in EC2
# image.deregister(delete_snapshot=True, dry_run=False)
# return
#
# #self.assertFalse(True)
#
def tearDown(self):
#TODo this doesn't seem to be tearing down all the instances we have created in parallel.
#Will need to destroy all the instances on OpenStack and EC2 created for testing
if self.server is not None:
print "Cleanup: Destroying the instance used for testing"
self.server.delete()