'Check out the list.
This function is aim at check out whether all of the volumes in
expected_list are in fetched_list.'

def assertVolumesIn(self, fetched_list, expected_list, fields=None):

    if fields:
        fieldsgetter = operator.itemgetter(*fields)
        expected_list = map(fieldsgetter, expected_list)
        fetched_list = [fieldsgetter(item) for item in fetched_list]
    missing_vols = [v for v in expected_list if (v not in fetched_list)]
    if (not missing_vols):
        return
    def str_vol(vol):
        return ('%s:%s' % (vol['id'], vol[self.name]))
    raw_msg = 'Could    not    find    volumes    %s    in    expected    list    %s;    fetched    %s'
    self.fail((raw_msg % ([str_vol(v) for v in missing_vols], [str_vol(v) for v in expected_list], [str_vol(v) for v in fetched_list])))
