Commit a467ae22 authored by Anya Harter's avatar Anya Harter Committed by Katerina Koukiou

Introduce Interface Tests & Test Create method for Interface Interface

Signed-off-by: 's avatarAnya Harter <aharter@redhat.com>
Reviewed-by: 's avatarKaterina Koukiou <kkoukiou@redhat.com>
parent 50d3e1be
......@@ -11,6 +11,7 @@ test_helpers = \
test_programs = \
test_connect.py \
test_domain.py \
test_interface.py \
test_network.py \
test_nodedev.py \
test_storage.py \
......
......@@ -71,6 +71,18 @@ class BaseTestClass():
if self.timeout:
raise TimeoutError()
def interface_create(self):
""" Fixture to define dummy interface on the test driver
This fixture should be used in the setup of every test manipulating
with interfaces.
"""
path = self.connect.InterfaceDefineXML(xmldata.minimal_interface_xml, 0)
obj = self.bus.get_object('org.libvirt', path)
interface_obj = dbus.Interface(obj, 'org.libvirt.Interface')
interface_obj.Create(0)
return path, interface_obj
@pytest.fixture
def node_device_create(self):
""" Fixture to create dummy node device on the test driver
......
#!/usr/bin/python3
import dbus
import libvirttest
class TestInterface(libvirttest.BaseTestClass):
""" Tests for methods and properties of the Interface interface
"""
def test_interface_create(self):
_,interface_obj = self.interface_create()
interface_obj.Destroy(0)
interface_obj.Create(0)
if __name__ == '__main__':
libvirttest.run()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment