006_migrations.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:ovirt-system-tests 作者: oVirt 项目源码 文件源码
def prepare_migration_attachments_ipv6(api):
    engine = api.system_service()
    hosts_service = engine.hosts_service()

    for index, host in enumerate(
            test_utils.hosts_in_cluster_v4(engine, CLUSTER_NAME),
            start=1):
        host_service = hosts_service.host_service(id=host.id)

        ip_address = MIGRATION_NETWORK_IPv6_ADDR.format(index)

        ip_configuration = network_utils_v4.create_static_ip_configuration(
            ipv6_addr=ip_address,
            ipv6_mask=MIGRATION_NETWORK_IPv6_MASK)

        network_utils_v4.modify_ip_config(
            engine, host_service, MIGRATION_NETWORK, ip_configuration)

        actual_address = next(nic for nic in host_service.nics_service().list()
                              if nic.name == VLAN200_IF_NAME).ipv6.address
        nt.assert_equals(IPAddress(actual_address), IPAddress(ip_address))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号