mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-07-28 15:41:52 +03:00
Add test for setting scheduler parameters
Add a test setting scheduler parameters to validate the previous bugfix to strncpy of field names. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
19
tests/test_domain.py
Normal file
19
tests/test_domain.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
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.assertEquals(len(params), 1)
|
||||||
|
self.assertTrue("weight" in params)
|
||||||
|
params["weight"] = 100
|
||||||
|
self.dom.setSchedulerParameters(params)
|
Reference in New Issue
Block a user