Milan Zamazal has uploaded a new change for review. Change subject: virt: tests: More testVideoXML tests ......................................................................
virt: tests: More testVideoXML tests As suggested in https://gerrit.ovirt.org/#/c/50091/3/tests/deviceTests.py@296, we should try various combinations of presence and non-presence of video device attributes in the related test. Change-Id: I581f6e3c9cd72d98e3cecf89bd1d6b40b9109229 Signed-off-by: Milan Zamazal <mzama...@redhat.com> --- M tests/deviceTests.py 1 file changed, 21 insertions(+), 10 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/50420/1 diff --git a/tests/deviceTests.py b/tests/deviceTests.py index 977ec23..8f0bac9 100644 --- a/tests/deviceTests.py +++ b/tests/deviceTests.py @@ -286,16 +286,27 @@ sound = vmdevices.core.Sound(self.conf, self.log, **dev) self.assertXMLEqual(sound.getXML().toxml(), soundXML) - def testVideoXML(self): - videoXML = """ - <video> - <model heads="2" type="vga" vgamem="8192" vram="32768"/> - </video>""" - - dev = {'device': 'vga', - 'specParams': {'vram': '32768', 'heads': '2', 'vgamem': '8192'}} - video = vmdevices.core.Video(self.conf, self.log, **dev) - self.assertXMLEqual(video.getXML().toxml(), videoXML) + @permutations([ + [{'device': 'vga', + 'specParams': {'vram': '32768', 'heads': '2'}}, + """<video> + <model heads="2" type="vga" vram="32768"/> + </video>"""], + [{'device': 'qxl', + 'specParams': {'vram': '65536', 'heads': '2', 'ram': '131072'}}, + """<video> + <model heads="2" ram="131072" type="qxl" vram="65536"/> + </video>"""], + [{'device': 'qxl', + 'specParams': {'vram': '32768', 'heads': '2', + 'ram': '65536', 'vgamem': '8192'}}, + """<video> + <model heads="2" ram="65536" type="qxl" vgamem="8192" vram="32768"/> + </video>"""] + ]) + def testVideoXML(self, dev_spec, video_xml): + video = vmdevices.core.Video(self.conf, self.log, **dev_spec) + self.assertXMLEqual(video.getXML().toxml(), video_xml) def testInterfaceXML(self): interfaceXML = """ -- To view, visit https://gerrit.ovirt.org/50420 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I581f6e3c9cd72d98e3cecf89bd1d6b40b9109229 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Milan Zamazal <mzama...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches