'Tasks are really just:
# yum install $TEST
# cd /mnt/tests/$TEST
# make run
Convert that into a test module with a control file'

def convert_task_to_control(self, fetchdir, control, task):

    timeout = ''
    if task.timeout:
        timeout = (',    timeout=%s' % task.timeout)
    rpm_name = self.get_test_name(task)
    rpm_dir = ((fetchdir + '/') + rpm_name)
    rpm_file = (((rpm_dir + '/') + rpm_name) + '.py')
    if ((task.status == 'Completed') and (not self.offline)):
        logging.debug(('SKIP    Completed    test    %s' % rpm_name))
        return
    if ((task.status == 'Running') and (not self.offline)):
        if re.search('reservesys', task.rpmName):
            logging.debug('Found    reservesys,    skipping    execution')
            raise HarnessException('executing    under    a    reservesys')
        else:
            logging.warning(("Found    Running    test    %s    that    isn't    reservesys" % task.rpmName))
    logging.debug(('adding    test    %s    to    control    file' % rpm_name))
    control.write(("os.environ['BEAKER_TASK_ID']='%s'\n" % task.id))
    control.write(("job.run_test('%s'%s)\n" % (rpm_name, timeout)))
    logging.debug(('setting    up    test    %s' % rpm_file))
    if (not os.path.exists(rpm_dir)):
        os.mkdir(rpm_dir)
    test = open(rpm_file, 'w')
    test.write('import    os\n')
    test.write('from    autotest.client    import    test,    utils\n\n')
    test.write(('class    %s(test.test):\n' % rpm_name))
    test.write('                version=1\n\n')
    test.write('                def    initialize(self):\n')
    test.write(("                                utils.system('yum    install    -y    %s')\n" % task.rpmName))
    for param in task.params:
        test.write(("                                os.environ['%s']='%s'\n" % (param, task.params[param])))
    test.write('                def    run_once(self):\n')
    test.write(("                                os.chdir('%s')\n" % task.rpmPath))
    test.write("                                raw_output    =    utils.system_output('make    run',    retain_output=True)\n")
    test.write('                                self.results    =    raw_output\n')
    test.close()
