How to use _create_reset_and_force_delete_temp_snapshot method in tempest

Best Python code snippet using tempest_python

test_snapshots_actions.py

Source:test_snapshots_actions.py Github

copy

Full Screen

...35 snapshot_id = self.snapshot['id']36 self.admin_snapshots_client.reset_snapshot_status(snapshot_id,37 status)38 super(SnapshotsActionsV2Test, self).tearDown()39 def _create_reset_and_force_delete_temp_snapshot(self, status=None):40 # Create snapshot, reset snapshot status,41 # and force delete temp snapshot42 temp_snapshot = self.create_snapshot(volume_id=self.volume['id'])43 if status:44 self.admin_snapshots_client.\45 reset_snapshot_status(temp_snapshot['id'], status)46 self.admin_snapshots_client.\47 force_delete_snapshot(temp_snapshot['id'])48 self.snapshots_client.wait_for_resource_deletion(temp_snapshot['id'])49 def _get_progress_alias(self):50 return 'os-extended-snapshot-attributes:progress'51 @decorators.idempotent_id('3e13ca2f-48ea-49f3-ae1a-488e9180d535')52 def test_reset_snapshot_status(self):53 # Reset snapshot status to creating54 status = 'creating'55 self.admin_snapshots_client.\56 reset_snapshot_status(self.snapshot['id'], status)57 snapshot_get = self.admin_snapshots_client.show_snapshot(58 self.snapshot['id'])['snapshot']59 self.assertEqual(status, snapshot_get['status'])60 @decorators.idempotent_id('41288afd-d463-485e-8f6e-4eea159413eb')61 def test_update_snapshot_status(self):62 # Reset snapshot status to creating63 status = 'creating'64 self.admin_snapshots_client.\65 reset_snapshot_status(self.snapshot['id'], status)66 # Update snapshot status to error67 progress = '80%'68 status = 'error'69 progress_alias = self._get_progress_alias()70 self.snapshots_client.update_snapshot_status(self.snapshot['id'],71 status=status,72 progress=progress)73 snapshot_get = self.admin_snapshots_client.show_snapshot(74 self.snapshot['id'])['snapshot']75 self.assertEqual(status, snapshot_get['status'])76 self.assertEqual(progress, snapshot_get[progress_alias])77 @decorators.idempotent_id('05f711b6-e629-4895-8103-7ca069f2073a')78 def test_snapshot_force_delete_when_snapshot_is_creating(self):79 # test force delete when status of snapshot is creating80 self._create_reset_and_force_delete_temp_snapshot('creating')81 @decorators.idempotent_id('92ce8597-b992-43a1-8868-6316b22a969e')82 def test_snapshot_force_delete_when_snapshot_is_deleting(self):83 # test force delete when status of snapshot is deleting84 self._create_reset_and_force_delete_temp_snapshot('deleting')85 @decorators.idempotent_id('645a4a67-a1eb-4e8e-a547-600abac1525d')86 def test_snapshot_force_delete_when_snapshot_is_error(self):87 # test force delete when status of snapshot is error88 self._create_reset_and_force_delete_temp_snapshot('error')89 @decorators.idempotent_id('bf89080f-8129-465e-9327-b2f922666ba5')90 def test_snapshot_force_delete_when_snapshot_is_error_deleting(self):91 # test force delete when status of snapshot is error_deleting92 self._create_reset_and_force_delete_temp_snapshot('error_deleting')93class SnapshotsActionsV1Test(SnapshotsActionsV2Test):...

Full Screen

Full Screen

test_volume_snapshots_actions.py

Source:test_volume_snapshots_actions.py Github

copy

Full Screen

...40 snapshot_id = self.snapshot['id']41 self.admin_snapshots_client.reset_snapshot_status(snapshot_id,42 status)43 super(SnapshotsActionsV2Test, self).tearDown()44 def _create_reset_and_force_delete_temp_snapshot(self, status=None):45 # Create snapshot, reset snapshot status,46 # and force delete temp snapshot47 temp_snapshot = self.create_snapshot(volume_id=self.volume['id'])48 if status:49 self.admin_snapshots_client.\50 reset_snapshot_status(temp_snapshot['id'], status)51 self.admin_snapshots_client.\52 force_delete_snapshot(temp_snapshot['id'])53 self.client.wait_for_resource_deletion(temp_snapshot['id'])54 def _get_progress_alias(self):55 return 'os-extended-snapshot-attributes:progress'56 @test.idempotent_id('3e13ca2f-48ea-49f3-ae1a-488e9180d535')57 def test_reset_snapshot_status(self):58 # Reset snapshot status to creating59 status = 'creating'60 self.admin_snapshots_client.\61 reset_snapshot_status(self.snapshot['id'], status)62 snapshot_get = self.admin_snapshots_client.show_snapshot(63 self.snapshot['id'])['snapshot']64 self.assertEqual(status, snapshot_get['status'])65 @test.idempotent_id('41288afd-d463-485e-8f6e-4eea159413eb')66 def test_update_snapshot_status(self):67 # Reset snapshot status to creating68 status = 'creating'69 self.admin_snapshots_client.\70 reset_snapshot_status(self.snapshot['id'], status)71 # Update snapshot status to error72 progress = '80%'73 status = 'error'74 progress_alias = self._get_progress_alias()75 self.client.update_snapshot_status(self.snapshot['id'],76 status=status, progress=progress)77 snapshot_get = self.admin_snapshots_client.show_snapshot(78 self.snapshot['id'])['snapshot']79 self.assertEqual(status, snapshot_get['status'])80 self.assertEqual(progress, snapshot_get[progress_alias])81 @test.idempotent_id('05f711b6-e629-4895-8103-7ca069f2073a')82 def test_snapshot_force_delete_when_snapshot_is_creating(self):83 # test force delete when status of snapshot is creating84 self._create_reset_and_force_delete_temp_snapshot('creating')85 @test.idempotent_id('92ce8597-b992-43a1-8868-6316b22a969e')86 def test_snapshot_force_delete_when_snapshot_is_deleting(self):87 # test force delete when status of snapshot is deleting88 self._create_reset_and_force_delete_temp_snapshot('deleting')89 @test.idempotent_id('645a4a67-a1eb-4e8e-a547-600abac1525d')90 def test_snapshot_force_delete_when_snapshot_is_error(self):91 # test force delete when status of snapshot is error92 self._create_reset_and_force_delete_temp_snapshot('error')93 @test.idempotent_id('bf89080f-8129-465e-9327-b2f922666ba5')94 def test_snapshot_force_delete_when_snapshot_is_error_deleting(self):95 # test force delete when status of snapshot is error_deleting96 self._create_reset_and_force_delete_temp_snapshot('error_deleting')97#class SnapshotsActionsV1Test(SnapshotsActionsV2Test):...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful