Example #1
0
def container_name():
    name = "{}-{}".format(CONTAINER_NAME, int(time.time() * 1000))
    yield name

    if not CLEAR:
        return

    rm_container(name)
    rm_image(name + ":latest")  # FIXME later
Example #2
0
def runner():
    args = []

    def _runner(host: TargetHost, img: DockerImage, container_name: str):
        args.append((host, img, container_name))
        return SimpleDockerRunner()

    yield _runner

    for h, i, c in args:
        rm_container(c, h.get_host())
        rm_image(i.get_image_uri, h.get_host())
Example #3
0
def runner(pytestconfig):
    if not has_docker() or 'not docker' in pytestconfig.getoption('markexpr'):
        pytest.skip('skipping docker tests')
    args = []

    def _runner(host: str, img: DockerImage, container_name: str):
        args.append((host, img, container_name))
        return DockerRunner()

    yield _runner

    for h, i, c in args:
        rm_container(c, h)
        rm_image(i.get_uri(), h)
Example #4
0
def service_name():
    service_name = 'ebnt-test-service'
    yield service_name
    rm_container(service_name)
    rm_image(service_name + ":latest")
Example #5
0
def img_name():
    img_name = "helper-test-image"
    with use_local_installation():
        yield img_name

    rm_image(img_name + ":latest")  # FIXME later