Esempio n. 1
0
def check_file_existence(pod_obj, file_path):
    """
    Check if file exists inside the pod

    Args:
        pod_obj (Pod): The object of the pod
        file_path (str): The full path of the file to look for inside
            the pod

    Returns:
        bool: True if the file exist, False otherwise
    """
    try:
        check_if_executable_in_path(pod_obj.exec_cmd_on_pod("which find"))
    except CommandFailed:
        pod_obj.install_packages("findutils")
    ret = pod_obj.exec_cmd_on_pod(f"bash -c \"find {file_path}\"")
    if re.search(file_path, ret):
        return True
    return False
Esempio n. 2
0
# mark the test class with marker below to ignore leftover check
ignore_leftovers = pytest.mark.ignore_leftovers

# testing marker this is just for testing purpose if you want to run some test
# under development, you can mark it with @run_this and run pytest -m run_this
run_this = pytest.mark.run_this

# Skipif marks
google_api_required = pytest.mark.skipif(
    not os.path.exists(os.path.expanduser(
        config.RUN['google_api_secret'])
    ), reason="Google API credentials don't exist"
)

noobaa_cli_required = pytest.mark.skipif(
    not check_if_executable_in_path('noobaa'),
    reason='MCG CLI was not found'
)

aws_platform_required = pytest.mark.skipif(
    config.ENV_DATA['platform'].lower() != 'aws',
    reason="Tests are not running on AWS deployed cluster"
)

# Filter warnings
filter_insecure_request_warning = pytest.mark.filterwarnings(
    'ignore::urllib3.exceptions.InsecureRequestWarning'
)

# here is the place to implement some plugins hooks which will process marks
# if some operation needs to be done for some specific marked tests.
Esempio n. 3
0
post_upgrade = compose(pytest.mark.post_upgrade, order_post_upgrade)

# mark the test class with marker below to ignore leftover check
ignore_leftovers = pytest.mark.ignore_leftovers

# testing marker this is just for testing purpose if you want to run some test
# under development, you can mark it with @run_this and run pytest -m run_this
run_this = pytest.mark.run_this

# Skipif marks
google_api_required = pytest.mark.skipif(
    not os.path.exists(os.path.expanduser(config.RUN['google_api_secret'])),
    reason="Google API credentials don't exist")

noobaa_cli_required = pytest.mark.skipif(
    not check_if_executable_in_path('noobaa'), reason='MCG CLI was not found')

aws_platform_required = pytest.mark.skipif(
    config.ENV_DATA['platform'].lower() != 'aws',
    reason="Tests are not running on AWS deployed cluster")

ipi_deployment_required = pytest.mark.skipif(
    config.ENV_DATA['deployment_type'].lower() != 'ipi',
    reason="Tests are not running on IPI deployed cluster")

# Filter warnings
filter_insecure_request_warning = pytest.mark.filterwarnings(
    'ignore::urllib3.exceptions.InsecureRequestWarning')

# here is the place to implement some plugins hooks which will process marks
# if some operation needs to be done for some specific marked tests.