Ejemplo n.º 1
0
 def test_get_graphics(self):
     virt.get_xml = MagicMock(return_value='''<domain type='kvm' id='7'>
           <name>test-vm</name>
           <devices>
             <graphics type='vnc' port='5900' autoport='yes' listen='0.0.0.0'>
               <listen type='address' address='0.0.0.0'/>
             </graphics>
           </devices>
         </domain>
     ''')
     graphics = virt.get_graphics('test-vm')
     self.assertEqual('vnc', graphics['type'])
     self.assertEqual('5900', graphics['port'])
     self.assertEqual('0.0.0.0', graphics['listen'])
Ejemplo n.º 2
0
 def test_get_graphics(self):
     virt.get_xml = MagicMock(return_value='''<domain type='kvm' id='7'>
           <name>test-vm</name>
           <devices>
             <graphics type='vnc' port='5900' autoport='yes' listen='0.0.0.0'>
               <listen type='address' address='0.0.0.0'/>
             </graphics>
           </devices>
         </domain>
     ''')
     graphics = virt.get_graphics('test-vm')
     self.assertEqual('vnc', graphics['type'])
     self.assertEqual('5900', graphics['port'])
     self.assertEqual('0.0.0.0', graphics['listen'])
Ejemplo n.º 3
0
    def test_get_graphics(self):
        xml = '''<domain type='kvm' id='7'>
              <name>test-vm</name>
              <devices>
                <graphics type='vnc' port='5900' autoport='yes' listen='0.0.0.0'>
                  <listen type='address' address='0.0.0.0'/>
                </graphics>
              </devices>
            </domain>
        '''
        self.set_mock_vm("test-vm", xml)

        graphics = virt.get_graphics('test-vm')
        self.assertEqual('vnc', graphics['type'])
        self.assertEqual('5900', graphics['port'])
        self.assertEqual('0.0.0.0', graphics['listen'])