'Creates a virtual partition, keeping record of the device created
under /dev/mapper (device attribute) so test writers can use it
on their filesystem tests.
:param file_img: Path to the desired disk image file.
:param file_size: Size of the desired image in Bytes.'

def __init__(self, file_img, file_size):

    logging.debug('Sanity    check    before    attempting    to    create    virtual    partition')
    try:
        os_dep.commands('sfdisk', 'losetup', 'kpartx')
    except ValueError as e:
        e_msg = ('Unable    to    create    virtual    partition:    %s' % e)
        raise error.AutotestError(e_msg)
    logging.debug('Creating    virtual    partition')
    self.img = self._create_disk_img(file_img, file_size)
    self.loop = self._attach_img_loop(self.img)
    self._create_single_partition(self.loop)
    self.device = self._create_entries_partition(self.loop)
    logging.debug('Virtual    partition    successfully    created')
    logging.debug('Image    disk:    %s', self.img)
    logging.debug('Loopback    device:    %s', self.loop)
    logging.debug('Device    path:    %s', self.device)
