Change in vdsm[master]: caps: Collect numa information
by Martin Sivak
Martin Sivák has posted comments on this change.
Change subject: caps: Collect numa information
......................................................................
Patch Set 8:
I like it. Fix Francesco's comments and it should be ready.
--
To view, visit http://gerrit.ovirt.org/23703
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I63eeb697ab986c3b9cad0dc44f41924f329e52cd
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Xiaolei Shi <xiao-lei.shi(a)hp.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfediuck(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik(a)redhat.com>
Gerrit-Reviewer: Gustavo Frederico Temple Pedrosa <gustavo.pedrosa(a)eldorado.org.br>
Gerrit-Reviewer: Leonardo Bianconi <leonardo.bianconi(a)eldorado.org.br>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Vitor de Lima <vitor.lima(a)eldorado.org.br>
Gerrit-Reviewer: Xiaolei Shi <xiao-lei.shi(a)hp.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
10 years
Change in vdsm[master]: pep8: make pep8-1.5 happy with E265
by eedri@redhat.com
Eyal Edri has posted comments on this change.
Change subject: pep8: make pep8-1.5 happy with E265
......................................................................
Patch Set 3:
still fails on other issues:
http://pastebin.com/uMaXEfaT
--
To view, visit http://gerrit.ovirt.org/26248
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I91c49e1c0f36590b8052462b9e066c110eacd67b
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets(a)redhat.com>
Gerrit-Reviewer: Eyal Edri <eedri(a)redhat.com>
Gerrit-Reviewer: Ohad Basan <obasan(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
10 years
Change in vdsm[master]: pep8: virt cleanups for pep8-1.5
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: pep8: virt cleanups for pep8-1.5
......................................................................
pep8: virt cleanups for pep8-1.5
virt is now pep8-1.5 clean
Change-Id: I2ffcb5c7601cad74741fce07301ddb458cd6679f
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/sampling.py
M vdsm/virt/vm.py
2 files changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/26347/1
diff --git a/vdsm/virt/sampling.py b/vdsm/virt/sampling.py
index 6ff0641..991c969 100644
--- a/vdsm/virt/sampling.py
+++ b/vdsm/virt/sampling.py
@@ -476,7 +476,7 @@
for ifid, ifrate in zip(self._ifids, self._ifrates):
# it skips hot-plugged devices if we haven't enough information
# to count stats from it
- if not ifid in hs0.interfaces:
+ if ifid not in hs0.interfaces:
continue
ifrate = ifrate or 1000
Mbps2Bps = (10 ** 6) / 8
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 3c2fcbe..f389715 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1107,7 +1107,7 @@
# This hack is for backward compatibility as the libvirt
# does not allow 'qemu64' guest on intel hardware
- if model == 'qemu64' and not '+svm' in features:
+ if model == 'qemu64' and '+svm' not in features:
features += ['-svm']
for feature in features[1:]:
@@ -1241,7 +1241,7 @@
if self.conf.get('keyboardLayout'):
graphicsAttrs['keymap'] = self.conf['keyboardLayout']
- if not 'spiceDisableTicketing' in self.conf:
+ if 'spiceDisableTicketing' not in self.conf:
graphicsAttrs['passwd'] = '*****'
graphicsAttrs['passwdValidTo'] = '1970-01-01T00:00:01'
@@ -4869,8 +4869,8 @@
for dev in self.conf['devices']:
if ((dev['type'] == CONTROLLER_DEVICES) and
(dev['device'] == device) and
- (not 'index' in dev or dev['index'] == index) and
- (not 'model' in dev or dev['model'] == model)):
+ ('index' not in dev or dev['index'] == index) and
+ ('model' not in dev or dev['model'] == model)):
dev['address'] = address
dev['alias'] = alias
knownDev = True
--
To view, visit http://gerrit.ovirt.org/26347
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ffcb5c7601cad74741fce07301ddb458cd6679f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
10 years
Change in vdsm[master]: vds-tool: keep env on sysV service
by mtayer@redhat.com
mooli tayer has uploaded a new change for review.
Change subject: vds-tool: keep env on sysV service
......................................................................
vds-tool: keep env on sysV service
Update env when SYSTEMCTL_SKIP_REDIRECT is set instead of dropping
it.
Change-Id: Ifc97301d26cbae4ed0aafff4d2edc398806e03f2
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1081621
Signed-off-by: Donn Seeley <donn.seeley(a)windriver.com>
Signed-off-by: Mooli Tayer <mtayer(a)redhat.com>
---
M lib/vdsm/tool/service.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/55/26255/1
diff --git a/lib/vdsm/tool/service.py b/lib/vdsm/tool/service.py
index 6793ef3..444ef80 100644
--- a/lib/vdsm/tool/service.py
+++ b/lib/vdsm/tool/service.py
@@ -263,7 +263,8 @@
except OSError:
pass
else:
- _sysvEnv = {'SYSTEMCTL_SKIP_REDIRECT': '1'}
+ _sysvEnv = os.environ.copy()
+ _sysvEnv['SYSTEMCTL_SKIP_REDIRECT'] = '1'
_execSysvEnv = functools.partial(execCmd, env=_sysvEnv)
@_sysvNative
--
To view, visit http://gerrit.ovirt.org/26255
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc97301d26cbae4ed0aafff4d2edc398806e03f2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer(a)redhat.com>
10 years
Change in vdsm[master]: pep8: make pep8-1.5 happy with E241
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: pep8: make pep8-1.5 happy with E241
......................................................................
pep8: make pep8-1.5 happy with E241
Change-Id: Ieaa71ec0adc2fdeff4f5530220d0f55c619bd726
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/qemuImg.py
M tests/guestagentTests.py
M tests/vmTests.py
M vdsm/configNetwork.py
M vdsm/storage/hsm.py
M vdsm/virt/vm.py
6 files changed, 17 insertions(+), 17 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/26249/1
diff --git a/lib/vdsm/qemuImg.py b/lib/vdsm/qemuImg.py
index 3869bd7..2124281 100644
--- a/lib/vdsm/qemuImg.py
+++ b/lib/vdsm/qemuImg.py
@@ -34,12 +34,12 @@
VMDK = "vmdk"
__iregex = {
- 'format': re.compile("^file format: (?P<value>\w+)$"),
- 'virtualsize': re.compile("^virtual size: "
- "[\d.]+[KMGT] \((?P<value>\d+) bytes\)$"),
- 'clustersize': re.compile("^cluster_size: (?P<value>\d+)$"),
- 'backingfile': re.compile("^backing file: (?P<value>.+) \(actual path"),
- 'offset': re.compile("^Image end offset: (?P<value>\d+)$"),
+ 'format': re.compile("^file format: (?P<value>\w+)$"),
+ 'virtualsize': re.compile("^virtual size: "
+ "[\d.]+[KMGT] \((?P<value>\d+) bytes\)$"),
+ 'clustersize': re.compile("^cluster_size: (?P<value>\d+)$"),
+ 'backingfile': re.compile("^backing file: (?P<value>.+) \(actual path"),
+ 'offset': re.compile("^Image end offset: (?P<value>\d+)$"),
}
diff --git a/tests/guestagentTests.py b/tests/guestagentTests.py
index 63badef..df4bfc3 100644
--- a/tests/guestagentTests.py
+++ b/tests/guestagentTests.py
@@ -91,13 +91,13 @@
invalid = u"\u0000"
self.assertEqual(u'\ufffd', guestagent._filterXmlChars(invalid))
invalid2 = u"\uffff"
- self.assertEqual(u'\ufffd', guestagent._filterXmlChars(invalid2))
+ self.assertEqual(u'\ufffd', guestagent._filterXmlChars(invalid2))
invalid3 = u"\ufffe"
- self.assertEqual(u'\ufffd', guestagent._filterXmlChars(invalid3))
+ self.assertEqual(u'\ufffd', guestagent._filterXmlChars(invalid3))
invalid4 = u"\ud800"
- self.assertEqual(u'\ufffd', guestagent._filterXmlChars(invalid4))
+ self.assertEqual(u'\ufffd', guestagent._filterXmlChars(invalid4))
invalid5 = u"\udc79"
- self.assertEqual(u'\ufffd', guestagent._filterXmlChars(invalid5))
+ self.assertEqual(u'\ufffd', guestagent._filterXmlChars(invalid5))
def test_filterObject(self):
ILLEGAL_DATA = {u"foo": u"\x00data\x00test\uffff\ufffe\ud800\udc79"}
diff --git a/tests/vmTests.py b/tests/vmTests.py
index 552a1a7..d6e6e40 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -681,7 +681,7 @@
@MonkeyPatch(constants, 'SMBIOS_MANUFACTURER', 'oVirt')
@MonkeyPatch(constants, 'SMBIOS_OSNAME', 'oVirt Node')
@MonkeyPatch(libvirtconnection, 'get', lambda x: ConnectionMock())
- @MonkeyPatch(utils, 'getHostUUID',
+ @MonkeyPatch(utils, 'getHostUUID',
lambda: "fc25cbbe-5520-4f83-b82e-1541914753d9")
def testBuildCmdLineX86_64(self):
self.assertBuildCmdLine(CONF_TO_DOMXML_X86_64)
@@ -690,7 +690,7 @@
@MonkeyPatch(caps, 'osversion', lambda: {
'release': '1', 'version': '18', 'name': 'Fedora'})
@MonkeyPatch(libvirtconnection, 'get', lambda x: ConnectionMock())
- @MonkeyPatch(utils, 'getHostUUID',
+ @MonkeyPatch(utils, 'getHostUUID',
lambda: "fc25cbbe-5520-4f83-b82e-1541914753d9")
def testBuildCmdLinePPC64(self):
self.assertBuildCmdLine(CONF_TO_DOMXML_PPC64)
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 2b6162b..c4b21b7 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -351,7 +351,7 @@
implicitBonding=False, _netinfo=_netinfo)
-def _validateDelNetwork(network, vlan, bonding, nics, bridged, _netinfo):
+def _validateDelNetwork(network, vlan, bonding, nics, bridged, _netinfo):
if bonding:
if set(nics) != set(_netinfo.bondings[bonding]["slaves"]):
raise ConfigNetworkError(ne.ERR_BAD_NIC, 'delNetwork: %s are '
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 5666108..0ebe129 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2369,7 +2369,7 @@
doms = self.__prefetchDomains(domType, conObj)
except:
self.log.debug("prefetch failed: %s",
- sdCache.knownSDs, exc_info=True)
+ sdCache.knownSDs, exc_info=True)
else:
# Any pre-existing domains in sdCache stand the chance of
# being invalid, since there is no way to know what happens
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index b9faa1a..dda919b 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3947,9 +3947,9 @@
def _vmConfForMemorySnapshot():
"""Returns the needed vm configuration with the memory snapshot"""
- return {'restoreFromSnapshot': True,
- '_srcDomXML': self._dom.XMLDesc(0),
- 'elapsedTimeOffset': time.time() - self._startTime}
+ return {'restoreFromSnapshot': True,
+ '_srcDomXML': self._dom.XMLDesc(0),
+ 'elapsedTimeOffset': time.time() - self._startTime}
def _padMemoryVolume(memoryVolPath, spType, sdUUId):
if spType == sd.NFS_DOMAIN:
--
To view, visit http://gerrit.ovirt.org/26249
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieaa71ec0adc2fdeff4f5530220d0f55c619bd726
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
10 years
Change in vdsm[master]: pep8: make pep8-1.5 happy with E265
by Dan Kenigsberg
Dan Kenigsberg has submitted this change and it was merged.
Change subject: pep8: make pep8-1.5 happy with E265
......................................................................
pep8: make pep8-1.5 happy with E265
Change-Id: I91c49e1c0f36590b8052462b9e066c110eacd67b
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/26248
Reviewed-by: mooli tayer <mtayer(a)redhat.com>
Reviewed-by: Dima Kuznetsov <dkuznets(a)redhat.com>
---
M client/vdsClient.py
M doc/conf.py
M lib/vdsm/define.py
M lib/vdsm/qemuImg.py
M lib/vdsm/utils.py
M lib/yajsonrpc/protonReactor.py
M tests/configNetworkTests.py
M tests/functional/networkTests.py
M tests/miscTests.py
M tests/mkimageTests.py
M tests/netconfTests.py
M tests/schemaTests.py
M tests/tcTests.py
M vds_bootstrap/vds_bootstrap.py
M vds_bootstrap/vds_bootstrap_complete.py
M vdsm/clientIF.py
M vdsm/gluster/cli.py
M vdsm/gluster/exception.py
M vdsm/kaxmlrpclib.py
M vdsm/network/sourceroute.py
M vdsm/storage/blockSD.py
M vdsm/storage/devicemapper.py
M vdsm/storage/image.py
M vdsm/storage/iscsi.py
M vdsm/storage/iscsiadm.py
M vdsm/storage/misc.py
M vdsm/storage/persistentDict.py
M vdsm/storage/resourceManager.py
M vdsm/storage/sp.py
M vdsm/storage/spbackends.py
M vdsm/storage/storage_exception.py
M vdsm/storage/storage_mailbox.py
M vdsm/virt/vm.py
M vdsm_api/process-schema.py
M vdsm_hooks/hostusb/after_vm_destroy.py
M vdsm_hooks/hostusb/before_vm_start.py
M vdsm_hooks/promisc/after_vm_start.py
M vdsm_hooks/vmfex/before_vm_migrate_destination.py
M vdsm_hooks/vmfex/before_vm_start.py
M vdsm_hooks/vmfex_dev/vmfex_vnic.py
M vdsm_reg/createDaemon.py
M vdsm_reg/deployUtil.py.in
42 files changed, 201 insertions(+), 202 deletions(-)
Approvals:
mooli tayer: Looks good to me, but someone else must approve
Dima Kuznetsov: Looks good to me, but someone else must approve
Dan Kenigsberg: Verified; Looks good to me, approved
--
To view, visit http://gerrit.ovirt.org/26248
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I91c49e1c0f36590b8052462b9e066c110eacd67b
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets(a)redhat.com>
Gerrit-Reviewer: Eyal Edri <eedri(a)redhat.com>
Gerrit-Reviewer: Ohad Basan <obasan(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
10 years
Change in vdsm[master]: pep8: make pep8-1.5 happy with E265
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: pep8: make pep8-1.5 happy with E265
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit http://gerrit.ovirt.org/26248
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I91c49e1c0f36590b8052462b9e066c110eacd67b
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets(a)redhat.com>
Gerrit-Reviewer: Eyal Edri <eedri(a)redhat.com>
Gerrit-Reviewer: Ohad Basan <obasan(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
10 years
Re: [oVirt Jenkins] vdsm_unit_tests - Build # 2873 - Failure!
by Dan Kenigsberg
On Tue, Apr 01, 2014 at 10:03:44PM +0100, Jenkins ci oVirt Server wrote:
> Project: http://jenkins.ovirt.org/job/vdsm_unit_tests/
> Build: http://jenkins.ovirt.org/job/vdsm_unit_tests/2873/
> Build Number: 2873
> Build Status: Failure
> Triggered By: Started by an SCM change
>
> -------------------------------------
> Changes Since Last Success:
> -------------------------------------
> Changes for Build #2873
> [Yaniv Bronhaim] Initial commit for vdsm-tool testing infrastructure
>
>
>
>
> -----------------
> Failed Tests:
> -----------------
> All tests passed
>
David, has there been a change of the pyflakes version on this slave?
The mentioned code lines are ancient.
find . -path './.git' -prune -type f -o \
-name '*.py' -o -name '*.py.in' | xargs /usr/bin/pyflakes | \
grep -w -v "\./vdsm/storage/lvm\.py.*: list comprehension redefines 'lv' from line .*" | \
while read LINE; do echo "$LINE"; false; done
./vdsm_reg/engine.py.in:151: local variable 'item' is assigned to but never used
./vdsm_reg/engine.py:151: local variable 'item' is assigned to but never used
./vdsm/network/sourceroute.py:159: list comprehension redefines 'rule' from line 152
./vdsm/clientIF.py:492: list comprehension redefines 'vm' from line 482
10 years
Change in vdsm[master]: Initial commit for vdsm-tool testing infrastructure
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Initial commit for vdsm-tool testing infrastructure
......................................................................
Initial commit for vdsm-tool testing infrastructure
Running in make check, flexible in modifying the configuration files as
required for the specific test.
Change-Id: Iae0fec9b2057c5ba932f38ed5d34d654486043ef
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M .gitignore
M lib/vdsm/tool/Makefile.am
M lib/vdsm/tool/configurator.py
M lib/vdsm/tool/libvirt_configure.sh.in
A lib/vdsm/tool/tests.py
A lib/vdsm/tool/tests/libvirtd
A lib/vdsm/tool/tests/libvirtd.conf
A lib/vdsm/tool/tests/qemu-sanlock.conf
A lib/vdsm/tool/tests/qemu.conf
9 files changed, 134 insertions(+), 18 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/25263/1
diff --git a/.gitignore b/.gitignore
index 6c41d2b..4962e04 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,6 +37,7 @@
lib/vdsm/tool/libvirt_configure.sh
lib/vdsm/tool/load_needed_modules.py
lib/vdsm/tool/validate_ovirt_certs.py
+lib/vdsm/tool/tests/vdsm.conf
lib/vdsm/vdscli.py
lib/vdsm/vdsm.conf.sample
results.log
diff --git a/lib/vdsm/tool/Makefile.am b/lib/vdsm/tool/Makefile.am
index 0198310..15972db 100644
--- a/lib/vdsm/tool/Makefile.am
+++ b/lib/vdsm/tool/Makefile.am
@@ -50,8 +50,15 @@
vdsm-id.py \
$(NULL)
+dist_noinst_PYTHON = \
+ tests.py \
+ $(NULL)
+
CLEANFILES = \
config.log \
$(nodist_vdsmtool_PYTHON) \
$(nodist_vdsmexec_SCRIPTS) \
$(NULL)
+
+check-local:
+ nosetests -v tests.py
diff --git a/lib/vdsm/tool/configurator.py b/lib/vdsm/tool/configurator.py
index c3263de..f82c427 100644
--- a/lib/vdsm/tool/configurator.py
+++ b/lib/vdsm/tool/configurator.py
@@ -52,8 +52,12 @@
class LibvirtModuleConfigure(_ModuleConfigure):
- def __init__(self):
+ def __init__(self, conf_files=None):
super(LibvirtModuleConfigure, self).__init__()
+ self.testenv = conf_files
+
+ def modifyConfFiles(self, conf_files):
+ self.testenv = conf_files
def getName(self):
return 'libvirt'
@@ -65,19 +69,18 @@
"""
Invoke libvirt_configure.sh script
"""
- if os.getuid() != 0:
+ if self.testenv is None and os.getuid() != 0:
raise UserWarning("Must run as root")
- rc, out, err = utils.execCmd(
- (
- os.path.join(
- P_VDSM_EXEC,
- 'libvirt_configure.sh'
- ),
- action,
- ),
- raw=True,
- )
+ cmd = []
+ if self.testenv:
+ cmd.append(os.path.realpath('libvirt_configure.sh'))
+ else:
+ cmd.append(os.path.join(P_VDSM_EXEC, 'libvirt_configure.sh'))
+ cmd.append(action)
+
+ rc, out, err = utils.execCmd(cmd, env=self.testenv, raw=True)
+
sys.stdout.write(out)
sys.stderr.write(err)
if rc != 0:
diff --git a/lib/vdsm/tool/libvirt_configure.sh.in b/lib/vdsm/tool/libvirt_configure.sh.in
index 88b4080..dd40ae4 100755
--- a/lib/vdsm/tool/libvirt_configure.sh.in
+++ b/lib/vdsm/tool/libvirt_configure.sh.in
@@ -23,13 +23,26 @@
ENABLE_LIBVIRT_SANLOCK="@ENABLE_LIBVIRT_SANLOCK@"
ENABLE_LIBVIRT_SELINUX="@ENABLE_LIBVIRT_SELINUX@"
-GETCONFITEM="@VDSMDIR@/get-conf-item"
-VDSM_CONF_FILE="@CONFDIR(a)/vdsm.conf"
QEMU_DUMP_PATH="/var/log/core"
-LCONF="@sysconfdir(a)/libvirt/libvirtd.conf"
-QCONF="@sysconfdir(a)/libvirt/qemu.conf"
-LDCONF="@LIBVIRT_SERVICE_DEFAULT@"
-QLCONF="@sysconfdir(a)/libvirt/qemu-sanlock.conf"
+# prefer env vars if exist. otherwise take defaults (mostley for testings)
+if [ "${VDSM_CONF_FILE}" = '' ]; then
+ VDSM_CONF_FILE="@CONFDIR(a)/vdsm.conf"
+fi
+if [ "${GETCONFITEM}" = '' ]; then
+ GETCONFITEM="@VDSMDIR@/get-conf-item"
+fi
+if [ "${LCONF}" = '' ]; then
+ LCONF="@sysconfdir(a)/libvirt/libvirtd.conf"
+fi
+if [ "${QCONF}" = '' ]; then
+ QCONF="@sysconfdir(a)/libvirt/qemu.conf"
+fi
+if [ "${LDCONF}" = '' ]; then
+ LDCONF="@LIBVIRT_SERVICE_DEFAULT@"
+fi
+if [ "${QLCONF}" = '' ]; then
+ QLCONF="@sysconfdir(a)/libvirt/qemu-sanlock.conf"
+fi
# The PACKAGE_VERSION define is not used here because we do not want to
# update the libvirt configure file every time we change vdsm package
diff --git a/lib/vdsm/tool/tests.py b/lib/vdsm/tool/tests.py
new file mode 100644
index 0000000..9042780
--- /dev/null
+++ b/lib/vdsm/tool/tests.py
@@ -0,0 +1,61 @@
+#
+# Copyright 2014 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 configurator
+from unittest import TestCase
+
+test_conf_files = {}
+test_conf_files['LCONF'] = 'tests/libvirtd.conf'
+test_conf_files['QCONF'] = 'tests/qemu.conf'
+test_conf_files['LDCONF'] = 'tests/qemu-sanlock.conf'
+test_conf_files['QLCONF'] = 'tests/libvirtd'
+test_conf_files['VDSM_CONF_FILE'] = 'tests/vdsm.conf'
+test_conf_files['GETCONFITEM'] = '../../../vdsm/get-conf-item'
+
+configurator.__configurers[0].modifyConfFiles(test_conf_files)
+
+sample_config = {}
+sample_config['withssl'] = """
+[vars]
+ssl = true
+"""
+
+sample_config['withnossl'] = """
+[vars]
+ssl = false
+"""
+
+
+class configuratorTests(TestCase):
+ def setUp(self):
+ pass
+
+ def testInValidateiSSLConfig(self):
+ with open(test_conf_files['VDSM_CONF_FILE'], 'w') as f:
+ f.write(sample_config['withssl'])
+
+ lconf = configurator.LibvirtModuleConfigure(test_conf_files)
+ self.assertTrue(lconf.validate())
+
+ def testValidSSLConfig(self):
+ with open(test_conf_files['VDSM_CONF_FILE'], 'w') as f:
+ f.write(sample_config['withnossl'])
+
+ lconf = configurator.LibvirtModuleConfigure(test_conf_files)
+ self.assertFalse(lconf.validate())
diff --git a/lib/vdsm/tool/tests/libvirtd b/lib/vdsm/tool/tests/libvirtd
new file mode 100644
index 0000000..d41018f
--- /dev/null
+++ b/lib/vdsm/tool/tests/libvirtd
@@ -0,0 +1,4 @@
+## beginning of configuration section by vdsm-4.13.0
+LIBVIRTD_ARGS=--listen
+DAEMON_COREFILE_LIMIT=unlimited
+## end of configuration section by vdsm-4.13.0
diff --git a/lib/vdsm/tool/tests/libvirtd.conf b/lib/vdsm/tool/tests/libvirtd.conf
new file mode 100644
index 0000000..7bb1e75
--- /dev/null
+++ b/lib/vdsm/tool/tests/libvirtd.conf
@@ -0,0 +1,13 @@
+## beginning of configuration section by vdsm-4.13.0
+listen_addr="0.0.0.0"
+unix_sock_group="qemu"
+unix_sock_rw_perms="0770"
+auth_unix_rw="sasl"
+host_uuid="72d18a98-8d96-4687-967a-72d989d3b65f"
+keepalive_interval=-1
+log_outputs="1:file:/var/log/libvirt/libvirtd.log"
+log_filters="3:virobject 3:virfile 2:virnetlink 3:cgroup 3:event 3:json 1:libvirt 1:util 1:qemu"
+ca_file="/etc/pki/vdsm/certs/cacert.pem"
+cert_file="/etc/pki/vdsm/certs/vdsmcert.pem"
+key_file="/etc/pki/vdsm/keys/vdsmkey.pem"
+## end of configuration section by vdsm-4.13.0
diff --git a/lib/vdsm/tool/tests/qemu-sanlock.conf b/lib/vdsm/tool/tests/qemu-sanlock.conf
new file mode 100644
index 0000000..20b5f8c
--- /dev/null
+++ b/lib/vdsm/tool/tests/qemu-sanlock.conf
@@ -0,0 +1,4 @@
+## beginning of configuration section by vdsm-4.13.0
+auto_disk_leases=0
+require_lease_for_disks=0
+## end of configuration section by vdsm-4.13.0
diff --git a/lib/vdsm/tool/tests/qemu.conf b/lib/vdsm/tool/tests/qemu.conf
new file mode 100644
index 0000000..0c7adb5
--- /dev/null
+++ b/lib/vdsm/tool/tests/qemu.conf
@@ -0,0 +1,10 @@
+## beginning of configuration section by vdsm-4.13.0
+dynamic_ownership=0
+spice_tls=1
+save_image_format="lzop"
+spice_tls_x509_cert_dir="/etc/pki/vdsm/libvirt-spice"
+remote_display_port_min=5900
+remote_display_port_max=6923
+lock_manager="sanlock"
+auto_dump_path="/var/log/core"
+## end of configuration section by vdsm-4.13.0
--
To view, visit http://gerrit.ovirt.org/25263
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae0fec9b2057c5ba932f38ed5d34d654486043ef
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
10 years
Change in vdsm[master]: autogen.sh: deprecate --system
by Douglas Schilling Landgraf
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: autogen.sh: deprecate --system
......................................................................
autogen.sh: deprecate --system
The original goal for autogen.sh script is generate the scripts to build the
project and not run it. However, we provide graciously to users the option
--system that sets prefix=/usr, libdir=$prefix/lib (or lib64), sysconfdir=/etc
and localstatedir=/var. The problem is that users must know that --system exist
if they run without this option the build might contain paths like:
/usr/local/var/log/vdsm instead of /var/log/vdsm. Another point, if users
want to run autogen.sh is because they want to set automatic the options,
otherwise they would run ./configure manually with all options they want.
This patch keeps the current behavior of autogen.sh, but sets the options
mentioned above even if the user does not provide the --system option.
Change-Id: I74bf8971339a242aa5475a7efbbf4f40051ef293
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M autogen.sh
1 file changed, 36 insertions(+), 18 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/25804/1
diff --git a/autogen.sh b/autogen.sh
index 2f5b499..6f7b106 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,30 +1,48 @@
#!/bin/sh
+#
+# Copyright 2009-2014 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
+#
autoreconf -if
+prefix=/usr
+libdir=$prefix/lib
+sysconfdir=/etc
+localstatedir=/var
+if [ -d /usr/lib64 ]; then
+ libdir=$prefix/lib64
+fi
+
if test "x$1" = "x--system"; then
+ echo "Please note: --system is deprecated!"
shift
- prefix=/usr
- libdir=$prefix/lib
- sysconfdir=/etc
- localstatedir=/var
- if [ -d /usr/lib64 ]; then
- libdir=$prefix/lib64
- fi
- EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir"
- echo "Running ./configure with $EXTRA_ARGS $@"
-else
- if test -z "$*" && test ! -f "$THEDIR/config.status"; then
- echo "I am going to run ./configure with no arguments - if you wish "
- echo "to pass any to it, please specify them on the $0 command line."
- fi
fi
if test -z "$*" && test -f config.status; then
./config.status --recheck
else
+ EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir"
+ echo "Running ./configure with $EXTRA_ARGS $@"
./configure $EXTRA_ARGS "$@"
-fi && {
- echo
- echo "Now type 'make' to compile vdsm."
-}
+fi
+
+echo
+echo "Additional commands:"
+echo "type 'make' to compile vdsm."
+echo "type 'make rpm' to generate vdsm rpms"
--
To view, visit http://gerrit.ovirt.org/25804
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I74bf8971339a242aa5475a7efbbf4f40051ef293
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
10 years