'Prepare a partition for running a test.  Unmounts any
filesystem that\'s currently mounted on the partition, makes a
new filesystem (according to this partition\'s filesystem
options) and mounts it where directed by mountpoint_func.
:param mountpoint_func: A callable that returns a path as a string,
given a partition instance.'

def setup_before_test(self, mountpoint_func):

    mountpoint = mountpoint_func(self)
    if (not mountpoint):
        raise ValueError("Don't    know    where    to    put    this    partition")
    self.unmount(ignore_status=True, record=False)
    self.mkfs()
    if (not os.path.isdir(mountpoint)):
        os.makedirs(mountpoint)
    self.mount(mountpoint)
