test_libvirt_utils.py 文件源码

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

项目:daisy 作者: opnfv 项目源码 文件源码
def test_modify_vm_bridge():
    template = os.path.join(WORKSPACE, 'templates/virtual_environment/vms/daisy.xml')
    tree = ET.ElementTree(file=template)
    root = tree.getroot()
    bridge = 'daisy_test'
    modify_vm_bridge(root, bridge)
    devices = root.find('./devices')
    is_match = False
    for interface in devices.findall('interface'):
        source = interface.find('source')
        if interface.attrib.get('type', None) == 'bridge' \
                and source is not None \
                and source.attrib.get('bridge', None) == bridge:
            is_match = True
            break
    assert is_match
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号