예제 #1
0
 def test_lookup_by_uuid_string(self):
     with conttestlib.fake_runtime_domain() as dom:
         doms.add(dom)
         conn = Connection()
         guid = dom.UUIDString()
         dom2 = conn.lookupByUUIDString(guid)
     self.assertEqual(dom2.UUIDString(), guid)
예제 #2
0
 def test_list_domains_id_none(self):
     conn = Connection()
     self.assertEqual(conn.listDomainsID(), [])
예제 #3
0
 def test_list_all_domains_none(self):
     conn = Connection()
     self.assertEqual(conn.listAllDomains(0), [])
예제 #4
0
 def test_lookup_by_id_missing(self):
     conn = Connection()
     self.assertRaises(libvirt.libvirtError,
                       conn.lookupByID,
                       42)
예제 #5
0
 def test_lookup_by_name_missing(self):
     conn = Connection()
     self.assertRaises(libvirt.libvirtError,
                       conn.lookupByName,
                       "foobar")
예제 #6
0
 def test_get_lib_version(self):
     conn = Connection()
     ver = conn.getLibVersion()
     self.assertGreater(ver, 0)