From nobody Wed May 14 02:51:34 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 1528992027369469.0135749920511; Thu, 14 Jun 2018 09:00:27 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83620300306D; Thu, 14 Jun 2018 16:00:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A7EC900C0; Thu, 14 Jun 2018 16:00:24 +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 CD5294CA8A; Thu, 14 Jun 2018 16:00:23 +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 w5EG0069003743 for ; Thu, 14 Jun 2018 12:00:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 304A010FFE52; Thu, 14 Jun 2018 16:00:00 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5A3A10FFE4D for ; Thu, 14 Jun 2018 15:59:59 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 14 Jun 2018 17:59:39 +0200 Message-Id: <20180614155953.30292-4-kkoukiou@redhat.com> In-Reply-To: <20180614155953.30292-1-kkoukiou@redhat.com> References: <20180614155953.30292-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v2 03/17] test: move XML definition of entities to seperate file 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 14 Jun 2018 16:00:26 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- tests/test_connect.py | 47 +++++++---------------------------------------- tests/xmldata.py | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 40 deletions(-) create mode 100644 tests/xmldata.py diff --git a/tests/test_connect.py b/tests/test_connect.py index da146a4..01b6bd1 100755 --- a/tests/test_connect.py +++ b/tests/test_connect.py @@ -3,43 +3,10 @@ import dbus import libvirttest import pytest +import xmldata =20 =20 class TestConnect(libvirttest.BaseTestClass): - minimal_domain_xml =3D ''' - - foo - 1024 - - hvm - - - ''' - - minimal_network_xml =3D ''' - - bar - 004b96e12d78c30f5aa5f03c87d21e69 - - - - - - - - - ''' - - minimal_storage_pool_xml =3D ''' - - foo - 35bb2ad9-388a-cdfe-461a-b8907f6e53fe - - /foo - - - ''' - def test_connect_domain_create_xml(self): def domain_started(path, event, detail): if event !=3D libvirttest.DomainEvent.STARTED: @@ -50,7 +17,7 @@ class TestConnect(libvirttest.BaseTestClass): =20 self.connect.connect_to_signal('DomainEvent', domain_started) =20 - path =3D self.connect.DomainCreateXML(self.minimal_domain_xml, 0) + path =3D self.connect.DomainCreateXML(xmldata.minimal_domain_xml, = 0) assert isinstance(path, dbus.ObjectPath) =20 self.main_loop() @@ -65,7 +32,7 @@ class TestConnect(libvirttest.BaseTestClass): =20 self.connect.connect_to_signal('DomainEvent', domain_defined) =20 - path =3D self.connect.DomainDefineXML(self.minimal_domain_xml) + path =3D self.connect.DomainDefineXML(xmldata.minimal_domain_xml) assert isinstance(path, dbus.ObjectPath) =20 self.main_loop() @@ -157,7 +124,7 @@ class TestConnect(libvirttest.BaseTestClass): =20 self.connect.connect_to_signal('NetworkEvent', network_started) =20 - path =3D self.connect.NetworkCreateXML(self.minimal_network_xml) + path =3D self.connect.NetworkCreateXML(xmldata.minimal_network_xml) assert isinstance(path, dbus.ObjectPath) =20 self.main_loop() @@ -171,7 +138,7 @@ class TestConnect(libvirttest.BaseTestClass): =20 self.connect.connect_to_signal('NetworkEvent', network_defined) =20 - path =3D self.connect.NetworkDefineXML(self.minimal_network_xml) + path =3D self.connect.NetworkDefineXML(xmldata.minimal_network_xml) assert isinstance(path, dbus.ObjectPath) =20 self.main_loop() @@ -210,7 +177,7 @@ class TestConnect(libvirttest.BaseTestClass): self.connect.connect_to_signal('StoragePoolEvent', storage_pool_st= arted) =20 path =3D self.connect.StoragePoolCreateXML( - self.minimal_storage_pool_xml, 0) + xmldata.minimal_storage_pool_xml, 0) assert isinstance(path, dbus.ObjectPath) =20 self.main_loop() @@ -225,7 +192,7 @@ class TestConnect(libvirttest.BaseTestClass): self.connect.connect_to_signal('StoragePoolEvent', storage_pool_de= fined) =20 path =3D self.connect.StoragePoolDefineXML( - self.minimal_storage_pool_xml, 0) + xmldata.minimal_storage_pool_xml, 0) assert isinstance(path, dbus.ObjectPath) =20 self.main_loop() diff --git a/tests/xmldata.py b/tests/xmldata.py new file mode 100644 index 0000000..e42b6aa --- /dev/null +++ b/tests/xmldata.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +"""Minimal libvirt XML definition of entities to be used in the test suite. +""" + +minimal_domain_xml =3D ''' + + foo + 1024 + + hvm + + +''' + +minimal_network_xml =3D ''' + + bar + 004b96e12d78c30f5aa5f03c87d21e69 + + + + + + + + +''' + +minimal_storage_pool_xml =3D ''' + + foo + 35bb2ad9-388a-cdfe-461a-b8907f6e53fe + + /foo + + +''' --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list