Change in vdsm[master]: Define ModuleConfigure interface and API for modules configu...
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Define ModuleConfigure interface and API for modules configuration tool
......................................................................
Define ModuleConfigure interface and API for modules configuration tool
This patch arrange configurator package and API. The format for the
configure command is modified to:
vdsm-tool configure --modules libvirt,sanlock --force --autoreset
--dry option is available to check if configure is required
and --test to verify current configuration's conflicts.
For reuse and easier additional configurers for other services, all the
developer needs to add is an object that inherit ModuleConfigure and
implements the interface for test, dry and configure, then adding the
class to configurers.
Change-Id: I0bcda0d9778b02281e5fd0699e48bb3447ba4b73
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M lib/vdsm/tool/configurator.py
1 file changed, 172 insertions(+), 114 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/20335/1
diff --git a/lib/vdsm/tool/configurator.py b/lib/vdsm/tool/configurator.py
index c079bf6..d8d7c85 100644
--- a/lib/vdsm/tool/configurator.py
+++ b/lib/vdsm/tool/configurator.py
@@ -20,6 +20,7 @@
import os
import sys
import grp
+import argparse
from vdsm import utils
import vdsm.tool
@@ -27,122 +28,179 @@
from vdsm.constants import P_VDSM_EXEC, DISKIMAGE_GROUP
-def exec_libvirt_configure(action, *args):
- """
- Invoke libvirt_configure.sh script
- """
- if os.getuid() != 0:
- raise RuntimeError("Must run as root")
+class ModuleConfigure(object):
+ def __init__(self):
+ pass
- rc, out, err = utils.execCmd([os.path.join(
- P_VDSM_EXEC,
- 'libvirt_configure.sh'), action] +
- list(args),
- raw=True)
+ def test(self):
+ return 0
- sys.stdout.write(out)
- sys.stderr.write(err)
- if rc != 0:
- raise RuntimeError("Failed to perform libvirt configure action")
+ def configure(self, force, autoreset):
+ return 0
+
+ def dry(self):
+ return 0
+
+
+class LibvirtModuleConfigure(ModuleConfigure):
+ def _exec_libvirt_configure(self, action, *args):
+ """
+ Invoke libvirt_configure.sh script
+ """
+ if os.getuid() != 0:
+ raise RuntimeError("Must run as root")
+
+ rc, out, err = utils.execCmd([os.path.join(
+ P_VDSM_EXEC,
+ 'libvirt_configure.sh'), action] +
+ list(args),
+ raw=True)
+
+ sys.stdout.write(out)
+ sys.stderr.write(err)
+ if rc != 0:
+ raise RuntimeError("Failed to perform libvirt configure action")
+ return 0
+
+ def configure(self, force, autoreset):
+ """
+ libvirt configuration (--force to force reconfigure also when
+ configured)
+ """
+ libvirt_related_services = ["supervdsmd", "libvirtd"]
+ service_should_start = []
+ if autoreset:
+ for srv in libvirt_related_services:
+ if service.service_status(srv):
+ service.service_stop(srv)
+ service_should_start.append(srv)
+
+ args = ''
+ if force:
+ args = '--force'
+
+ self._exec_libvirt_configure("reconfigure", args)
+
+ for srv in reversed(service_should_start):
+ service.service_start(srv)
+
+ def test(self):
+ """
+ Validate conflict in configured files
+ """
+ return self._exec_libvirt_configure("test_conflict_configurations", '')
+
+ def _libvirt_related_services_restart(self):
+ """
+ restart whatever that should be restarted after configuring
+ libvirtd.conf
+ """
+ service.service_stop("supervdsmd")
+ service.service_stop("libvirtd")
+ service.service_start("libvirtd")
+ service.service_start("supervdsmd")
+ return 0
+
+ def dry(self):
+ """
+ Check if libvirt is already configured for vdsm
+ """
+ return self._exec_libvirt_configure("check_if_configured", '')
+
+
+class SanlockModuleConfigure(ModuleConfigure):
+
+ def configure(self, force, autoreset):
+ if self.dry() and autoreset:
+ service.service_restart("sanlock")
+
+ def dry(self, *args):
+ """
+ Return 0 if sanlock service requires a restart to reload the relevant
+ supplementary groups.
+ """
+ sanlock_pid_file = "/var/run/sanlock/sanlock.pid"
+ proc_status_path = "/proc/%s/status"
+ proc_status_group_prefix = "Groups:\t"
+
+ try:
+ with open(sanlock_pid_file, "r") as f:
+ sanlock_pid = f.readline().strip()
+ with open(proc_status_path % sanlock_pid, "r") as sanlock_status:
+ for status_line in sanlock_status:
+ if status_line.startswith(proc_status_group_prefix):
+ groups = [int(x) for x in
+ status_line[len(proc_status_group_prefix):].
+ strip().split(" ")]
+ break
+ else:
+ raise RuntimeError("Unable to find sanlock service groups")
+
+ except IOError as e:
+ if e.errno == os.errno.ENOENT:
+ raise RuntimeError("sanlock service is not running")
+ raise
+
+ diskimage_gid = grp.getgrnam(DISKIMAGE_GROUP)[2]
+ if diskimage_gid not in groups:
+ raise RuntimeError("sanlock service requires restart")
+
+ sys.stdout.write("sanlock service is already configured\n")
+ return 0
+
+
+libvirtConfigurer = LibvirtModuleConfigure()
+sanlockConfigurer = SanlockModuleConfigure()
+configurers = {'libvirt': libvirtConfigurer,
+ 'sanlock': sanlockConfigurer}
+
+
+(a)vdsm.tool.expose("configure")
+def configure(*args):
+ """
+ Configure external services for vdsm
+ """
+ args = parse_configure_args()
+ if not args.modules:
+ # no modules specified
+ raise RuntimeError("No modules were specified for operation.\n"
+ "vdsm-tool configure --help for more details")
+
+ if args.test and args.dry:
+ raise RuntimeError("Can't operate dry run and test at the same time\n"
+ "vdsm-tool configure --help for more details")
+
+ modules = args.modules.split(',')
+ if args.test:
+ for m in modules:
+ configurers[m].test()
+
+ elif args.dry:
+ for m in modules:
+ configurers[m].dry()
+
+ else:
+ for m in modules:
+ configurers[m].configure(force=args.force,
+ autoreset=args.autoreset)
return 0
-(a)vdsm.tool.expose("libvirt-configure")
-def configure_libvirt(*args):
- """
- libvirt configuration (--force for reconfigure)
- """
- return exec_libvirt_configure("reconfigure", *args)
-
-
-(a)vdsm.tool.expose("libvirt-test-conflicts")
-def test_conflict_configurations(*args):
- """
- Validate conflict in configured files
- """
- return exec_libvirt_configure("test_conflict_configurations", *args)
-
-
-(a)vdsm.tool.expose("libvirt-configure-services-restart")
-def libvirt_configure_services_restart(*args):
- """
- Managing restart of related services
- """
- service.service_stop("supervdsmd")
- service.service_stop("libvirtd")
- service.service_start("libvirtd")
- service.service_start("supervdsmd")
- return 0
-
-
-(a)vdsm.tool.expose("libvirt-is-configured")
-def libvirt_is_configured(*args):
- """
- Check if libvirt is already configured for vdsm
- """
- return exec_libvirt_configure("check_if_configured", *args)
-
-
-(a)vdsm.tool.expose("sanlock-check-service")
-def sanlock_check_service(*args):
- """
- Check if sanlock service requires a restart to reload the relevant
- supplementary groups.
- """
- sanlock_pid_file = "/var/run/sanlock/sanlock.pid"
- proc_status_path = "/proc/%s/status"
- proc_status_group_prefix = "Groups:\t"
-
- try:
- with open(sanlock_pid_file, "r") as f:
- sanlock_pid = f.readline().strip()
- with open(proc_status_path % sanlock_pid, "r") as sanlock_status:
- for status_line in sanlock_status:
- if status_line.startswith(proc_status_group_prefix):
- groups = [int(x) for x in
- status_line[len(proc_status_group_prefix):].
- strip().split(" ")]
- break
- else:
- raise RuntimeError("Unable to find sanlock service groups")
-
- except IOError as e:
- if e.errno == os.errno.ENOENT:
- raise RuntimeError("sanlock service is not running")
- raise
-
- diskimage_gid = grp.getgrnam(DISKIMAGE_GROUP)[2]
- if diskimage_gid not in groups:
- raise RuntimeError("sanlock service requires restart")
-
- sys.stdout.write("sanlock service is already configured\n")
- return 0
-
-
-(a)vdsm.tool.expose("configure-all")
-def configure_and_restart_all(*args):
- """
- Configure related services for vdsm. --force flag is set for
- forcing restart of related services after configure
- """
- libvirt_related_services = ["supervdsmd", "libvirtd"]
- service_should_start = []
-
- force = '--force' in args
-
- # libvirt configuration
- if force:
- for srv in libvirt_related_services:
- if service.service_status(srv):
- service.service_stop(srv)
- service_should_start.append(srv)
-
- configure_libvirt(*args)
- for srv in reversed(service_should_start):
- service.service_start(srv)
-
- # sanlock configuration
- if sanlock_check_service(*args) and force:
- service.service_restart("sanlock")
-
- return 0
+def parse_configure_args():
+ parser = argparse.ArgumentParser('vdsm-tool configure')
+ parser.add_argument('--modules', dest='modules', default=None,
+ metavar='libvirt,sanlock,foo,boo',
+ help='List of modules to configure [libvirt, sanlock]')
+ parser.add_argument('--dry', dest='dry', default=False,
+ action='store_true',
+ help='Dry run, prints if configure is required')
+ parser.add_argument('--test', dest='test', default=False,
+ action='store_true',
+ help='Testing if configurations are valid')
+ parser.add_argument('--force', dest='force', default=False,
+ action='store_true',
+ help='Force reconfiguration on modules')
+ parser.add_argument('--autoreset', dest='autoreset', default=False,
+ action='store_true',
+ help='Perform restart to module after reconfigure')
+ return parser.parse_args(sys.argv[2:])
--
To view, visit http://gerrit.ovirt.org/20335
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bcda0d9778b02281e5fd0699e48bb3447ba4b73
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
10 years, 7 months
Change in vdsm[master]: it fixes a bug in the hook validation decorator, that left t...
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: it fixes a bug in the hook validation decorator, that left tests scripts installed into the system. Now they're properly removed right after the tests
......................................................................
Patch Set 3:
Please fix the commit message, too.
--
To view, visit http://gerrit.ovirt.org/20310
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I138c3eab77ea6d35d6a997049940923026e06d96
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Miguel Angel Ajo Pelayo <miguelangel(a)ajo.es>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Miguel Angel Ajo Pelayo <miguelangel(a)ajo.es>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
10 years, 7 months
Change in vdsm[master]: run pre-start bfore start needed services
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: run pre-start bfore start needed services
......................................................................
run pre-start bfore start needed services
Change-Id: If1eb0222e534c128a70778356001b7cf9b076fc9
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M init/sysvinit/vdsmd.init.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/20275/1
diff --git a/init/sysvinit/vdsmd.init.in b/init/sysvinit/vdsmd.init.in
index 4a4fc7d..1d81113 100755
--- a/init/sysvinit/vdsmd.init.in
+++ b/init/sysvinit/vdsmd.init.in
@@ -119,8 +119,8 @@
test_already_running && return 0
shutdown_conflicting_srv "${CONFLICTING_SERVICES}" || return 1
- start_needed_srv "${NEEDED_SERVICES}" || return 1
"${VDSMD_INIT_COMMON}" --pre-start || return 1
+ start_needed_srv "${NEEDED_SERVICES}" || return 1
echo $"Starting up vdsm daemon: "
DAEMON_COREFILE_LIMIT=unlimited NICELEVEL="${NICE_LOWEST}" daemon \
--
To view, visit http://gerrit.ovirt.org/20275
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If1eb0222e534c128a70778356001b7cf9b076fc9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
10 years, 7 months
Change in vdsm[master]: New getChildrenList implementation.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: New getChildrenList implementation.
......................................................................
New getChildrenList implementation.
Disclaimer: this function should be removed!
This implementation returns children of any image on the SD.
Avoids to produce each volume in the domain.
Implemented like one shot operation.
Change-Id: I584cd5d1b03d3965457f12c3d67de95455d1de24
Related-to: BZ#960952
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M configure.ac
M lib/vdsm/constants.py.in
M lib/vdsm/utils.py
M vdsm/storage/blockVolume.py
M vdsm/storage/fileVolume.py
M vdsm/storage/volume.py
6 files changed, 43 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/65/15765/1
diff --git a/configure.ac b/configure.ac
index 265e3ab..45ea4df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,6 +171,7 @@
AC_PATH_PROG([OPENSSL_PATH], [openssl], [/usr/bin/openssl])
AC_PATH_PROG([PERSIST_PATH], [persist], [/usr/sbin/persist])
AC_PATH_PROG([PGREP_PATH], [pgrep], [/usr/bin/pgrep])
+AC_PATH_PROG([GREP_PATH], [grep], [/usr/bin/grep])
AC_PATH_PROG([QEMUIMG_PATH], [qemu-img], [/usr/bin/qemu-img])
AC_PATH_PROG([REBOOT_PATH], [reboot], [/usr/bin/reboot])
AC_PATH_PROG([RPM_PATH], [rpm], [/bin/rpm])
diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index 63771f6..cfe0e9a 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -113,6 +113,7 @@
EXT_PERSIST = '@PERSIST_PATH@'
EXT_PGREP = '@PGREP_PATH@'
+EXT_GREP = '@GREP_PATH@'
EXT_PYTHON = '@PYTHON@'
EXT_QEMUIMG = '@QEMUIMG_PATH@'
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index 4847a68..5fed076 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -150,6 +150,18 @@
time.sleep(0.1)
+def grepCmd(pattern, path):
+ cmd = (constants.EXT_GREP, '-E', pattern, path)
+ rc, out, err = execCmd(cmd)
+ if rc == 0:
+ matches = out # A list of matching lines
+ elif rc == 1:
+ matches = [] # pattern not found
+ else:
+ raise ValueError("rc: %s, out: %s, err: %s" % (rc, out, err))
+ return matches
+
+
def forceLink(src, dst):
""" Makes or replaces a hard link.
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
index 606762c..36cc014 100644
--- a/vdsm/storage/blockVolume.py
+++ b/vdsm/storage/blockVolume.py
@@ -480,6 +480,16 @@
lvs = lvm.lvsByTag(sdUUID, "%s%s" % (TAG_PREFIX_IMAGE, imgUUID))
return [lv.name for lv in lvs]
+ def getChildrenList(self):
+ """ Return the list of children volume UUIDs.
+
+ Children can be found in any image of the volume SD.
+ TODO: Remove this function.
+ """
+ lvs = lvm.lvsByTag(self.sdUUID,
+ "%s%s" % (TAG_PREFIX_PARENT, self.volUUID))
+ return [lv.name for lv in lvs]
+
def removeMetadata(self, metaId):
"""
Just wipe meta.
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index 8b0a33e..026ac39 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -367,6 +367,25 @@
volList.append(volid)
return volList
+ def getChildrenList(self):
+ """ Return the list of children volume UUIDs.
+
+ Children can be found in any image of the volume SD.
+ TODO: Remove this function.
+ """
+ domPath = self.imagePath.split('images')[0]
+ gPath = os.path.join(domPath, 'images', '*', '*.meta')
+ pattern = "%s.*%s" % (volume.PUUID, self.volUUID)
+ matches = oop.getProcessPool(self.sdUUID).utils.grepCmd(pattern, gPath)
+ if matches:
+ children = []
+ for line in matches:
+ children.append(line.split('=')[1])
+ else:
+ children = []
+
+ return children
+
@classmethod
def newVolumeLease(cls, metaId, sdUUID, volUUID):
cls.log.debug("Initializing volume lease volUUID=%s sdUUID=%s, "
diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index 1c81d87..a088bfb 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -830,19 +830,6 @@
self.sdUUID, self.imgUUID, self.volUUID, str(info))
return info
- def getChildrenList(self):
- """
- Fetch the list of children volumes (in single image)
- """
- vols = self.getImageVolumes(self.repoPath, self.sdUUID, self.imgUUID)
- children = []
- dom = sdCache.produce(self.sdUUID)
- for v in vols:
- if (dom.produceVolume(self.imgUUID, v).getParent() ==
- self.volUUID):
- children.append(v)
- return children
-
def getParentVolume(self):
"""
Return parent volume object
--
To view, visit http://gerrit.ovirt.org/15765
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I584cd5d1b03d3965457f12c3d67de95455d1de24
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
10 years, 7 months
Change in vdsm[master]: it fixes a bug in the hook validation decorator, that left t...
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: it fixes a bug in the hook validation decorator, that left tests scripts installed into the system. Now they're properly removed right after the tests
......................................................................
Patch Set 2: Code-Review-1
(4 comments)
....................................................
Commit Message
Line 3: AuthorDate: 2013-10-19 03:27:38 -0400
Line 4: Commit: Miguel Angel Ajo <miguelangel(a)ajo.es>
Line 5: CommitDate: 2013-10-19 14:39:57 -0400
Line 6:
Line 7: it fixes a bug in the hook validation decorator, that left tests
First line of commit message should be a short subject, eg "tests: hook decorator: fix leaked file"
Line 8: scripts installed into the system. Now they're properly removed
Line 9: right after the tests
Line 10:
Line 11: Enhanced exception capture to avoid passing on unexpected OSError
Line 8: scripts installed into the system. Now they're properly removed
Line 9: right after the tests
Line 10:
Line 11: Enhanced exception capture to avoid passing on unexpected OSError
Line 12: exceptions.
I prefer a separate patch for this, so the fix of the leak is clearer.
Line 13:
Line 14: Change-Id: I138c3eab77ea6d35d6a997049940923026e06d96
....................................................
File tests/hookValidation.py
Line 76: kwargs['hook_cookiefile'] = cookie_file
Line 77: output = test_function(*args, **kwargs)
Line 78: finally:
Line 79: if directory_existed:
Line 80: os.unlink(hook_path+'/'+hook_name)
Pep8: spaces around ops
Line 81: else:
Line 82: shutil.rmtree(hook_path)
Line 83:
Line 84: try:
Line 83:
Line 84: try:
Line 85: os.unlink(cookie_file)
Line 86: except OSError as unlink_error:
Line 87: if unlink_error.errno = os.errno.ENOENT:
==
Line 88: pass
Line 89: else:
Line 90: raise
Line 91:
--
To view, visit http://gerrit.ovirt.org/20310
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I138c3eab77ea6d35d6a997049940923026e06d96
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Miguel Angel Ajo Pelayo <miguelangel(a)ajo.es>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Miguel Angel Ajo Pelayo <miguelangel(a)ajo.es>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
10 years, 7 months
Change in vdsm[master]: tests: Minor cleanup in monkeypatch module and tests
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: tests: Minor cleanup in monkeypatch module and tests
......................................................................
tests: Minor cleanup in monkeypatch module and tests
Change-Id: I7d1d10c8b1e97d7d28af31d25fb1fe0fdcd8d8d5
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M tests/monkeypatch.py
M tests/monkeypatchTests.py
2 files changed, 4 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/20202/1
diff --git a/tests/monkeypatch.py b/tests/monkeypatch.py
index f851f82..35b5d63 100644
--- a/tests/monkeypatch.py
+++ b/tests/monkeypatch.py
@@ -21,8 +21,9 @@
from contextlib import contextmanager
from functools import wraps
+
#
-# Monkey patch
+# Monkey patch.
#
# Usage:
# ---
@@ -49,8 +50,6 @@
# # using patched functions
# ---
#
-
-
class Patch(object):
def __init__(self, what):
@@ -75,7 +74,7 @@
#
# Usage:
# ---
-# from monkeypatch import MonkeyPatch
+# from monkeypatch import MonkeyPatchScope
#
# def test():
# with MonkeyPatchScope([
diff --git a/tests/monkeypatchTests.py b/tests/monkeypatchTests.py
index b1b9359..284ece2 100644
--- a/tests/monkeypatchTests.py
+++ b/tests/monkeypatchTests.py
@@ -106,7 +106,7 @@
self.assertNotEqual(self.module.c, patched)
-class TestMonkeyPatchAssertions(VdsmTestCase):
+class TestMonkeyPatchFixtureAssertions(VdsmTestCase):
def testAlreadyApplied(self):
patch = monkeypatch.Patch([(FakeModule(), 'a', patched)])
--
To view, visit http://gerrit.ovirt.org/20202
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d1d10c8b1e97d7d28af31d25fb1fe0fdcd8d8d5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
10 years, 7 months
Change in vdsm[master]: testValidateBondingOptions: declare root requirement
by Dan Kenigsberg
Dan Kenigsberg has uploaded a new change for review.
Change subject: testValidateBondingOptions: declare root requirement
......................................................................
testValidateBondingOptions: declare root requirement
Our Bond.validateOptions() and and its test require root permissions.
Change-Id: I43743e2446d014ae1e4e97b84756dc403019c455
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M tests/netmodelsTests.py
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/84/20284/1
diff --git a/tests/netmodelsTests.py b/tests/netmodelsTests.py
index b5b38c3..6181a9e 100644
--- a/tests/netmodelsTests.py
+++ b/tests/netmodelsTests.py
@@ -31,6 +31,7 @@
import neterrors
from testrunner import VdsmTestCase as TestCaseBase
+from testValidation import ValidateRunningAsRoot
from nose.plugins.skip import SkipTest
from monkeypatch import MonkeyPatch
@@ -87,6 +88,7 @@
self.assertEqual(Bond.validateName('bond11'), None)
self.assertEqual(Bond.validateName('bond11128421982'), None)
+ @ValidateRunningAsRoot
def testValidateBondingOptions(self):
if not os.path.exists(netinfo.BONDING_MASTERS):
raise SkipTest("bonding kernel module could not be found.")
--
To view, visit http://gerrit.ovirt.org/20284
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I43743e2446d014ae1e4e97b84756dc403019c455
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
10 years, 7 months