当前位置: 首页>>代码示例>>Python>>正文


Python client.inspect_container函数代码示例

本文整理汇总了Python中utils.client.inspect_container函数的典型用法代码示例。如果您正苦于以下问题:Python inspect_container函数的具体用法?Python inspect_container怎么用?Python inspect_container使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了inspect_container函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_docker_run_args

def test_docker_run_args(client, shipy):
    cargs = 'ping -v -c 100 127.0.0.1'
    container = run_template(client, shipy, cargs=cargs)

    assert cargs == '{} {}'.format(
        client.inspect_container(container)['Path'],
        ' '.join(client.inspect_container(container)['Args']))
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py

示例2: test_docker_run_interactive

def test_docker_run_interactive(client, shipy):
    argument = ('-i', '--interactive')

    for farg in argument:
        container = run_template(client, shipy, farg=farg)

        assert client.inspect_container(container)[
            'Config']['AttachStdin']
        assert client.inspect_container(container)[
            'Config']['OpenStdin']
        assert client.inspect_container(container)[
            'Config']['StdinOnce']
开发者ID:abhi1004,项目名称:shipy,代码行数:12,代码来源:test_functional_shipy.py

示例3: test_docker_run_memory_swap

def test_docker_run_memory_swap(client, shipy):
    farg = '--memory-swap'
    fval = ('110M',)

    sarg = '--memory'
    sval = '100M'
    container = run_template(client, shipy, farg=farg, fval=fval,
                             sarg=sarg, sval=sval)

    assert sval == \
           size(client.inspect_container(container)['HostConfig']['Memory'])

    assert fval[0] == \
           size(client.inspect_container(container)['HostConfig']['MemorySwap'])
开发者ID:abhi1004,项目名称:shipy,代码行数:14,代码来源:test_functional_shipy.py

示例4: test_docker_run_add_host

def test_docker_run_add_host(client, shipy):
    farg = '--add-host'
    fval = ('batman.example:10.0.0.1', 'wayne.manor:10.0.0.2')
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert [fval[0], fval[1]] == \
           client.inspect_container(container)['HostConfig']['ExtraHosts']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py

示例5: test_docker_run_cap_drop

def test_docker_run_cap_drop(client, shipy):
    farg = '--cap-drop'
    fval = ('SYS_ADMIN', 'SYS_TIME')
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert [fval[0], fval[1]] == \
           client.inspect_container(container)['HostConfig']['CapDrop']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py

示例6: test_docker_run_dns_search

def test_docker_run_dns_search(client, shipy):
    farg = '--dns-search'
    fval = ('batman.com', 'brucewayne.com')
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert [fval[0], fval[1]] == \
           client.inspect_container(container)['HostConfig']['DnsSearch']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py

示例7: test_docker_run_dns

def test_docker_run_dns(client, shipy):
    farg = '--dns'
    fval = ('8.8.8.8', '8.8.4.4')
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert [fval[0], fval[1]] == \
           client.inspect_container(container)['HostConfig']['Dns']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py

示例8: test_docker_run_links

def test_docker_run_links(client, shipy):
    farg = '--link'
    fval = []

    for _ in range(2):
        fval.append(cn())

    fval[1] += ':alias'

    fval = tuple(fval)

    ext_fval = []

    for linked_to in fval:
        run_template(client, shipy, cn=linked_to.split(':')[0])

        if len(linked_to.split(':')) == 1:
            linked_to += ':{}'.format(linked_to)
        ext_fval.append(linked_to)

    container = run_template(client, shipy, farg=farg, fval=fval)

    links = client.inspect_container(container)['HostConfig']['Links']

    assert len(fval) == len(links)

    for link in links:
        name, _, alias = ''.join(link.split(':')).split('/')[1:]

        assert '{}:{}'.format(name, alias) in ext_fval
开发者ID:abhi1004,项目名称:shipy,代码行数:30,代码来源:test_functional_shipy.py

示例9: test_docker_run_pid

def test_docker_run_pid(client, shipy):
    farg = '--pid'
    fval = ('host',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['HostConfig']['PidMode']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py

示例10: test_docker_run_memory

def test_docker_run_memory(client, shipy):
    farg = '--memory'
    fval = ('100M',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           size(client.inspect_container(container)['HostConfig']['Memory'])
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py

示例11: test_docker_run_workdir

def test_docker_run_workdir(client, shipy):
    argument = ('-w', '--workdir')
    fval = ('/tmp',)
    for farg in argument:
        container = run_template(client, shipy, farg=farg, fval=fval)
        assert fval[0] == \
               client.inspect_container(container)['Config']['WorkingDir']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py

示例12: test_docker_run_log_driver

def test_docker_run_log_driver(client, shipy):
    farg = '--log-driver'
    fval = ('syslog',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['HostConfig']['LogConfig']['Type']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py

示例13: test_docker_run_cpu_period

def test_docker_run_cpu_period(client, shipy):
    farg = '--cpu-period'
    fval = (1000,)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['HostConfig']['CpuPeriod']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py

示例14: test_docker_run_mac_address

def test_docker_run_mac_address(client, shipy):
    farg = '--mac-address'
    fval = ('aa:aa:aa:aa:aa:aa',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['NetworkSettings']['MacAddress']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py

示例15: test_docker_run_volume_driver

def test_docker_run_volume_driver(client, shipy):
    farg = '--volume-driver'
    fval = ('local',)
    container = run_template(client, shipy, farg=farg, fval=fval)

    assert fval[0] == \
           client.inspect_container(container)['HostConfig']['VolumeDriver']
开发者ID:abhi1004,项目名称:shipy,代码行数:7,代码来源:test_functional_shipy.py


注:本文中的utils.client.inspect_container函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。