File: test_domain.py

package info (click to toggle)
libvirt-python 11.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,428 kB
  • sloc: ansic: 10,787; python: 4,604; xml: 910; makefile: 19
file content (25 lines) | stat: -rw-r--r-- 758 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import unittest
import libvirt


class TestLibvirtDomain(unittest.TestCase):
    def setUp(self):
        self.conn = libvirt.open("test:///default")
        self.dom = self.conn.lookupByName("test")

    def tearDown(self):
        self.dom = None
        self.conn = None

    def testDomainSchedParams(self):
        params = self.dom.schedulerParameters()
        self.assertEqual(len(params), 1)
        self.assertTrue("weight" in params)
        params["weight"] = 100
        self.dom.setSchedulerParameters(params)

    @unittest.skipIf(libvirt.getVersion() == 4000000,
                     "test driver screenshot broken in 4.0.0")
    def testScreenshot(self):
        stream = self.conn.newStream()
        ss = self.dom.screenshot(stream, 0, 0)