We like to setup autotest to work with a client (most likely embedded systems) which has no build tools installed. The idea here is to pre-compile the test source code and then copy them onto the client. The pre-compile job is done by a new type of job. setup_job.

    """The setup job is a new type of job object.
    It is neither inherited from a server_job, nor from client_job. The server
    side job, which is the default job object inside the scope of a test control
    file, has no API to call test.setup() without some significant refactoring
    work, since calling test.setup() is a function of the client job class. But
    in order to simply instantiate a client job object, I need to prepare
    another client job control file, which is not an obvious design either. So I
    designed this setup_job class, which only provides minimum necessary
    functions to call test.setup().
    The setup_job class does not need any job control file at all.   
    """
Please see the attached PATCH file. util/unittest_suite.py and utils/run_pylint.py were all passed on the new file.

In order to utilize this function, a user should define a setup control file:

from autotest_lib.server import setup_job

setup_job.initialize(job)

# include all tests here.
tests=['bonnie',
           'compilebench',
           'dbench',
           'disktest',
           'fio',
           'iozone',
           'ltp',
           'unixbench']

for te in tests:
    setup_job.setup_test(te, job.resultdir) 


you should also create a site_job.py and site_autotest.py under server.

site_job.py is used to override require_gcc(), since there is no gcc on the client.

class site_job():
    def require_gcc(self):
        return False

SiteAutotest is used to disable calling tool/make_clean which would intend to erase all the prebuilt test executables under src.

class SiteAutotest(installable_object.InstallableObject):
    def get(self, location = None):
        if not location:
            location = os.path.join(self.serverdir, '../client')
            location = os.path.abspath(location)
        # If there's stuff run on our client directory already, it
        # can cause problems. Try giving it a quick clean first.
        installable_object.InstallableObject.get(self, location)
        self.got = True

Visibility: This change should have no impact to any existing autotest user or test for now.
Note:  This change did not resolve cross compilation issue of test while testing against an embedded system.


From: ericli@google.com



git-svn-id: http://test.kernel.org/svn/autotest/trunk@4066 592f7852-d20e-0410-864c-8624ca9c26a4
1 file changed