diff options
Diffstat (limited to 'tests/test_storage.py')
-rw-r--r-- | tests/test_storage.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_storage.py b/tests/test_storage.py new file mode 100644 index 0000000..ba20e53 --- /dev/null +++ b/tests/test_storage.py @@ -0,0 +1,24 @@ +import unittest +import libvirt + + +class TestLibvirtStorage(unittest.TestCase): + def setUp(self): + self.conn = libvirt.open("test:///default") + self.pool = self.conn.storagePoolLookupByName("default-pool") + + def tearDown(self): + self.pool = None + self.conn = None + + def testAttr(self): + self.assertEqual(self.pool.name(), "default-pool") + + def testVol(self): + volxml = '''<volume type="file"> + <name>raw.img</name> + <allocation unit="M">10</allocation> + <capacity unit="M">1000</capacity> +</volume>''' + + vol = self.pool.createXML(volxml) |