From nobody Wed Jul 16 13:10:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1532111737842140.8214433977014; Fri, 20 Jul 2018 11:35:37 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B319481119; Fri, 20 Jul 2018 18:35:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7AF7D608F2; Fri, 20 Jul 2018 18:35:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 27C1118037F1; Fri, 20 Jul 2018 18:35:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6KIZ7AA023530 for ; Fri, 20 Jul 2018 14:35:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 70DDD111AF20; Fri, 20 Jul 2018 18:35:07 +0000 (UTC) Received: from unused.bos.redhat.com (unknown [10.16.197.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5060E111C4BD; Fri, 20 Jul 2018 18:35:07 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 20 Jul 2018 14:34:49 -0400 Message-Id: <261e95c0bc15a9ad8bc5da02c76c3f4a6420c28e.1531836010.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: phrdina@redhat.com, Anya Harter Subject: [libvirt] [dbus PATCH v2 05/17] Introduce Interface Tests & Test Create method for Interface Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 20 Jul 2018 18:35:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter Reviewed-by: Katerina Koukiou --- tests/Makefile.am | 1 + tests/libvirttest.py | 12 ++++++++++++ tests/test_interface.py | 16 ++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100755 tests/test_interface.py diff --git a/tests/Makefile.am b/tests/Makefile.am index 09c3e2e..cd1fbd7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -11,6 +11,7 @@ test_helpers =3D \ test_programs =3D \ test_connect.py \ test_domain.py \ + test_interface.py \ test_network.py \ test_nodedev.py \ test_storage.py \ diff --git a/tests/libvirttest.py b/tests/libvirttest.py index 3741abd..2a09182 100644 --- a/tests/libvirttest.py +++ b/tests/libvirttest.py @@ -71,6 +71,18 @@ class BaseTestClass(): if self.timeout: raise TimeoutError() =20 + 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 =3D self.connect.InterfaceDefineXML(xmldata.minimal_interface= _xml, 0) + obj =3D self.bus.get_object('org.libvirt', path) + interface_obj =3D 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 diff --git a/tests/test_interface.py b/tests/test_interface.py new file mode 100755 index 0000000..88be5dc --- /dev/null +++ b/tests/test_interface.py @@ -0,0 +1,16 @@ +#!/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 =3D self.interface_create() + interface_obj.Destroy(0) + interface_obj.Create(0) + +if __name__ =3D=3D '__main__': + libvirttest.run() --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list