Lee Yarwood has uploaded a new change for review.
Change subject: [WIP] BZ#748386 - qemuConvert test cases
......................................................................
[WIP] BZ#748386 - qemuConvert test cases
Adds some simple qemu-img tests against volume.qemuConvert() to ensure
volumes remain the correct format after being converted.
Change-Id: I1c9f302928c246f7ce195d169f8d5a533df1a344
Signed-off-by: Lee Yarwood <lyarwood(a)redhat.com>
---
A tests/qemuImgTests.py
A vdsm/storage/fakeVolume.py
2 files changed, 214 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/9290/1
diff --git a/tests/qemuImgTests.py b/tests/qemuImgTests.py
new file mode 100644
index 0000000..e1cc70c
--- /dev/null
+++ b/tests/qemuImgTests.py
@@ -0,0 +1,148 @@
+#
+# Copyright 2012 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+from testrunner import VdsmTestCase as TestCase
+
+import tempfile
+import uuid
+import os
+
+
+from storage.threadLocal import vars
+from storage.fakeVolume import FakeFileVolume
+import storage.task as task
+import storage.volume as volume
+import storage.misc as misc
+
+EXT_QEMUIMG = '/bin/qemu-img'
+EXT_DD = '/bin/dd'
+VOL_SIZE = "10M"
+VOL_ALLOC = "20"
+
+class FileVolumes():
+
+ def __init__(self):
+ self.dir = tempfile.mkdtemp()
+ self.sduuid = str(uuid.uuid4())
+ self.imguuid = str(uuid.uuid4())
+ self.repo = self.dir + "/" + self.sduuid + "/images/" + self.imguuid
+ os.makedirs(self.repo)
+
+ def genPathUUID(self):
+ u = str(uuid.uuid4())
+ p = self.repo + "/" + u
+ return p, u
+
+
+ def createCOW(self):
+ path, voluuid = self.genPathUUID()
+ misc.execCmd([EXT_QEMUIMG, "create", "-f", "qcow2", path, VOL_SIZE],sync=False)
+ return FakeFileVolume(repoPath=self.dir, sdUUID=self.sduuid, imgUUID=self.imguuid, volUUID=voluuid,
+ volFormat=volume.COW_FORMAT, volPath=path)
+
+ def createRAW(self):
+ path, voluuid = self.genPathUUID()
+ misc.execCmd([EXT_QEMUIMG, "create", "-f", "raw", path, VOL_SIZE],sync=False)
+ return FakeFileVolume(repoPath=self.dir, sdUUID=self.sduuid, imgUUID=self.imguuid, volUUID=voluuid,
+ volFormat=volume.RAW_FORMAT, volPath=path)
+
+ def createCOWPrealloc(self):
+ v = self.createCOW()
+ misc.execCmd([EXT_DD, "if=/dev/zero", "of=%s" % v.getVolumePath(), "bs=512"])
+ return v
+
+
+ def createCOWChild(self,parent):
+ path, voluuid = self.genPathUUID()
+ misc.execCmd([EXT_QEMUIMG, "create", "-f", "qcow2", "-o", "backing_file=%s/%s,backing_fmt=raw" %
+ (self.repo,parent.volUUID), self.repo + "/" + voluuid, VOL_SIZE],sync=False)
+ fake = FakeFileVolume(repoPath=self.dir, sdUUID=self.sduuid, imgUUID=self.imguuid, volUUID=voluuid,
+ volFormat=volume.COW_FORMAT, volPath=path)
+ # Hack to avoid a call to sdc.produce() later when we try to find the parent.
+ fake.setParent(parent.volUUID)
+ fake.setParentVolume(parent)
+ return fake
+
+ def cleanUp(self):
+ os.rmdir(self.dir)
+
+
+class qemuImgRebaseTestCase(TestCase):
+ """
+
+ """
+
+class qemuImgCreateTestCase(TestCase):
+ """
+
+ """
+
+class qemuImgConvertTestCase(TestCase):
+
+
+ def runQemuConvert(self, src, dst):
+
+ vars.task = task.Task(id=None, name='qemuImgTests')
+ try:
+ (rc, out, err) = volume.qemuConvert(src, dst, vars.task.aborting)
+ self.assertFalse(rc)
+ except Exception:
+ self.fail()
+
+
+ def testFileQemuConvert(self):
+ # create the repo
+ t = FileVolumes()
+
+ # RAW to RAW
+ src = t.createRAW()
+ dst = t.createRAW()
+ self.runQemuConvert(src, dst)
+
+ # QCOW2 to RAW
+ #src = t.createCOW()
+ #dst = t.createRAW()
+ #self.runQemuConvert(src, dst)
+
+ # RAW to QCOW2
+ #src = t.createRAW()
+ #dst = t.createCOW()
+ #self.runQemuConvert(src, dst)
+
+ # RAW<-QCOW2 to RAW<-QCOW2
+ parent = t.createRAW()
+ src = t.createCOWChild(parent)
+ dst = t.createCOW()
+ self.runQemuConvert(src, dst)
+
+ # Convert a COW parent child to another COW
+ # RAW<-QCOW2<-QCOW2 to RAW<-QCOW2<-QCOW2
+ rawParent = t.createRAW()
+ src = t.createCOWChild(rawParent)
+ cowChild = t.createCOWChild(src)
+ dst = t.createCOW()
+ self.runQemuConvert(src,dst)
+
+
+
+
+ def testBlockQemuConvert(self):
+ pass
+
diff --git a/vdsm/storage/fakeVolume.py b/vdsm/storage/fakeVolume.py
new file mode 100644
index 0000000..72516b7
--- /dev/null
+++ b/vdsm/storage/fakeVolume.py
@@ -0,0 +1,66 @@
+#
+# Copyright 2012 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+import volume
+import misc
+
+class FakeFileVolume(volume.Volume):
+ """
+ A fake file volume class to aid with testing.
+ """
+
+ def __init__(self, repoPath, sdUUID, imgUUID, volUUID, volFormat, volPath):
+ volume.Volume.__init__(self, repoPath, sdUUID, imgUUID, volUUID)
+
+ self.md = {"SIZE": None,"TYPE":None,"FORMAT":None,"DISKTYPE":None,"VOLTYPE":None,
+ "PUUID":None,"DOMAIN":None,"CTIME":None,"IMAGE":None,"DESCRIPTION":None,
+ "LEGALITY":None,"MTIME":None,"ILLEGAL":None,"LEGAL":None,"FAKE":None}
+
+ self.setFormat(volFormat)
+ self.setVolumePath(volPath)
+ self.parentVolume = None
+
+ def validateImagePath(self):
+ pass
+
+ def validateVolumePath(self):
+ pass
+
+ def setVolumePath(self,volPath):
+ self.volumePath = volPath
+
+ def setParent(self, puuid):
+ self.setMetaParam(volume.PUUID, puuid)
+
+ def getParent(self):
+ return self.getMetaParam(volume.PUUID)
+
+ def setParentVolume(self,parent):
+ self.parentVolume = parent
+
+ def getParentVolume(self):
+ return self.parentVolume
+
+ def setMetadata(self, m, mid=None):
+ for k,v in m.iteritems():
+ self.md[k] = v
+
+ def getMetadata(self):
+ return self.md
--
To view, visit http://gerrit.ovirt.org/9290
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c9f302928c246f7ce195d169f8d5a533df1a344
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Lee Yarwood <lyarwood(a)redhat.com>
ShaoHe Feng has posted comments on this change.
Change subject: vdsm: Refactoring libvirtvm & vm
......................................................................
Patch Set 2:
Vinzenz:
a question about my patch. http://gerrit.ovirt.org/#/c/7329/
my patch should be in /vm/vm.py ?
--
To view, visit http://gerrit.ovirt.org/10861
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I653be8e06431f1033416aa55d6cb81b4262ba6b1
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Adam Litke <agl(a)us.ibm.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Peter V. Saveliev <peet(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Federico Simoncelli has uploaded a new change for review.
Change subject: tool: skip sebool entry setup when missing
......................................................................
tool: skip sebool entry setup when missing
The sebool variable we want to configure might not be present on all
platforms.
Change-Id: Ib2379e57a33aa280504557a2ea797fe3b4ec8c1a
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm-tool/seboolsetup.py
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/27/9827/1
diff --git a/vdsm-tool/seboolsetup.py b/vdsm-tool/seboolsetup.py
index 437da68..3db52eb 100644
--- a/vdsm-tool/seboolsetup.py
+++ b/vdsm-tool/seboolsetup.py
@@ -42,6 +42,11 @@
sebool_obj.start()
for sebool_variable in VDSM_SEBOOL_LIST:
+ # The sebool_variable we want to configure might not be
+ # present on all platforms.
+ if sebool_variable not in sebool_status
+ continue
+
if status and not all(sebool_status[sebool_variable]):
sebool_obj.modify(sebool_variable, SEBOOL_ENABLED)
--
To view, visit http://gerrit.ovirt.org/9827
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2379e57a33aa280504557a2ea797fe3b4ec8c1a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Michal Skrivanek has posted comments on this change.
Change subject: vdsm: Refactoring libvirtvm & vm
......................................................................
Patch Set 2:
createing a vm/ dir may make sense, but I wouldn't go that far in creating additional subdirs there...
--
To view, visit http://gerrit.ovirt.org/10861
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I653be8e06431f1033416aa55d6cb81b4262ba6b1
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Adam Litke <agl(a)us.ibm.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Peter V. Saveliev <peet(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: Refactoring libvirtvm & vm
......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/879/ (2/2)
--
To view, visit http://gerrit.ovirt.org/10861
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I653be8e06431f1033416aa55d6cb81b4262ba6b1
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Adam Litke <agl(a)us.ibm.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Peter V. Saveliev <peet(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: Refactoring libvirtvm & vm
......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/844/ (1/2)
--
To view, visit http://gerrit.ovirt.org/10861
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I653be8e06431f1033416aa55d6cb81b4262ba6b1
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Adam Litke <agl(a)us.ibm.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Peter V. Saveliev <peet(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Vinzenz Feenstra has posted comments on this change.
Change subject: vdsm: Refactoring libvirtvm & vm
......................................................................
Patch Set 1: (4 inline comments)
....................................................
File Makefile.am
Line 87: vdsm/storage/taskManager.py \
Line 88: vdsm/storage/threadLocal.py \
Line 89: vdsm/storage/volume.py \
Line 90: vdsm/vdsm \
Line 91: vdsm/vm/*.py \
Done
Line 92: vdsm/vm/devices/*.py \
Line 93: vdsm/vm/migration/*.py \
Line 94: vdsm_api \
Line 95: vdsm_cli \
Line 104: PEP8_BLACKLIST = apiData.py,config.py,constants.py
Line 105:
Line 106: check-local:
Line 107: find . -path './.git' -prune -type f -o \
Line 108: -name '*.py' -o -name '*.py.in' | xargs $(PYFLAKES)
This is irrelevant to this patch set
Line 109: $(PEP8) --exclude="$(PEP8_BLACKLIST)" --filename '*.py,*.py.in' \
Line 110: $(PEP8_WHITELIST)
Line 111: @if test -f .gitignore; then \
Line 112: for i in `git ls-files \*.in`; do \
....................................................
File vdsm/Makefile.am
Line 58: vm/migration/__init__.py \
Line 59: vm/migration/downtime_thread.py \
Line 60: vm/migration/monitor_thread.py \
Line 61: vm/migration/source_thread.py \
Line 62: vm/notifying_domain.py \
Done
Line 63: vm/stats_thread.py \
Line 64: vm/vm.py \
Line 65: vmChannels.py \
Line 66: zombieReaper.py \
....................................................
File vdsm.spec.in
Line 645: %{_datadir}/%{vdsm_name}/vm/migration/downtime_thread.py*
Line 646: %{_datadir}/%{vdsm_name}/vm/migration/monitor_thread.py*
Line 647: %{_datadir}/%{vdsm_name}/vm/migration/source_thread.py*
Line 648: %{_datadir}/%{vdsm_name}/vm/notifying_domain.py*
Line 649: %{_datadir}/%{vdsm_name}/vm/stats_thread.py*
Done
Line 650: %{_datadir}/%{vdsm_name}/vm/vm.py*
Line 651: %{_datadir}/%{vdsm_name}/vmChannels.py*
Line 652: %{_datadir}/%{vdsm_name}/write-net-config
Line 653: %{_datadir}/%{vdsm_name}/zombieReaper.py*
--
To view, visit http://gerrit.ovirt.org/10861
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I653be8e06431f1033416aa55d6cb81b4262ba6b1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Adam Litke <agl(a)us.ibm.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Peter V. Saveliev <peet(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: vdsm: Refactoring libvirtvm & vm
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(2 inline comments)
just reviewed the first ten files.
....................................................
File vdsm/Makefile.am
Line 58: vm/migration/__init__.py \
Line 59: vm/migration/downtime_thread.py \
Line 60: vm/migration/monitor_thread.py \
Line 61: vm/migration/source_thread.py \
Line 62: vm/notifying_domain.py \
vm/states.py missing?
Line 63: vm/stats_thread.py \
Line 64: vm/vm.py \
Line 65: vmChannels.py \
Line 66: zombieReaper.py \
....................................................
File vdsm.spec.in
Line 645: %{_datadir}/%{vdsm_name}/vm/migration/downtime_thread.py*
Line 646: %{_datadir}/%{vdsm_name}/vm/migration/monitor_thread.py*
Line 647: %{_datadir}/%{vdsm_name}/vm/migration/source_thread.py*
Line 648: %{_datadir}/%{vdsm_name}/vm/notifying_domain.py*
Line 649: %{_datadir}/%{vdsm_name}/vm/stats_thread.py*
%{_datadir}/%{vdsm_name}/vm/states.py missing?
Line 650: %{_datadir}/%{vdsm_name}/vm/vm.py*
Line 651: %{_datadir}/%{vdsm_name}/vmChannels.py*
Line 652: %{_datadir}/%{vdsm_name}/write-net-config
Line 653: %{_datadir}/%{vdsm_name}/zombieReaper.py*
--
To view, visit http://gerrit.ovirt.org/10861
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I653be8e06431f1033416aa55d6cb81b4262ba6b1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Adam Litke <agl(a)us.ibm.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Peter V. Saveliev <peet(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server