Change in vdsm[master]: New hook that disables mac spoof filtering
by amuller@redhat.com
Assaf Muller has uploaded a new change for review.
Change subject: New hook that disables mac spoof filtering
......................................................................
New hook that disables mac spoof filtering
'macspoof' is a new hook that disables mac spoof filtering on a
VM basis.
Change-Id: I437d114dbd596e5f7e1a302a8f95c2ecdc4b4347
Signed-off-by: Assaf Muller <amuller(a)redhat.com>
---
M configure.ac
M vdsm.spec.in
M vdsm_hooks/Makefile.am
A vdsm_hooks/macspoof/Makefile.am
A vdsm_hooks/macspoof/README
A vdsm_hooks/macspoof/before_vm_start.py
6 files changed, 124 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/12833/1
diff --git a/configure.ac b/configure.ac
index 434d209..a86e0b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -200,6 +200,7 @@
vdsm_hooks/hostusb/Makefile
vdsm_hooks/hugepages/Makefile
vdsm_hooks/isolatedprivatevlan/Makefile
+ vdsm_hooks/macspoof/Makefile
vdsm_hooks/Makefile
vdsm_hooks/nestedvt/Makefile
vdsm_hooks/numa/Makefile
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 38838ea..99944c9 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -284,6 +284,13 @@
VDSM hook enable user to add storage LUN for VDSM
without the sharing and storage handling of VDSM.
+%package hook-macspoof
+Summary: Disables MAC spoofing filtering
+BuildArch: noarch
+
+%description hook-macspoof
+VDSM hook that disables mac spoof filtering on all the of the VM's interfaces.
+
%package hook-fileinject
Summary: Allow uploading file to VMs disk
BuildArch: noarch
@@ -866,6 +873,10 @@
%{_libexecdir}/%{vdsm_name}/hooks/before_vm_dehibernate/50_vhostmd
%{_libexecdir}/%{vdsm_name}/hooks/after_vm_destroy/50_vhostmd
+%files hook-macspoof
+%defattr(-, root, root, -)
+%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_macspoof
+
%files hook-qemucmdline
%defattr(-, root, root, -)
%doc COPYING
diff --git a/vdsm_hooks/Makefile.am b/vdsm_hooks/Makefile.am
index 0e27a98..b417271 100644
--- a/vdsm_hooks/Makefile.am
+++ b/vdsm_hooks/Makefile.am
@@ -31,6 +31,7 @@
hostusb \
hugepages \
isolatedprivatevlan \
+ macspoof \
nestedvt \
numa \
pincpu \
diff --git a/vdsm_hooks/macspoof/Makefile.am b/vdsm_hooks/macspoof/Makefile.am
new file mode 100644
index 0000000..68c70f9
--- /dev/null
+++ b/vdsm_hooks/macspoof/Makefile.am
@@ -0,0 +1,31 @@
+#
+# Copyright 2013 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
+#
+
+EXTRA_DIST = \
+ before_vm_start.py
+
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)$(vdsmhooksdir)/before_vm_start
+ $(INSTALL_SCRIPT) $(srcdir)/before_vm_start.py \
+ $(DESTDIR)$(vdsmhooksdir)/before_vm_start/50_macspoof
+
+uninstall-local:
+ $(RM) $(DESTDIR)$(vdsmhooksdir)/before_vm_start/50_macspoof
+
diff --git a/vdsm_hooks/macspoof/README b/vdsm_hooks/macspoof/README
new file mode 100644
index 0000000..e82b2f0
--- /dev/null
+++ b/vdsm_hooks/macspoof/README
@@ -0,0 +1,13 @@
+macspoof vdsm hook
+=================================
+This hook goes through all of the VM's interfaces and removes MAC and ARP spoofing filtering.
+
+Installation:
+* Use the engine-config to append the appropriate custom property as such:
+ sudo engine-config -s UserDefinedVMProperties='previousProperties;macspoof=^(true|false)$' --cver=3.2
+
+* Verify that the macspoof custom property was properly added:
+ sudo engine-config -g UserDefinedVMProperties
+
+Usage:
+In the VM configuration window, open the custom properites tab and add macspoof=true
diff --git a/vdsm_hooks/macspoof/before_vm_start.py b/vdsm_hooks/macspoof/before_vm_start.py
new file mode 100755
index 0000000..fde594e
--- /dev/null
+++ b/vdsm_hooks/macspoof/before_vm_start.py
@@ -0,0 +1,67 @@
+#!/usr/bin/python
+
+import os
+import hooking
+
+
+def removeMacSpoofingFilter(interface):
+ for filterElement in interface.getElementsByTagName('filterref'):
+ if isMacSpoofingFilter(filterElement):
+ removeFilter(interface, filterElement)
+
+
+def isMacSpoofingFilter(filterElement):
+ """
+ Accept a filter DOM element
+ and checks if it's a mac spoofing/ARP spoofing filter
+ """
+ filterValue = filterElement.getAttribute('filter')
+ return filterValue == 'vdsm-no-mac-spoofing' or \
+ filterValue == 'vdsm-no-arp-mac-spoofing'
+
+
+def removeFilter(interface, filterElement):
+ """
+ Accept an interface DOM element
+ and a filter DOM element and remove the filter from the DOM.
+ """
+ interface.removeChild(filterElement)
+
+
+def main():
+
+ if 'macspoof' in os.environ and os.environ.get('macspoof') == 'true':
+ domxml = hooking.read_domxml()
+
+ for interface in domxml.getElementsByTagName('interface'):
+ removeMacSpoofingFilter(interface)
+
+ hooking.write_domxml(domxml)
+
+
+def test():
+ import xml.dom
+
+ interface = xml.dom.minidom.parseString("""
+ <interface type="bridge">
+ <address bus="0x00" domain="0x0000" function="0x0" slot="0x03"\
+ type="pci"/>
+ <mac address="00:1a:4a:16:01:b0"/>
+ <model type="virtio"/>
+ <source bridge="ovirtmgmt"/>
+ <filterref filter="vdsm-no-mac-spoofing"/>
+ <link state="up"/>
+ <boot order="1"/>
+ </interface>
+ """).getElementsByTagName('interface')[0]
+
+ print "Interface before removing filter: %s" % \
+ interface.toxml(encoding='UTF-8')
+
+ removeMacSpoofingFilter(interface)
+ print "Interface after removing filter: %s" % \
+ interface.toxml(encoding='UTF-8')
+
+
+if __name__ == '__main__':
+ main()
--
To view, visit http://gerrit.ovirt.org/12833
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I437d114dbd596e5f7e1a302a8f95c2ecdc4b4347
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: Removed redundant check for arp spoof filtering.
by amuller@redhat.com
Assaf Muller has uploaded a new change for review.
Change subject: Removed redundant check for arp spoof filtering.
......................................................................
Removed redundant check for arp spoof filtering.
Change-Id: Id218946cc8b9c54323018a7fd331d10166cfaae8
Signed-off-by: Assaf Muller <amuller(a)redhat.com>
---
M vdsm_hooks/macspoof/before_vm_start.py
1 file changed, 2 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/13048/1
diff --git a/vdsm_hooks/macspoof/before_vm_start.py b/vdsm_hooks/macspoof/before_vm_start.py
index 4949f6d..bd71a0f 100755
--- a/vdsm_hooks/macspoof/before_vm_start.py
+++ b/vdsm_hooks/macspoof/before_vm_start.py
@@ -13,11 +13,10 @@
def isMacSpoofingFilter(filterElement):
"""
Accept a filter DOM element
- and checks if it's a mac spoofing/ARP spoofing filter
+ and checks if it's a mac spoofing filter
"""
filterValue = filterElement.getAttribute('filter')
- return filterValue in ('vdsm-no-mac-spoofing',
- 'vdsm-no-arp-mac-spoofing')
+ return filterValue == 'vdsm-no-mac-spoofing'
def removeFilter(interface, filterElement):
--
To view, visit http://gerrit.ovirt.org/13048
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id218946cc8b9c54323018a7fd331d10166cfaae8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller(a)redhat.com>
11 years, 2 months
Change in vdsm[ovirt-3.2]: Do not delete the template when zeroing a dependant image.
by ewarszaw@redhat.com
Hello Ayal Baron, Yeela Kaplan, Haim Ateya, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/13028
to review the following change.
Change subject: Do not delete the template when zeroing a dependant image.
......................................................................
Do not delete the template when zeroing a dependant image.
Change-Id: I9e472334efa9dadb5389db70b0953f88b9be858a
Bug-url: https://bugzilla.redhat.com/show_bug.cgi?id=910013
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/12178
Tested-by: Haim Ateya <hateya(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
Reviewed-by: Yeela Kaplan <ykaplan(a)redhat.com>
Reviewed-by: Ayal Baron <abaron(a)redhat.com>
---
M vdsm/storage/blockSD.py
M vdsm/storage/hsm.py
2 files changed, 10 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/28/13028/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 862e413..e66256d 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -945,14 +945,20 @@
self.log.debug("removed image dir: %s", imgPath)
return imgPath
+ def _getImgExclusiveVols(self, imgUUID, volsImgs):
+ """Filter vols belonging to imgUUID only."""
+ exclusives = dict((vName, v) for vName, v in volsImgs.iteritems()
+ if v.imgs[0] == imgUUID)
+ return exclusives
+
def deleteImage(self, sdUUID, imgUUID, volsImgs):
- toDel = tuple(vName for vName, v in volsImgs.iteritems()
- if v.imgs[0] == imgUUID)
+ toDel = self._getImgExclusiveVols(imgUUID, volsImgs)
deleteVolumes(sdUUID, toDel)
self.rmDCImgDir(imgUUID, volsImgs)
def zeroImage(self, sdUUID, imgUUID, volsImgs):
- zeroImgVolumes(sdUUID, imgUUID, volsImgs)
+ toZero = self._getImgExclusiveVols(imgUUID, volsImgs)
+ zeroImgVolumes(sdUUID, imgUUID, toZero)
self.rmDCImgDir(imgUUID, volsImgs)
def getAllVolumes(self):
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 8bbe3b8..32a32c9 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1455,7 +1455,7 @@
# postZero implies block domain. Backup domains are always NFS
# hence no need to create fake template if postZero is true.
self._spmSchedule(spUUID, "zeroImage_%s" % imgUUID, dom.zeroImage,
- sdUUID, imgUUID, volsByImg.keys())
+ sdUUID, imgUUID, volsByImg)
else:
dom.deleteImage(sdUUID, imgUUID, volsByImg)
# This is a hack to keep the interface consistent
--
To view, visit http://gerrit.ovirt.org/13028
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e472334efa9dadb5389db70b0953f88b9be858a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.2
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Haim Ateya <hateya(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: vdsm_hooks: Add support for checkimages VDSM hook
by Jan Lieskovsky
Jan Lieskovsky has uploaded a new change for review.
Change subject: vdsm_hooks: Add support for checkimages VDSM hook
......................................................................
vdsm_hooks: Add support for checkimages VDSM hook
Introduce the checkimages VDSM hook - perform consistency
check on a qcow2 format disk image using the QEMU disk
image utility.
VDSM hook alternative to the validateImage SPM command.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=611183
Change-Id: Ib4d88fb46a725d2c525d10ce2fcc808bba5b0ab4
Signed-off-by: Jan Lieskovsky <jlieskov(a)redhat.com>
---
M configure.ac
M vdsm.spec.in
M vdsm_hooks/Makefile.am
A vdsm_hooks/checkimages/Makefile.am
A vdsm_hooks/checkimages/README
A vdsm_hooks/checkimages/before_vm_start.py
6 files changed, 155 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/54/9154/1
diff --git a/configure.ac b/configure.ac
index 7cb12ef..1498e3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,6 +192,7 @@
tests/functional/Makefile
vds_bootstrap/Makefile
vdsm_cli/Makefile
+ vdsm_hooks/checkimages/Makefile
vdsm_hooks/directlun/Makefile
vdsm_hooks/faqemu/Makefile
vdsm_hooks/fileinject/Makefile
diff --git a/vdsm.spec.in b/vdsm.spec.in
index c117ee5..3bd0865 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -200,6 +200,15 @@
%description tests
A test suite for verifying the functionality of a running vdsm instance
+%package hook-checkimages
+Summary: Qcow2 disk image format check hook for VDSM
+BuildArch: noarch
+Requires: vdsm
+
+%description hook-checkimages
+VDSM hook used to perform consistency check on a qcow2 format disk image
+using the QEMU disk image utility.
+
%package hook-vhostmd
Summary: VDSM hook set for interaction with vhostmd
Requires: vhostmd
@@ -802,6 +811,10 @@
%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_qemucmdline
%if 0%{?with_hooks}
+%files hook-checkimages
+%defattr(-, root, root, -)
+%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/60_checkimages
+
%files hook-directlun
%defattr(-, root, root, -)
%{_sysconfdir}/sudoers.d/50_vdsm_hook_directlun
diff --git a/vdsm_hooks/Makefile.am b/vdsm_hooks/Makefile.am
index e6a8280..e4d4986 100644
--- a/vdsm_hooks/Makefile.am
+++ b/vdsm_hooks/Makefile.am
@@ -25,6 +25,7 @@
# Additional hooks
if HOOKS
SUBDIRS += \
+ checkimages \
directlun \
fileinject \
floppy \
diff --git a/vdsm_hooks/checkimages/Makefile.am b/vdsm_hooks/checkimages/Makefile.am
new file mode 100644
index 0000000..ad28f25
--- /dev/null
+++ b/vdsm_hooks/checkimages/Makefile.am
@@ -0,0 +1,31 @@
+#
+# 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
+#
+#
+
+EXTRA_DIST = \
+ before_vm_start.py
+
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)$(vdsmhooksdir)/before_vm_start
+ $(INSTALL_SCRIPT) $(srcdir)/before_vm_start.py \
+ $(DESTDIR)$(vdsmhooksdir)/before_vm_start/60_checkimages
+
+uninstall-local:
+ $(RM) $(DESTDIR)$(vdsmhooksdir)/before_vm_start/60_checkimages
diff --git a/vdsm_hooks/checkimages/README b/vdsm_hooks/checkimages/README
new file mode 100644
index 0000000..8959955
--- /dev/null
+++ b/vdsm_hooks/checkimages/README
@@ -0,0 +1,10 @@
+checkimages hook:
+================
+
+VDSM hook used to perform consistency check on a qcow2 format disk image
+using the QEMU disk image utility.
+
+example:
+ checkimages=true,timeout:1.12
+
+Note: Timeout value is taken in seconds. Check of 1GB image takes ~0.02 s.
diff --git a/vdsm_hooks/checkimages/before_vm_start.py b/vdsm_hooks/checkimages/before_vm_start.py
new file mode 100755
index 0000000..a80a042
--- /dev/null
+++ b/vdsm_hooks/checkimages/before_vm_start.py
@@ -0,0 +1,99 @@
+#!/usr/bin/python
+
+import os
+import sys
+import traceback
+
+import hooking
+
+'''
+checkimages vdsm hook
+=====================
+Hook performs consistency check on all qcow2 format disk images of a
+particular VM using the QEMU disk image utility.
+
+syntax:
+ checkimages=^true,timeout:(none|\d+\.{1}\d+)$
+
+example:
+ checkimages=true,timeout:1.12
+
+Note: Timeout value is taken in seconds. Check of 1GB image takes ~0.02 s.
+
+'''
+
+def checkImage(path, timeout):
+ '''
+ Check qcow2 image using qemu-img QEMU utility
+ '''
+
+ cmd = ['/usr/bin/qemu-img', 'check', '-f', 'qcow2', path]
+
+ # No timeout was provided. Run the check without limitation
+ # till the qemu-img command finished
+ if timeout is None:
+ rc, out, err = hooking.execCmd(cmd, sudo=False, raw=True)
+
+ # Timeout was provided. Enforce check termination on timeout
+ # expiration
+ else:
+ p = hooking.execCmd(cmd, sudo=False, raw=True, sync=False)
+
+ if not p.wait(timeout):
+ p.kill()
+ sys.stderr.write('checkimages: Image check operation timed out.\n')
+ sys.exit(2)
+
+ out, err = p.communicate()
+ rc = p.returncode
+
+ if rc == 0:
+ sys.stderr.write('checkimages: Checking image %s returned: %s\n' % \
+ (path, out))
+ else:
+ sys.stderr.write('checkimages: Error running %s command: %s\n' %
+ (' '.join(cmd), err))
+ sys.exit(2)
+
+
+if os.environ.has_key('checkimages'):
+
+ timeout = None
+
+ try:
+ checkimages = os.environ['checkimages']
+ # Might not be necessary. But for any case check we succeeded:
+ # 1) Obtaining provided timeout value
+ # 2) Converting provided value to float
+ try:
+ req_timeout = checkimages.split(',')[1].split(':')[1]
+ if req_timeout != 'none':
+ timeout = float(req_timeout)
+ except:
+ sys.stderr.write('checkimages: Error obtaining timeout value. ' \
+ 'Continuing with no timeout.\n')
+
+ domxml = hooking.read_domxml()
+ disks = domxml.getElementsByTagName('disk')
+
+ for disk in disks:
+ sources = disk.getElementsByTagName('source')
+ drivers = disk.getElementsByTagName('driver')
+
+ if (len(sources) > 0 and len(drivers) > 0):
+ disk_path = sources[0].getAttribute('file')
+ disk_type = drivers[0].getAttribute('type')
+
+ if ((disk_path and disk_type) and (disk_type == 'qcow2')):
+ sys.stderr.write('checkimages: Checking disk = %s\n' %
+ disk_path)
+ checkImage(disk_path, timeout)
+ elif disk_type != 'qcow2':
+ sys.stderr.write('checkimages: Disk = %s is not qcow2 ' \
+ 'disk image format one. Ignoring.\n' %
+ disk_path)
+
+ except:
+ sys.stderr.write('checkimages [unexpected error]: %s\n' %
+ traceback.format_exc())
+ sys.exit(2)
--
To view, visit http://gerrit.ovirt.org/9154
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4d88fb46a725d2c525d10ce2fcc808bba5b0ab4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Jan Lieskovsky <jlieskov(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: Fix validateBonding tests without bonding
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: Fix validateBonding tests without bonding
......................................................................
Fix validateBonding tests without bonding
There were remnants of the old validateBonding test
that were made obsolete by:
Change-Id: I023a5bb8a52719559bb9d4716f25e0cba8b3530b
That monkeypatching is not needed anymore. Now we just skip
the test if bonding is not loaded, i.e., BONDING_MASTERS
sysfs does not exist.
Change-Id: Idf461f1fbca682c44cae564cb32e4b7973c1f000
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M tests/configNetworkTests.py
1 file changed, 11 insertions(+), 29 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/12981/1
diff --git a/tests/configNetworkTests.py b/tests/configNetworkTests.py
index ca51f03..d5b670f 100644
--- a/tests/configNetworkTests.py
+++ b/tests/configNetworkTests.py
@@ -21,7 +21,6 @@
#
import os
-import re
import subprocess
import tempfile
import shutil
@@ -29,7 +28,6 @@
import configNetwork
from vdsm import netinfo
-from vdsm.utils import memoized
from testrunner import VdsmTestCase as TestCaseBase
from nose.plugins.skip import SkipTest
@@ -107,38 +105,22 @@
for mask in masks:
self.assertEqual(configNetwork.validateNetmask(mask), None)
- @memoized
- def _bondingModuleOptions(self):
- p = subprocess.Popen(['/sbin/modinfo', 'bonding'],
- close_fds=True, stdin=subprocess.PIPE,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- out, err = p.communicate()
-
- if err:
- raise SkipTest("bonding kernel module could not be found.")
-
- return frozenset(re.findall(r'(\w+):', line)[1] for line in
- out.split('\n') if line.startswith('parm:'))
-
- def _bondingOptExists(self, path):
- return os.path.basename(path) in self._bondingModuleOptions()
-
def testValidateBondingOptions(self):
# Monkey patch os.path.exists to let validateBondingOptions logic be
# tested when a bonding device is not present.
- with MonkeyPatchScope([
- (os.path, 'exists', self._bondingOptExists)
- ]):
- opts = 'mode=802.3ad miimon=150'
- badOpts = 'foo=bar badopt=one'
+ if not os.path.exists(configNetwork.BONDING_MASTERS):
+ raise SkipTest("bonding kernel module could not be found.")
- with self.assertRaises(configNetwork.ConfigNetworkError) as cne:
- configNetwork.validateBondingOptions('bond0', badOpts)
- self.assertEqual(cne.exception.errCode,
- configNetwork.ne.ERR_BAD_BONDING)
+ opts = 'mode=802.3ad miimon=150'
+ badOpts = 'foo=bar badopt=one'
- self.assertEqual(configNetwork.validateBondingOptions('bond0',
- opts), None)
+ with self.assertRaises(configNetwork.ConfigNetworkError) as cne:
+ configNetwork.validateBondingOptions('bond0', badOpts)
+ self.assertEqual(cne.exception.errCode,
+ configNetwork.ne.ERR_BAD_BONDING)
+
+ self.assertEqual(configNetwork.validateBondingOptions('bond0',
+ opts), None)
def _fakeNetworks():
return {'fakebridgenet': {'iface': 'fakebridge', 'bridged': True},
--
To view, visit http://gerrit.ovirt.org/12981
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf461f1fbca682c44cae564cb32e4b7973c1f000
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: HostStatsThread: change way of counting CPUs
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: HostStatsThread: change way of counting CPUs
......................................................................
HostStatsThread: change way of counting CPUs
There is no /sys/class/cpuid in Ubuntu Server 12.10 64 bit.
Scans /sys/devices/system/cpu instead.
The patch is on going work of porting VDSM to Ubuntu
http://www.ovirt.org/VDSM_on_Ubuntu
Change-Id: Ia9e1a104c2241b8f5e8a9b4098530826c3b1677d
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M vdsm/utils.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/12815/1
diff --git a/vdsm/utils.py b/vdsm/utils.py
index 35338a0..fb83bee 100644
--- a/vdsm/utils.py
+++ b/vdsm/utils.py
@@ -39,6 +39,7 @@
import functools
import stat
import glob
+import re
import ethtool
@@ -573,7 +574,9 @@
[''] * len(ifids)) # fake ifmacs
self._imagesStatus = ImagePathStatus(cif)
self._pid = os.getpid()
- self._ncpus = len(os.listdir('/sys/class/cpuid/'))
+ cpuPattern = re.compile('cpu[0-9]+')
+ self._ncpus = len(filter(cpuPattern.match,
+ os.listdir('/sys/devices/system/cpu')))
def stop(self):
self._imagesStatus.stop()
--
To view, visit http://gerrit.ovirt.org/12815
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9e1a104c2241b8f5e8a9b4098530826c3b1677d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
11 years, 2 months
Change in vdsm[master]: tests: testMethodBadParameters decorated as broken
by vvolansk@redhat.com
Vered Volansky has uploaded a new change for review.
Change subject: tests: testMethodBadParameters decorated as broken
......................................................................
tests: testMethodBadParameters decorated as broken
testMethodBadParameters Sometime fails the build, and sometimes doesn't.
It's now decorated as broken until it's fixed.
Change-Id: I92dcebd9c17ebacd5016d6e6645a026db28ff405
Signed-off-by: Vered Volansky <vvolansk(a)redhat.com>
---
M tests/jsonRpcTests.py
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/64/12664/1
diff --git a/tests/jsonRpcTests.py b/tests/jsonRpcTests.py
index e13e24b..22aa2f8 100644
--- a/tests/jsonRpcTests.py
+++ b/tests/jsonRpcTests.py
@@ -22,6 +22,7 @@
import logging
from Queue import Queue
from contextlib import closing
+from testValidation import brokentest
from testrunner import VdsmTestCase as TestCaseBase, \
expandPermutations, \
@@ -179,6 +180,7 @@
self.assertEquals(cm.exception.code,
JsonRpcMethodNotFoundError().code)
+ @brokentest()
@permutations(REACTOR_TYPE_PERMUTATIONS)
def testMethodBadParameters(self, reactorType):
# Without a schema the server returns an internal error
--
To view, visit http://gerrit.ovirt.org/12664
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I92dcebd9c17ebacd5016d6e6645a026db28ff405
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vered Volansky <vvolansk(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: vdsm-upgrade: fix xml format
by Douglas Schilling Landgraf
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: vdsm-upgrade: fix xml format
......................................................................
vdsm-upgrade: fix xml format
Fixed illegal XML that affects upgrade from Engine.
Change-Id: I019bc35eaebd7c0b0424353f6c7e5699f3eb27b4
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=920671
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M vdsm_reg/vdsm-upgrade
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/12990/1
diff --git a/vdsm_reg/vdsm-upgrade b/vdsm_reg/vdsm-upgrade
index a437e97..d9bdd31 100755
--- a/vdsm_reg/vdsm-upgrade
+++ b/vdsm_reg/vdsm-upgrade
@@ -136,15 +136,15 @@
out, err, ret = deployUtil.setService('vdsmd', 'stop')
if ret != 0:
msg = "<BSTRAP component='RHEL_INSTALL' status='FAIL'" \
- "message='Cannot stop vdsm daemon before we" \
+ " message='Cannot stop vdsm daemon before we" \
" start the upgrade, please verify!'/>"
else:
msg = "<BSTRAP component='RHEL_INSTALL' status='OK'" \
- "message='vdsm daemon stopped for upgrade process!'/>"
+ " message='vdsm daemon stopped for upgrade process!'/>"
else:
msg = "<BSTRAP component='RHEL_INSTALL' status='WARN'" \
- "message='vdsm daemon is already down before we" \
+ " message='vdsm daemon is already down before we" \
" stop it for upgrade.'/>"
logging.debug(msg)
--
To view, visit http://gerrit.ovirt.org/12990
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I019bc35eaebd7c0b0424353f6c7e5699f3eb27b4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
11 years, 2 months
Change in vdsm[master]: sos: Follow symbolic links with tree command
by kroberts@redhat.com
Keith Robertson has uploaded a new change for review.
Change subject: sos: Follow symbolic links with tree command
......................................................................
sos: Follow symbolic links with tree command
Change-Id: I5e09dcc9dc228be22f83ccb15a8aaae453001b7c
Signed-off-by: Keith Robertson <kroberts(a)redhat.com>
---
M vdsm/sos/vdsm.py.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/12386/1
diff --git a/vdsm/sos/vdsm.py.in b/vdsm/sos/vdsm.py.in
index d7b9651..b2b73cb 100644
--- a/vdsm/sos/vdsm.py.in
+++ b/vdsm/sos/vdsm.py.in
@@ -82,7 +82,7 @@
self.addCopySpec("/proc/%s/mountstats" % pid)
self.collectExtOutput("/bin/ls -l /var/log/core")
self.collectExtOutput(
- "/bin/su vdsm -s /bin/sh -c '/usr/bin/tree @VDSMREPO@'")
+ "/bin/su vdsm -s /bin/sh -c '/usr/bin/tree -l @VDSMREPO@'")
self.collectExtOutput(
"/bin/su vdsm -s /bin/sh -c '/bin/ls -lR @VDSMREPO@'")
self.collectExtOutput("/sbin/lvm vgs -v -o +tags")
--
To view, visit http://gerrit.ovirt.org/12386
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e09dcc9dc228be22f83ccb15a8aaae453001b7c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Keith Robertson <kroberts(a)redhat.com>
11 years, 2 months
Change in vdsm[ovirt-3.2]: gluster: set glusterfs dependency version
by barumuga@redhat.com
Hello Timothy Asir, Saggi Mizrahi, Aravinda VK, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/12960
to review the following change.
Change subject: gluster: set glusterfs dependency version
......................................................................
gluster: set glusterfs dependency version
vdsm-gluster requires glusterfs version 3.4.0 or higher. As
pre-release of glusterfs version number is not compatible with fedora
naming guidelines, 3.4.0alpha2 is set now as latest.
Change-Id: Icb42bf4dec26b118f52cc51701faa5e611f63c00
Signed-off-by: Bala.FA <barumuga(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/60/12960/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 1cb189e..c6be597 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -402,7 +402,7 @@
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
-Requires: glusterfs
+Requires: glusterfs = 3.4.0alpha2
Requires: glusterfs-server
Requires: glusterfs-fuse
Requires: glusterfs-rdma
--
To view, visit http://gerrit.ovirt.org/12960
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb42bf4dec26b118f52cc51701faa5e611f63c00
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.2
Gerrit-Owner: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Aravinda VK <avishwan(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin(a)redhat.com>
11 years, 2 months