本文整理汇总了Python中dockertest.images.DockerImages.list_imgs_ids方法的典型用法代码示例。如果您正苦于以下问题:Python DockerImages.list_imgs_ids方法的具体用法?Python DockerImages.list_imgs_ids怎么用?Python DockerImages.list_imgs_ids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dockertest.images.DockerImages
的用法示例。
在下文中一共展示了DockerImages.list_imgs_ids方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: postprocess
# 需要导入模块: from dockertest.images import DockerImages [as 别名]
# 或者: from dockertest.images.DockerImages import list_imgs_ids [as 别名]
def postprocess(self):
# Raise exception on Go Panic or usage help message
outputgood = OutputGood(self.stuff['cmdresult'])
info_map = self._build_table(outputgood.stdout_strip)
# Verify some individual items
self.failif_ne(info_map['Storage Driver'].lower(), 'devicemapper',
'Storage Driver')
self.failif_ne(info_map['Data file'].lower(), '',
'Data file')
self.failif_ne(info_map['Metadata file'].lower(), '',
'Metadata file')
di = DockerImages(self)
# Make sure nothing is 'hidden'
di.images_args = "%s --all" % di.images_args
# Possible race-condition here...
img_set = set(di.list_imgs_ids()) # don't count multi-tags
# ...with this
img_cnt = int(info_map['Images'].lower())
self.failif_ne(len(img_set), img_cnt,
"More/less images %d than info reported %d"
% (len(img_set), img_cnt))
# verify value of elements
self.verify_pool_name(info_map['Pool Name'])
data_name = 'Data loop file'
metadata_name = 'Metadata loop file'
if data_name in info_map:
self.verify_sizes(info_map[data_name],
info_map['Data Space Used'],
info_map['Data Space Total'],
info_map[metadata_name],
info_map['Metadata Space Used'],
info_map['Metadata Space Total'])
else:
data_name = 'Data file'
metadata_name = 'Metadata file'
示例2: postprocess
# 需要导入模块: from dockertest.images import DockerImages [as 别名]
# 或者: from dockertest.images.DockerImages import list_imgs_ids [as 别名]
def postprocess(self):
super(info, self).postprocess()
info_table = self.stuff['dockerinfo']
# We support multiple storage drivers. Each one has a different
# set of key/value settings under 'info'; so each one has a
# dedicated helper method for validating.
driver_name = info_table.get('storage_driver')
self.failif(not driver_name, "'docker info' did not return"
" a value for 'Storage Driver'")
self.loginfo("Storage Driver = %s", driver_name)
try:
handler = getattr(self, '_postprocess_' + driver_name.lower())
except AttributeError:
raise DockerTestFail("Unknown storage driver: %s" % driver_name)
handler(info_table.get('storage_driver', {}))
# Count 'docker images', compare to the 'Images' info key.
# Yes, that's unreliable on a busy system. We're not on a busy system.
di = DockerImages(self)
di.images_args = "%s --all" % di.images_args
img_set = set(di.list_imgs_ids()) # don't count multi-tags
img_cnt = int(info_table.get('images'))
self.failif_ne(len(img_set), img_cnt,
"count of 'docker images' vs 'docker info'->Images")