Change in vdsm[master]: net test: Use fake nelink data for testGetDeviceByIP
by edwardh@redhat.com
Edward Haas has uploaded a new change for review.
Change subject: net test: Use fake nelink data for testGetDeviceByIP
......................................................................
net test: Use fake nelink data for testGetDeviceByIP
Change-Id: Id9506484fa8083d60f00358acf65d0b99754746c
Signed-off-by: Edward Haas <edwardh(a)redhat.com>
---
M tests/network/netinfo_test.py
1 file changed, 9 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/59881/1
diff --git a/tests/network/netinfo_test.py b/tests/network/netinfo_test.py
index 8fde0a0..d2c1f70 100644
--- a/tests/network/netinfo_test.py
+++ b/tests/network/netinfo_test.py
@@ -30,7 +30,6 @@
from vdsm.network import netinfo
from vdsm.network.netinfo import addresses, bonding, dns, misc, nics, routes
from vdsm.network.netinfo.cache import get
-from vdsm.network.netlink import addr as nl_addr
from vdsm.utils import random_iface_name
from vdsm import sysctl
@@ -132,16 +131,15 @@
addresses.IPv4toMapped('127.0.0.1'))
def testGetDeviceByIP(self):
- for addr in nl_addr.iter_addrs():
- # Link-local IPv6 addresses are generated from the MAC address,
- # which is shared between a nic and its bridge. Since We don't
- # support having the same IP address on two different NICs, and
- # link-local IPv6 addresses aren't interesting for 'getDeviceByIP'
- # then ignore them in the test
- if addr['scope'] != 'link':
- self.assertEqual(
- addr['label'],
- addresses.getDeviceByIP(addr['address'].split('/')[0]))
+ NL_ADDRESS = {'label': 'iface0',
+ 'address': '127.0.0.1/32',
+ 'family': 'inet'}
+
+ mock_nl_addr = (addresses.nl_addr, 'iter_addrs', lambda: [NL_ADDRESS])
+ with MonkeyPatchScope([mock_nl_addr]):
+ self.assertEqual(
+ NL_ADDRESS['label'],
+ addresses.getDeviceByIP(NL_ADDRESS['address'].split('/')[0]))
def _testNics(self):
"""Creates a test fixture so that nics() reports:
--
To view, visit https://gerrit.ovirt.org/59881
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9506484fa8083d60f00358acf65d0b99754746c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh(a)redhat.com>
7 years, 10 months
Change in vdsm[master]: test: Introduce mock module for testing
by edwardh@redhat.com
Edward Haas has uploaded a new change for review.
Change subject: test: Introduce mock module for testing
......................................................................
test: Introduce mock module for testing
Mock is part of py3 std lib (under unittest package) with enhanced
functionality to support mocking in tests.
For py2, the python-mock package is used.
This reverts commit 8d36d28fbf16407601ace73e97fef19f114553ad
Change-Id: I72edd0a9388f11d905cfbd7d2fac5a95e1212cea
Signed-off-by: Edward Haas <edwardh(a)redhat.com>
---
M automation/check-patch.packages.el7
M automation/check-patch.packages.fc23
M tests/testlib.py
M vdsm.spec.in
4 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/97/59797/1
diff --git a/automation/check-patch.packages.el7 b/automation/check-patch.packages.el7
index 345efb0..a0fb82b 100644
--- a/automation/check-patch.packages.el7
+++ b/automation/check-patch.packages.el7
@@ -14,6 +14,7 @@
python-devel
python-inotify
python-ioprocess
+python-mock
python-netaddr
python-nose
python-pthreading
diff --git a/automation/check-patch.packages.fc23 b/automation/check-patch.packages.fc23
index 8490020..0f8c5f9 100644
--- a/automation/check-patch.packages.fc23
+++ b/automation/check-patch.packages.fc23
@@ -15,6 +15,7 @@
python-devel
python-inotify
python-ioprocess
+python-mock
python-netaddr
python-nose
python-pthreading
diff --git a/tests/testlib.py b/tests/testlib.py
index 6a0cbaf..132f5e2 100644
--- a/tests/testlib.py
+++ b/tests/testlib.py
@@ -38,6 +38,12 @@
from contextlib import contextmanager
import xml.etree.ElementTree as ET
+try:
+ from unittest import mock
+except ImportError: # py2
+ import mock
+mock
+
from nose import config
from nose import core
from nose import result
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 043b4c2..a71ad49 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -59,6 +59,7 @@
BuildRequires: cyrus-sasl-lib
BuildRequires: python
BuildRequires: python-devel
+BuildRequires: python-mock
BuildRequires: python-netaddr
BuildRequires: python-nose
BuildRequires: python-six >= 1.9.0
--
To view, visit https://gerrit.ovirt.org/59797
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I72edd0a9388f11d905cfbd7d2fac5a95e1212cea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh(a)redhat.com>
7 years, 10 months
Change in vdsm[master]: HACK: DONTMERGE: make the recovery slower
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: HACK: DONTMERGE: make the recovery slower
......................................................................
HACK: DONTMERGE: make the recovery slower
*** DONTMERGE ***
Artificially delay recovery to make testing of real
patches fixing real bugs easier.
Change-Id: Ieaa1672c7184aab43b15d4c63680bcd50fac6099
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/clientIF.py
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/59987/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 1147e36..8996c0c 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -474,6 +474,8 @@
recovery.clean_vm_files(self)
+ time.sleep(30.)
+
self._recovery = False
# Now if we have VMs to restore we should wait pool connection
--
To view, visit https://gerrit.ovirt.org/59987
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieaa1672c7184aab43b15d4c63680bcd50fac6099
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 10 months
Change in vdsm[master]: virt: Ensure uncaught exceptions on disconnect events are ca...
by Vinzenz Feenstra
Vinzenz Feenstra has uploaded a new change for review.
Change subject: virt: Ensure uncaught exceptions on disconnect events are caught
......................................................................
virt: Ensure uncaught exceptions on disconnect events are caught
Previously we did not catch unhandled exceptions and they
were not logged either which made it pretty difficult to
actually detect any existing issue in the first place.
This patch ensures that future unhandled exceptions are
at least logged so we'll be aware of them.
Change-Id: Ie5b91acad0e5d9c5a973b626f10fc0d543e6bcc6
Backport-To: 4.0
Bug-Url: https://bugzilla.redhat.com/1349383
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/59868/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 9447f81..879f64b 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -861,6 +861,7 @@
self.conf['clientIp'] = clientIp
self._clientPort = clientPort
+ @utils.traceback()
def _timedDesktopLock(self):
# This is not a definite fix, we're aware that there is still the
# possibility of a race condition, however this covers more cases
--
To view, visit https://gerrit.ovirt.org/59868
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5b91acad0e5d9c5a973b626f10fc0d543e6bcc6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
7 years, 10 months
Change in vdsm[master]: virt: Pass missing parameter on desktopLogoff
by Vinzenz Feenstra
Vinzenz Feenstra has uploaded a new change for review.
Change subject: virt: Pass missing parameter on desktopLogoff
......................................................................
virt: Pass missing parameter on desktopLogoff
Previously this parameter was not passed and all seemed
fine from the logs, but it actually wasn't the exception
was swallow that the parameter was missing.
The parameter is actually not used, but still mandatory.
Change-Id: I65b030d4a7a7ed7ad3f6279c66120d1f9e45d396
Backport-To: 4.0
Bug-Url: https://bugzilla.redhat.com/1349383
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/59866/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 0e756fe..9447f81 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -873,7 +873,7 @@
if self._consoleDisconnectAction == CDA.LOCK_SCREEN:
self.guestAgent.desktopLock()
elif self._consoleDisconnectAction == CDA.LOGOUT:
- self.guestAgent.desktopLogoff()
+ self.guestAgent.desktopLogoff(False)
elif self._consoleDisconnectAction == CDA.REBOOT:
self.shutdown(delay=delay, reboot=True, timeout=timeout,
message='Scheduled reboot on disconnect',
--
To view, visit https://gerrit.ovirt.org/59866
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I65b030d4a7a7ed7ad3f6279c66120d1f9e45d396
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
7 years, 10 months
Change in vdsm[master]: vdsm.spec: during rpm build only tests target will run
by igoihman@redhat.com
Irit Goihman has uploaded a new change for review.
Change subject: vdsm.spec: during rpm build only tests target will run
......................................................................
vdsm.spec: during rpm build only tests target will run
during vdsm rpm check 'make check' is running pep8 and pyflakes
using tox.
not all machines support tox and there are some issues
running tox without network.
separating tests from other targets enables creating an rpm
without tox.
Change-Id: I318f00266c3b0bfa198c87da508d1bfe0eb7e359
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/10/59910/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 4e8e074..ab04767 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -798,7 +798,7 @@
%{buildroot}%{_sysconfdir}/libvirt/hooks/qemu
%check
-make check
+make tests
%clean
rm -rf %{buildroot}
--
To view, visit https://gerrit.ovirt.org/59910
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I318f00266c3b0bfa198c87da508d1bfe0eb7e359
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
7 years, 10 months
Change in vdsm[master]: tests: Add tests for verify_untrusted_volume
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: tests: Add tests for verify_untrusted_volume
......................................................................
tests: Add tests for verify_untrusted_volume
Add some tests to check that verify_untrusted_volume works as expected.
Tests are placed in a new storage_hsm_test module which can accomodate
tests for other HSM verbs.
Change-Id: I44d3bbe33430a34e3a3b985e1485c6d46ebdc3aa
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M tests/Makefile.am
A tests/storage_hsm_test.py
M tests/storagetestlib.py
3 files changed, 84 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/60/60060/1
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 874f75f..4ba4d10 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -121,6 +121,7 @@
storage_asyncevent_test.py \
storage_check_test.py \
storage_directio_test.py \
+ storage_hsm_test.py \
storage_monitor_test.py \
storage_rwlock_test.py \
storage_sdm_api_test.py \
diff --git a/tests/storage_hsm_test.py b/tests/storage_hsm_test.py
new file mode 100644
index 0000000..f2f2629
--- /dev/null
+++ b/tests/storage_hsm_test.py
@@ -0,0 +1,80 @@
+#
+# Copyright 2016 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 uuid
+from contextlib import contextmanager
+
+from testlib import VdsmTestCase
+from testlib import permutations, expandPermutations
+from storagetestlib import fake_file_env
+from storagetestlib import make_file_volume
+
+from vdsm import qemuimg
+from vdsm.storage import constants as sc
+from vdsm.storage import exception as se
+
+from storage.hsm import HSM
+
+
+class FakeHSM(HSM):
+ def __init__(self):
+ pass
+
+
+@expandPermutations
+class VerifyUntrustedVolumeTest(VdsmTestCase):
+ SIZE = 1024 * 1024
+
+ @permutations(((sc.RAW_FORMAT,), (sc.COW_FORMAT,)))
+ def test_ok(self, vol_fmt):
+ with self.fake_volume(vol_fmt) as vol:
+ qemu_fmt = sc.FMT2STR[vol_fmt]
+ qemuimg.create(vol.volumePath, size=self.SIZE, format=qemu_fmt)
+ hsm = FakeHSM()
+ self.assertNotRaises(hsm.verify_untrusted_volume,
+ 'sp', vol.sdUUID, vol.imgUUID, vol.volUUID)
+
+ def test_wrong_format_raises(self):
+ with self.fake_volume(sc.RAW_FORMAT) as vol:
+ qemu_fmt = qemuimg.FORMAT.QCOW2
+ qemuimg.create(vol.volumePath, size=self.SIZE, format=qemu_fmt)
+ hsm = FakeHSM()
+ self.assertRaises(se.ImageVerificationError,
+ hsm.verify_untrusted_volume,
+ 'sp', vol.sdUUID, vol.imgUUID, vol.volUUID)
+
+ def test_backingfile_raises(self):
+ with self.fake_volume(sc.COW_FORMAT) as vol:
+ qemu_fmt = qemuimg.FORMAT.QCOW2
+ qemuimg.create(vol.volumePath, size=self.SIZE, format=qemu_fmt,
+ backing='foo')
+ hsm = FakeHSM()
+ self.assertRaises(se.ImageVerificationError,
+ hsm.verify_untrusted_volume,
+ 'sp', vol.sdUUID, vol.imgUUID, vol.volUUID)
+
+ @contextmanager
+ def fake_volume(self, vol_fmt):
+ with fake_file_env() as env:
+ img_id = str(uuid.uuid4())
+ vol_id = str(uuid.uuid4())
+ make_file_volume(env.sd_manifest, self.SIZE, img_id, vol_id,
+ vol_format=vol_fmt)
+ yield env.sd_manifest.produceVolume(img_id, vol_id)
diff --git a/tests/storagetestlib.py b/tests/storagetestlib.py
index 35f59c4..245e776 100644
--- a/tests/storagetestlib.py
+++ b/tests/storagetestlib.py
@@ -29,6 +29,7 @@
from vdsm.storage import constants as sc
from storage import sd, blockSD, fileSD, image, blockVolume, volume
+from storage import hsm
from storage.sdm import volume_artifacts
@@ -52,6 +53,7 @@
with MonkeyPatchScope([
[sd, 'storage_repository', tmpdir],
[volume, 'sdCache', fake_sdc],
+ [hsm, 'sdCache', fake_sdc],
]):
fake_sdc.domains[sd_manifest.sdUUID] = FakeSD(sd_manifest)
yield FakeEnv(sd_manifest)
@@ -68,6 +70,7 @@
(volume_artifacts, 'lvm', lvm),
(sd, 'storage_repository', tmpdir),
(volume, 'sdCache', fake_sdc),
+ (hsm, 'sdCache', fake_sdc),
]):
sd_manifest = make_blocksd_manifest(tmpdir, lvm)
fake_sdc.domains[sd_manifest.sdUUID] = FakeSD(sd_manifest)
--
To view, visit https://gerrit.ovirt.org/60060
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I44d3bbe33430a34e3a3b985e1485c6d46ebdc3aa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
7 years, 10 months
Change in vdsm[master]: contrib: Add tool for getting hsm stats
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: contrib: Add tool for getting hsm stats
......................................................................
contrib: Add tool for getting hsm stats
This is a very simple tool showing historgam of hsm calls in the given
log files.
Example:
$ hsmstat vdsm.log.1 vdsm.log.2
8515 getVolumeSize
2258 repoStats
51 getVolumeInfo
30 getVolumesList
19 teardownImage
...
We can get same output or better using logdb by writing some smart sql.
Change-Id: Ia6013da71ca96535b98edace8577a4d8bb529465
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
A contrib/hsmstat
1 file changed, 39 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/38748/1
diff --git a/contrib/hsmstat b/contrib/hsmstat
new file mode 100755
index 0000000..d3400d2
--- /dev/null
+++ b/contrib/hsmstat
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 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 collections import defaultdict
+import fileinput
+import re
+
+verb_re = re.compile(r" Run and protect: (?P<name>.+)\(")
+
+verbs = defaultdict(int)
+
+for line in fileinput.input():
+ match = verb_re.search(line)
+ if match:
+ name = match.group('name')
+ verbs[name] += 1
+
+histogram = sorted(((count, verb) for verb, count in verbs.iteritems()),
+ reverse=True)
+for count, name in histogram:
+ print " %6d %s" % (count, name)
--
To view, visit https://gerrit.ovirt.org/38748
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6013da71ca96535b98edace8577a4d8bb529465
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 10 months
Change in vdsm[master]: contrib: Add tool for getting repoStats statistics
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: contrib: Add tool for getting repoStats statistics
......................................................................
contrib: Add tool for getting repoStats statistics
This tool is useful when debugging storage domain monitoring issues.
Examples:
$ repostat vdsm.log.*
domain: ebcd25b1-1ab0-47e3-aa8b-83ee5f91b5bd
delay avg: 0.093941 min: 0.000430 max: 1.499200
last check avg: 5.117508 min: 0.000000 max: 12.300000
domain: 6d7f7a48-4511-43b8-8abf-d323f7118b19
delay avg: 0.001090 min: 0.000300 max: 0.030056
last check avg: 4.975313 min: 0.000000 max: 10.200000
Change-Id: Id5f7828216058bb401f8a472fa5601e79542def1
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M Makefile.am
A contrib/repostat
2 files changed, 55 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/38749/1
diff --git a/Makefile.am b/Makefile.am
index 34885a1..7407b22 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -49,6 +49,7 @@
autogen.sh \
build-aux/pkg-version \
contrib/profile-stats \
+ contrib/repostat \
pylintrc \
vdsm.spec \
vdsm.spec.in \
@@ -80,6 +81,7 @@
WHITELIST = \
contrib/profile-stats \
+ contrib/repostat \
init/daemonAdapter \
vdsm/get-conf-item \
vdsm/set-conf-item \
diff --git a/contrib/repostat b/contrib/repostat
new file mode 100755
index 0000000..c140b4c
--- /dev/null
+++ b/contrib/repostat
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 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
+#
+"""
+Parse repoStats log lines and calculate statistics.
+
+Usage: repostat vdsm.log [...]
+"""
+
+import fileinput
+import re
+
+repostat_re = re.compile(r' Run and protect: repoStats, Return response: ')
+
+stats = {}
+
+
+def liststat(a):
+ b = sorted(a)
+ return sum(b) / len(b), b[0], b[-1]
+
+
+for line in fileinput.input():
+ match = repostat_re.search(line)
+ if not match:
+ continue
+ response = eval(line[match.end():])
+ for uuid, info in response.items():
+ stats.setdefault(uuid, {'delays': [], 'checks': []})
+ stats[uuid]['delays'].append(float(info['delay']))
+ stats[uuid]['checks'].append(float(info['lastCheck']))
+
+for uuid, info in stats.iteritems():
+ print 'domain:', uuid
+ print ' delay avg: %f min: %f max: %f' % liststat(info['delays'])
+ print ' last check avg: %f min: %f max: %f' % liststat(info['checks'])
--
To view, visit https://gerrit.ovirt.org/38749
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5f7828216058bb401f8a472fa5601e79542def1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 10 months
Change in vdsm[master]: tox: added disable tox style validation option to Makefile
by igoihman@redhat.com
Irit Goihman has uploaded a new change for review.
Change subject: tox: added disable tox style validation option to Makefile
......................................................................
tox: added disable tox style validation option to Makefile
This patch adds DISABLE_STYLE_VALIDATION which is an environment
variable that disables tox run.
This option is useful for developers who encounter issues running tox
on their environment and want to skip tox style validation.
use it by the following:
make check DISABLE_STYLE_VALIDATION=1
Change-Id: I378dbf38bbce6cadf87fbedbc9bf6a5d1c714571
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
---
M Makefile.am
1 file changed, 15 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/59417/1
diff --git a/Makefile.am b/Makefile.am
index 9ac2515..9d43d58 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -81,18 +81,26 @@
.PHONY: pyflakes
pyflakes:
- if [ -n "$(TOX)" ]; then \
- tox -- pyflakes; \
+ if [ "$(DISABLE_STYLE_VALIDATION)" == "1" ]; then \
+ echo "Warning: style validation disabled, skipping check"; \
else \
- echo "Warning: tox is not installed, skipping check"; \
- fi
+ if [ -n "$(TOX)" ]; then \
+ tox -- pyflakes; \
+ else \
+ echo "Warning: tox is not installed, skipping check"; \
+ fi \
+ fi
.PHONY: pep8
pep8:
- if [ -n "$(TOX)" ]; then \
- tox -- pep8; \
+ if [ "$(DISABLE_STYLE_VALIDATION)" == "1" ]; then \
+ echo "Warning: style validation disabled, skipping check"; \
else \
- echo "Warning: tox is not installed, skipping check"; \
+ if [ -n "$(TOX)" ]; then \
+ tox -- pep8; \
+ else \
+ echo "Warning: tox is not installed, skipping check"; \
+ fi \
fi
.PHONY: python3
--
To view, visit https://gerrit.ovirt.org/59417
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I378dbf38bbce6cadf87fbedbc9bf6a5d1c714571
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
7 years, 10 months