devices: smartcard: Use CharSource

smartcard does the same internally for libvirt, so let's follow that
pattern, and fix the fallout
This commit is contained in:
Cole Robinson
2019-05-14 11:57:50 -04:00
parent 9d78759ac5
commit 43a39dc158
5 changed files with 32 additions and 1 deletions
+12
View File
@@ -966,6 +966,8 @@ class XMLParseTest(unittest.TestCase):
dev1 = guest.devices.smartcard[0]
dev2 = guest.devices.smartcard[1]
dev3 = guest.devices.smartcard[2]
dev4 = guest.devices.smartcard[3]
check = self._make_checker(dev1)
check("type", None, "tcp")
@@ -974,6 +976,16 @@ class XMLParseTest(unittest.TestCase):
check("mode", "passthrough", "host")
check("type", "spicevmc", None)
check = self._make_checker(dev3)
check("type", "tcp")
check("source.host", "127.0.0.1")
check("source.service", 2001)
check = self._make_checker(dev4)
check("type", "unix")
check("source.path", "/tmp/smartcard.sock")
check("source.mode", "bind")
self._alter_compare(guest.get_xml(), outfile)
def testAlterRedirdev(self):