Exemple #1
0
def test_run_local_image_name_that_will_never_exist(runner):
    img_registry = DefaultDockerRegistry()
    img = DockerImage('ebonite_image_name_that_will_never_exist',
                      registry=img_registry)

    with pytest.raises(HTTPError):
        _check_runner(runner, img)
Exemple #2
0
def test_run_local_fail_inside_container(runner, registry, detach):
    img = DockerImage(BROKEN_IMAGE_NAME,
                      repository=REPOSITORY_NAME,
                      registry=registry)

    with pytest.raises(DockerRunnerException):
        _check_runner(runner, img, detach=detach, rm=True)
Exemple #3
0
def run_good_attached():
    container_name = 'test'

    img_registry = DefaultDockerRegistry()
    img = DockerImage('mike0sv/ebaklya', registry=img_registry)
    instance = DockerContainer(container_name, ports_mapping={80: 8080})
    host = DockerHost()

    runner = DockerRunner()
    runner.run(instance, img, host, detach=False, rm=True)
Exemple #4
0
def run_attached():
    container_name = 'test'

    img_registry = DefaultDockerRegistry()
    img = DockerImage('test_broken_image', registry=img_registry)
    instance = DockerContainer(container_name, ports_mapping={80: 8080})
    host = DockerHost()

    runner = DockerRunner()
    runner.run(instance, img, host, detach=False, rm=False)
Exemple #5
0
def run_detached_and_remove():
    container_name = 'test'

    img_registry = DefaultDockerRegistry()
    img = DockerImage('test_broken_image', registry=img_registry)
    instance = DockerContainer(container_name)
    host = DockerHost()

    runner = DockerRunner()
    runner.run(instance, img, host, detach=True, rm=True)
Exemple #6
0
def test_run_remote_registry(runner, registry):
    img = DockerImage(IMAGE_NAME,
                      repository=REPOSITORY_NAME,
                      registry=registry)

    _check_runner(runner, img)
Exemple #7
0
def test_run_default_registry(runner):
    img_registry = DefaultDockerRegistry()
    img = DockerImage(IMAGE_NAME, registry=img_registry)

    _check_runner(runner, img)