mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-08 04:58:29 +03:00
tests: xmlparse: explain AddRemoveDevice cases
This commit is contained in:
parent
9e0e0dfb08
commit
6fb5baf8a8
@ -953,21 +953,26 @@ class XMLParseTest(unittest.TestCase):
|
||||
def testAddRemoveDevices(self):
|
||||
guest, outfile = self._get_test_content("add-devices")
|
||||
|
||||
# Basic removal of existing device
|
||||
rmdev = guest.get_devices("disk")[2]
|
||||
guest.remove_device(rmdev)
|
||||
|
||||
# Basic device add
|
||||
guest.add_device(virtinst.VirtualWatchdog(conn))
|
||||
|
||||
# Test adding device with child properties (address value)
|
||||
adddev = virtinst.VirtualNetworkInterface(conn=conn)
|
||||
adddev.type = "network"
|
||||
adddev.source = "default"
|
||||
adddev.macaddr = "1A:2A:3A:4A:5A:6A"
|
||||
adddev.address.set_addrstr("spapr-vio")
|
||||
|
||||
guest.add_device(virtinst.VirtualWatchdog(conn))
|
||||
|
||||
# Test adding and removing the same device
|
||||
guest.add_device(adddev)
|
||||
guest.remove_device(adddev)
|
||||
guest.add_device(adddev)
|
||||
|
||||
# Test adding device built from parsed XML
|
||||
guest.add_device(virtinst.VirtualAudio(conn,
|
||||
parsexml="""<sound model='pcspk'/>"""))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user