예제 #1
0
 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
0
 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'
예제 #3
0
    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")
예제 #4
0
    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")