Beispiel #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
Beispiel #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())
Beispiel #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)
Beispiel #4
0
def service_name():
    service_name = 'ebnt-test-service'
    yield service_name
    rm_container(service_name)
    rm_image(service_name + ":latest")
Beispiel #5
0
def container_name():
    container_name = "ebaklya"
    yield container_name
    rm_container(container_name)
Beispiel #6
0
def container_name():
    container_name = f"ebontie-test-flask-image-{int(time.time() * 1000)}"
    yield container_name
    rm_container(container_name)