当前位置: 首页>>代码示例>>Python>>正文


Python DockerImages.images_args方法代码示例

本文整理汇总了Python中dockertest.images.DockerImages.images_args方法的典型用法代码示例。如果您正苦于以下问题:Python DockerImages.images_args方法的具体用法?Python DockerImages.images_args怎么用?Python DockerImages.images_args使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dockertest.images.DockerImages的用法示例。


在下文中一共展示了DockerImages.images_args方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: postprocess

# 需要导入模块: from dockertest.images import DockerImages [as 别名]
# 或者: from dockertest.images.DockerImages import images_args [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'
开发者ID:afomm,项目名称:autotest-docker,代码行数:37,代码来源:info.py

示例2: postprocess

# 需要导入模块: from dockertest.images import DockerImages [as 别名]
# 或者: from dockertest.images.DockerImages import images_args [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")
开发者ID:cevich,项目名称:autotest-docker,代码行数:27,代码来源:info.py


注:本文中的dockertest.images.DockerImages.images_args方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。