Exemple #1
0
def compile(name, localdir=None, remotedir=None):
    """
    Compiles the given test case on all the hosts in the system.

    The building details and the respect of the convention are enforced by the
    Makefile and not further explained here.
    """
    # Read the defaults from the settings if the arguments are not provided
    if not localdir or not remotedir:
        paths = settings.PATHS['test-cases']

        if not localdir:
            localdir = paths[0]

        if not remotedir:
            remotedir = paths[1]

    local = os.path.join(localdir, name)
    remote = os.path.join(remotedir, name)

    shell.local('rm -f {0}/build/obj.map'.format(local))

    base = os.path.dirname(settings.PATHS['configuration'][1])

    with shell.workon(all_hosts()):
        with shell.cd(remote):
            shell.remote('ENV_BASE={0} make -e clean'.format(base))
            shell.remote('ENV_BASE={0} make -e build'.format(base))
Exemple #2
0
def execute(name, remotedir=None):
    """
    Executes the given test case on all client hosts (normally onle one).
    """
    if not remotedir:
        remotedir = settings.PATHS['test-cases'][1]

    remote = os.path.join(remotedir, name)

    base = os.path.dirname(settings.PATHS['configuration'][1])

    with shell.workon(role('client')):
        with shell.cd(remote):
            shell.remote('ENV_BASE={0} make -e execute'.format(base))