Example #1
0
        def build_ip(addr_str):
            if not addr_str:
                return None

            ret = addr_str.rsplit("/", 1)
            ip = Interface.InterfaceProtocolIPAddress(ret[0])
            if len(ret) > 1:
                ip.prefix = ret[1]

            return ip
virtimage = virtinst.ImageParser.parse_file("tests/image-xml/image.xml")

volinst = virtinst.Storage.StorageVolume(conn=testconn,
                                         pool_name="default-pool",
                                         name="val-vol",
                                         capacity=1)

tmppool = testconn.storagePoolLookupByName("inactive-pool")
tmppool.destroy()

iface_proto1 = Interface.InterfaceProtocol.protocol_class_for_family(
    Interface.InterfaceProtocol.INTERFACE_PROTOCOL_FAMILY_IPV4)()
iface_proto2 = Interface.InterfaceProtocol.protocol_class_for_family(
    Interface.InterfaceProtocol.INTERFACE_PROTOCOL_FAMILY_IPV6)()
iface_ip1 = Interface.InterfaceProtocolIPAddress("129.63.1.2")
iface_ip2 = Interface.InterfaceProtocolIPAddress("fe80::215:58ff:fe6e:5",
                                                 prefix="64")

args = {

    'guest' : {
    'name'  : {
        'invalid' : ['123456789', 'im_invalid!', '', 0,
                     'verylongnameverylongnameverylongnamevery'
                     'longnameveryvery', "test" # In use,
                     ],
        'valid'   : ['Valid_name.01'] },
    'memory' : {
        'invalid' : [-1, 0, ''],
        'valid'   : [200, 2000] },