示例#1
0
文件: fio.py 项目: ypersky1980/ocs-ci
def setup(**kwargs):
    """
    setup fio workload

    Args:
        **kwargs (dict): fio setup configuration.
            At this point in time only argument present in kwargs will be
            'pod' on which we want to setup. In future if we move to
            containerized fio then pod.yaml will be presented in kwargs.

    Returns:
        bool: True if setup succeeds else False
    """
    io_pod = kwargs["pod"]
    # For first cut doing simple fio install
    distro = find_distro(io_pod)
    pkg_mgr = DISTROS[distro]

    if distro == "Debian":
        cmd = f"{pkg_mgr} update"
        io_pod.exec_cmd_on_pod(cmd, out_yaml_format=False)
        log.info(
            "Sleep 5 seconds after update to make sure the lock is released")
        sleep(5)

    cmd = f"{pkg_mgr} -y install fio"
    return io_pod.exec_cmd_on_pod(cmd, out_yaml_format=False)
示例#2
0
文件: jenkins.py 项目: yosibsh/ocs-ci
def setup(**kwargs):
    """
    setup git workload

    Args:
        **kwargs (dict): git setup configuration.
            The only argument present in kwargs is 'pod' on which we
            want to setup

    Returns:
        bool: True if setup succeeds else False
    """
    io_pod = kwargs["pod"]
    # For first cut doing simple fio install
    distro = find_distro(io_pod)
    pkg_mgr = DISTROS[distro]

    if distro == "Debian":
        cmd = f"{pkg_mgr} update"
        io_pod.exec_cmd_on_pod(cmd, out_yaml_format=False)

    if distro == "Alpine":
        cmd = "{pkg_mgr} add git"
    else:
        cmd = f"{pkg_mgr} -y install git"
    return io_pod.exec_cmd_on_pod(cmd, out_yaml_format=False)
示例#3
0
def setup(**kwargs):
    """
    setup fio workload

    Args:
        **kwargs (dict): fio setup configuration.
            At this point in time only argument present in kwargs will be
            'pod' on which we want to setup. In future if we move to
            containerized fio then pod.yaml will be presented in kwargs.

    Returns:
        bool: True if setup succeeds else False
    """
    io_pod = kwargs['pod']
    # For first cut doing simple fio install
    distro = find_distro(io_pod)
    pkg_mgr = DISTROS[distro]

    if distro == 'Debian':
        cmd = f'{pkg_mgr} update'
        io_pod.exec_cmd_on_pod(cmd, out_yaml_format=False)

    cmd = f"{pkg_mgr} -y install fio"
    return io_pod.exec_cmd_on_pod(cmd, out_yaml_format=False)