How to use delete_image method in tempest

Best Python code snippet using tempest_python

test_project_admin_tests.py

Source:test_project_admin_tests.py Github

copy

Full Screen

...327 self.addCleanup(self.admin_images_client.delete_image, image['id'])328 self.do_request('show_image_file', expected_status=204,329 image_id=image['id'])330 @decorators.idempotent_id('e45899d6-7e16-4cbf-b800-31c05e6caf8c')331 def test_delete_image(self):332 image = self.admin_images_client.create_image(333 **self.image(visibility='private'))334 # FIXME: This should eventually respect tenancy when glance supports335 # system-scope and fail with an appropriate error (e.g., 404)336 self.do_request('delete_image', expected_status=204,337 image_id=image['id'])338 project_client = self.setup_user_client()339 image = project_client.image_client_v2.create_image(340 **self.image(visibility='private'))341 # FIXME: This should eventually respect tenancy when glance supports342 # system-scope and fail with an appropriate error (e.g., 404)343 self.do_request('delete_image', expected_status=204,344 image_id=image['id'])345 image = self.client.create_image(...

Full Screen

Full Screen

test_project_reader_tests.py

Source:test_project_reader_tests.py Github

copy

Full Screen

...215 self.do_request('show_image_file',216 expected_status=exceptions.Forbidden,217 image_id=image['id'])218 @decorators.idempotent_id('e8c3382c-c547-49c1-a92e-fa1d6378d4df')219 def test_delete_image(self):220 # Project readers can't delete images outside their project. This is221 # returned as an HTTP 404 instead of an HTTP 403 because they can't222 # find the image they're trying to delete.223 project_client = self.setup_user_client()224 image = project_client.image_client_v2.create_image(225 **self.image(visibility='private'))226 self.addCleanup(self.admin_images_client.delete_image, image['id'])227 self.do_request('delete_image', expected_status=exceptions.NotFound,228 image_id=image['id'])229 image = project_client.image_client_v2.create_image(230 **self.image(visibility='shared'))231 self.addCleanup(self.admin_images_client.delete_image, image['id'])232 self.do_request('delete_image', expected_status=exceptions.NotFound,233 image_id=image['id'])...

Full Screen

Full Screen

docker_registry_clean.py

Source:docker_registry_clean.py Github

copy

Full Screen

1# /usr/bin/python2# -*- coding: utf-8 -*-3# __author__ = 'Kuhn'4# company = 'Asiainfo'5# qq:1704780636import os,sys,shutil,re7import json8from delete_image import Nodes9from delete_image import Metadata10from delete_image import Delete_image11def usage():12 print "Usage:"13 print " python delete-image.py {registry_path} {image_name:image_tag}"14if __name__ == '__main__':15 if len(sys.argv) == 3 :16 registry_path = sys.argv[1]17 if re.search(':',sys.argv[2]) == None: #清理指定镜像内的无用层18 image_name = sys.argv[2].split(':')[0]19 nodes_J = Nodes(registry_path)20 nodes = nodes_J.nodes()21 #删除指定的镜像tag22 delete_image = Delete_image(registry_path,image_name,nodes)23 delete_image.clean_run()24 else: #删除指定镜像指定tag25 image_name = sys.argv[2].split(':')[0]26 image_tag = sys.argv[2].split(':')[1]27 nodes_J = Nodes(registry_path)28 nodes = nodes_J.nodes()29 #删除指定的镜像tag30 delete_image = Delete_image(registry_path,image_name,nodes,image_tag)31 delete_image.run()32 else:33 usage()...

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