def test_native_ip_inject(client, socat_containers, native_name, pull_images):
    docker_client = get_docker_client(host(client))
    docker_container = docker_client. \
        create_container(NATIVE_TEST_IMAGE,
                         name=native_name,
                         labels={'io.rancher.container.network': 'true'},
                         tty=True,
                         stdin_open=True,
                         detach=True,
                         command=['/bin/bash', '-c', 'sleep 10; '
                                                     'ip addr show eth0'])
    rancher_container, _ = start_and_wait(client, docker_container,
                                          docker_client, native_name)

    assert_ip_inject(rancher_container)
Exemple #2
0
def test_native_ip_inject(client, socat_containers, native_name, pull_images):
    docker_client = get_docker_client(host(client))
    d_container = docker_client. \
        create_container(NATIVE_TEST_IMAGE,
                         name=native_name,
                         environment=['RANCHER_NETWORK=true'],
                         tty=True,
                         stdin_open=True,
                         detach=True,
                         command=['/bin/bash', '-c', 'sleep 10; '
                                                     'ip addr show eth0'])
    docker_client.start(d_container)
    container = wait_on_rancher_container(client, native_name)

    assert_ip_inject(container)
Exemple #3
0
def test_native_ip_inject(client, socat_containers, native_name, pull_images):
    docker_client = get_docker_client(host(client))
    docker_container = docker_client. \
        create_container(NATIVE_TEST_IMAGE,
                         name=native_name,
                         labels={'io.rancher.container.network': 'true'},
                         tty=True,
                         stdin_open=True,
                         detach=True,
                         command=['/bin/bash', '-c', 'until $(ip addr show | '
                                                     'grep -q 10.42); '
                                                     'do sleep 1 && echo .; '
                                                     'done; ip addr show'])
    rancher_container, _ = start_and_wait(client, docker_container,
                                          docker_client, native_name)
    assert_ip_inject(client.reload(rancher_container))
def test_native_ip_inject(client, socat_containers, native_name,
                          pull_images):
    docker_client = get_docker_client(host(client))
    docker_container = docker_client. \
        create_container(NATIVE_TEST_IMAGE,
                         name=native_name,
                         labels={'io.rancher.container.network': 'true'},
                         tty=True,
                         stdin_open=True,
                         detach=True,
                         command=['/bin/bash', '-c', 'sleep 10; '
                                                     'ip addr show eth0'])
    rancher_container, _ = start_and_wait(client, docker_container,
                                          docker_client, native_name)

    assert_ip_inject(rancher_container)
def test_native_ip_inject(client, socat_containers, native_name,
                          pull_images):
    docker_client = get_docker_client(host(client))
    docker_container = docker_client. \
        create_container(NATIVE_TEST_IMAGE,
                         name=native_name,
                         labels={'io.rancher.container.network': 'true'},
                         tty=True,
                         stdin_open=True,
                         detach=True,
                         command=['/bin/bash', '-c', 'until $(ip addr show | '
                                                     'grep -q 10.42); '
                                                     'do sleep 1 && echo .; '
                                                     'done; ip addr show'])
    rancher_container, _ = start_and_wait(client, docker_container,
                                          docker_client, native_name)
    assert_ip_inject(client.reload(rancher_container))