Change in vdsm[master]: procwatch: Modernize and clarify helper name
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: procwatch: Modernize and clarify helper name
......................................................................
procwatch: Modernize and clarify helper name
assertUnexpectedCall looks like an assert helper, but we use it as a
guarde to detect incorrect assumptions in the test. Rename to
unexpected_data, callback function that raise if unexpected data is
recevived.
Change-Id: Ia5375f57aebf977d9f78c01f1b25253d0a9b1675
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M tests/procwatch_test.py
1 file changed, 9 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/76/65076/1
diff --git a/tests/procwatch_test.py b/tests/procwatch_test.py
index 49181f5..d66d3ff 100644
--- a/tests/procwatch_test.py
+++ b/tests/procwatch_test.py
@@ -50,8 +50,8 @@
c = self.startCommand(cmd)
watcher = procwatch.ProcessWatcher(
c,
- recv_data if recv_out else self.assertUnexpectedCall,
- recv_data if recv_err else self.assertUnexpectedCall)
+ recv_data if recv_out else self.unexpected_data,
+ recv_data if recv_err else self.unexpected_data)
while not watcher.closed:
watcher.receive()
@@ -77,8 +77,8 @@
c = self.startCommand(cmd)
watcher = procwatch.ProcessWatcher(
c,
- recv_data if recv_out else self.assertUnexpectedCall,
- recv_data if recv_err else self.assertUnexpectedCall)
+ recv_data if recv_out else self.unexpected_data,
+ recv_data if recv_err else self.unexpected_data)
c.stdin.write(text)
c.stdin.flush()
@@ -94,8 +94,8 @@
def test_timeout(self):
c = self.startCommand(["sleep", "5"])
- watcher = procwatch.ProcessWatcher(c, self.assertUnexpectedCall,
- self.assertUnexpectedCall)
+ watcher = procwatch.ProcessWatcher(
+ c, self.unexpected_data, self.unexpected_data)
with self.assertElapsed(2):
watcher.receive(2)
@@ -112,8 +112,8 @@
))
def test_signals(self, method, expected_retcode):
c = self.startCommand(["sleep", "2"])
- watcher = procwatch.ProcessWatcher(c, self.assertUnexpectedCall,
- self.assertUnexpectedCall)
+ watcher = procwatch.ProcessWatcher(
+ c, self.unexpected_data, self.unexpected_data)
getattr(c, method)()
@@ -125,7 +125,7 @@
self.assertEqual(retcode, expected_retcode)
- def assertUnexpectedCall(self, data):
+ def unexpected_data(self, data):
raise AssertionError("Unexpected data: %r" % data)
def startCommand(self, command):
--
To view, visit https://gerrit.ovirt.org/65076
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5375f57aebf977d9f78c01f1b25253d0a9b1675
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: procwatch: Move test helpers to bottom
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: procwatch: Move test helpers to bottom
......................................................................
procwatch: Move test helpers to bottom
The most important thing in a test class are the tests, not the helpers.
If you want to inspect the implementation details please scroll down.
Change-Id: Ib5909a0016b04d67cbdeec845234bcfcb61fbde7
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M tests/procwatch_test.py
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/65075/1
diff --git a/tests/procwatch_test.py b/tests/procwatch_test.py
index 1c6b365..49181f5 100644
--- a/tests/procwatch_test.py
+++ b/tests/procwatch_test.py
@@ -32,12 +32,6 @@
@expandPermutations
class ProcessWatcherTests(VdsmTestCase):
- def assertUnexpectedCall(self, data):
- raise AssertionError("Unexpected data: %r" % data)
-
- def startCommand(self, command):
- return compat.CPopen(command)
-
@permutations([
(['echo', '-n', '%s'], True, False),
(['sh', '-c', 'echo -n "%s" >&2'], False, True),
@@ -130,3 +124,9 @@
retcode = c.wait()
self.assertEqual(retcode, expected_retcode)
+
+ def assertUnexpectedCall(self, data):
+ raise AssertionError("Unexpected data: %r" % data)
+
+ def startCommand(self, command):
+ return compat.CPopen(command)
--
To view, visit https://gerrit.ovirt.org/65075
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib5909a0016b04d67cbdeec845234bcfcb61fbde7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: travis: Run docker with --privileged
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: travis: Run docker with --privileged
......................................................................
travis: Run docker with --privileged
Running docker with --privileged allow creation of loop devices inside
the container and fix some of the networking tests.
Change-Id: I1865c03bd4c4040ac562c418fabf22f267381950
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M .travis.yml
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/65146/1
diff --git a/.travis.yml b/.travis.yml
index 4578acb..96dd9c3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,4 +12,4 @@
- docker pull nirs/vdsm-centos
script:
- - docker run --rm -it -v `pwd`:/vdsm:Z nirs/vdsm-centos bash -c "cd /vdsm && ./autogen.sh --system && make; make check"
+ - docker run --privileged --rm -it -v `pwd`:/vdsm:Z nirs/vdsm-centos bash -c "cd /vdsm && ./autogen.sh --system && make; make check"
--
To view, visit https://gerrit.ovirt.org/65146
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1865c03bd4c4040ac562c418fabf22f267381950
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: travis: Fix build using new docker image
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: travis: Fix build using new docker image
......................................................................
travis: Fix build using new docker image
- Use the new image built from updated dockerfile
- Remove unneeded true value to --rm option
- Use Z volume option to make it work with selinux on Fedora
- Use "make check" instead of "make check-unit" since the later has no
effect currently (it runs exactly the same tests as make check).
Tested locally on Fedora 24 - some tests fail, more work need to disable
the incompatible tests.
Change-Id: I807adb49c7a653d9ca6e58ff40a82a270eaf3309
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M .travis.yml
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/65070/1
diff --git a/.travis.yml b/.travis.yml
index 8974bbb..4578acb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,7 +9,7 @@
before_install:
- docker --version
- - docker pull edwardhaas/ovirt-vdsm-dev
+ - docker pull nirs/vdsm-centos
script:
- - docker run --rm=true -it -v `pwd`:/vdsm:rw edwardhaas/ovirt-vdsm-dev /bin/bash -c "cd /vdsm && ./autogen.sh --system && make; make check-unit"
+ - docker run --rm -it -v `pwd`:/vdsm:Z nirs/vdsm-centos bash -c "cd /vdsm && ./autogen.sh --system && make; make check"
--
To view, visit https://gerrit.ovirt.org/65070
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I807adb49c7a653d9ca6e58ff40a82a270eaf3309
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: dockerfile: Install developer tools using pip
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: dockerfile: Install developer tools using pip
......................................................................
dockerfile: Install developer tools using pip
- Remove python-nose which is too old on CentOS, and install version
1.3.7 using pip
- Install tox version 2.1.1 using pip.
- Install mock, since python-mock is missing in CentOS.
- Remove pyflakes and pep8 as they are installed using tox when running
make check.
Change-Id: Ia4e10a727af5f75b6ede3cc271c2e32eac2fedd8
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M contrib/Dockerfile
1 file changed, 1 insertion(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/69/65069/1
diff --git a/contrib/Dockerfile b/contrib/Dockerfile
index 662881d..ff8affd 100644
--- a/contrib/Dockerfile
+++ b/contrib/Dockerfile
@@ -17,7 +17,6 @@
python-inotify \
python-ioprocess \
python-netaddr \
- python-nose \
python-pthreading \
python-setuptools \
python-six \
@@ -27,5 +26,4 @@
sanlock-python \
&& \
easy_install pip && \
- easy_install pyflakes && \
- pip install pep8==1.5.6
+ pip install nose==1.3.7 tox==2.1.1 mock
--
To view, visit https://gerrit.ovirt.org/65069
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4e10a727af5f75b6ede3cc271c2e32eac2fedd8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: dockerfile: Use one package per line
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: dockerfile: Use one package per line
......................................................................
dockerfile: Use one package per line
Having one package per line make it easier to add and remove packages
and review changes.
Change-Id: I87ae78f149fc0042853c71c7f2f7bb8cf6300e1f
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M contrib/Dockerfile
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/65068/1
diff --git a/contrib/Dockerfile b/contrib/Dockerfile
index c0a38cb..662881d 100644
--- a/contrib/Dockerfile
+++ b/contrib/Dockerfile
@@ -4,12 +4,14 @@
yum install -y \
PyYAML \
autoconf \
- automake git \
+ automake \
+ git \
libselinux-python \
libvirt-python \
make \
+ mom \
psmisc \
- python-cpopen mom \
+ python-cpopen \
python-decorator \
python-devel \
python-inotify \
--
To view, visit https://gerrit.ovirt.org/65068
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I87ae78f149fc0042853c71c7f2f7bb8cf6300e1f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: dockerfile: Add missing packages
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: dockerfile: Add missing packages
......................................................................
dockerfile: Add missing packages
Add packages added recently as build requirement on master
(python-decorator, PyYaml, sanlock-python) and packages that were
missing in the original file (python-setuptools).
Change-Id: I204be6a9b83af9d2b12abc8267d2d1ccd4fd746d
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M contrib/Dockerfile
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/65067/1
diff --git a/contrib/Dockerfile b/contrib/Dockerfile
index 6e9ff5b..c0a38cb 100644
--- a/contrib/Dockerfile
+++ b/contrib/Dockerfile
@@ -2,6 +2,7 @@
RUN yum install -y http://resources.ovirt.org/pub/yum-repo/ovirt-release-master.rpm && \
yum update -y && \
yum install -y \
+ PyYAML \
autoconf \
automake git \
libselinux-python \
@@ -9,16 +10,19 @@
make \
psmisc \
python-cpopen mom \
+ python-decorator \
python-devel \
python-inotify \
python-ioprocess \
python-netaddr \
python-nose \
python-pthreading \
+ python-setuptools \
python-six \
python34 \
python34-nose \
python34-six \
+ sanlock-python \
&& \
easy_install pip && \
easy_install pyflakes && \
--
To view, visit https://gerrit.ovirt.org/65067
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I204be6a9b83af9d2b12abc8267d2d1ccd4fd746d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: schema: fixing type of default values
by Piotr Kliczewski
Piotr Kliczewski has uploaded a new change for review.
Change subject: schema: fixing type of default values
......................................................................
schema: fixing type of default values
Change-Id: Id5ee7e26b9228bd4e423f3fbc87efff5c4374294
Signed-off-by: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
---
M lib/api/vdsm-api.yml
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/65113/1
diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index 776b592..9ebac7a 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -2120,35 +2120,35 @@
description: I/O tune parameters for the VM disk device.
name: VmDiskDeviceIoTuneParams
properties:
- - defaultvalue: 0 - means unlimited
+ - defaultvalue: 0
description: Total throughput limit in bytes per
second.
name: total_bytes_sec
type: uint
- - defaultvalue: 0 - means unlimited
+ - defaultvalue: 0
description: Read throughput limit in bytes per
second.
name: read_bytes_sec
type: uint
- - defaultvalue: 0 - means unlimited
+ - defaultvalue: 0
description: Write throughput limit in bytes per
second.
name: write_bytes_sec
type: uint
- - defaultvalue: 0 - means unlimited
+ - defaultvalue: 0
description: Total I/O operations limit per second.
name: total_iops_sec
type: uint
- - defaultvalue: 0 - means unlimited
+ - defaultvalue: 0
description: Read I/O operations limit per second.
name: read_iops_sec
type: uint
- - defaultvalue: 0 - means unlimited
+ - defaultvalue: 0
description: Write I/O operations limit per second.
name: write_iops_sec
type: uint
--
To view, visit https://gerrit.ovirt.org/65113
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5ee7e26b9228bd4e423f3fbc87efff5c4374294
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
7 years, 8 months
Change in vdsm[master]: net tests: bond tests fails on CI with ctypes.AttributeError
by phoracek@redhat.com
Petr Horáček has uploaded a new change for review.
Change subject: net tests: bond tests fails on CI with ctypes.AttributeError
......................................................................
net tests: bond tests fails on CI with ctypes.AttributeError
Change-Id: I6c88dd66056cbb1f65f77e8b1a7cf1f03e4fb80a
---
M tests/network/link_bond_test.py
1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/64345/1
diff --git a/tests/network/link_bond_test.py b/tests/network/link_bond_test.py
index a610f63..7eb8b00 100644
--- a/tests/network/link_bond_test.py
+++ b/tests/network/link_bond_test.py
@@ -20,12 +20,15 @@
from contextlib import contextmanager
+import ctypes
+
from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
from testlib import VdsmTestCase as TestCaseBase
from .nettestlib import dummy_devices
+from testValidation import broken_on_ci
from vdsm.network.link import iface
from vdsm.network.link.bond import Bond
@@ -41,16 +44,19 @@
@attr(type='integration')
class LinkBondTests(TestCaseBase):
+ @broken_on_ci(exception=ctypes.ArgumentError)
def test_bond_without_slaves(self):
with bond_device() as bond:
self.assertFalse(iface.is_up(bond.master))
+ @broken_on_ci(exception=ctypes.ArgumentError)
def test_bond_with_slaves(self):
with dummy_devices(2) as (nic1, nic2):
with bond_device() as bond:
bond.add_slaves((nic1, nic2))
self.assertFalse(iface.is_up(bond.master))
+ @broken_on_ci(exception=ctypes.ArgumentError)
def test_bond_devices_are_up(self):
with dummy_devices(2) as (nic1, nic2):
with bond_device() as bond:
@@ -60,6 +66,7 @@
self.assertTrue(iface.is_up(nic2))
self.assertTrue(iface.is_up(bond.master))
+ @broken_on_ci(exception=ctypes.ArgumentError)
def test_bond_exists(self):
with dummy_devices(2) as (nic1, nic2):
with bond_device() as _bond:
@@ -77,6 +84,7 @@
expected_bond_set = set([b1.master, b2.master, b3.master])
self.assertLessEqual(expected_bond_set, actual_bond_set)
+ @broken_on_ci(exception=ctypes.ArgumentError)
def test_bond_create_failure_on_slave_add(self):
with dummy_devices(2) as (nic1, nic2):
with bond_device() as base_bond:
@@ -89,6 +97,7 @@
broken_bond.add_slaves((nic1, nic2))
self.assertFalse(Bond(bond_name).exists())
+ @broken_on_ci(exception=ctypes.ArgumentError)
def test_bond_edit_failure_on_slave_add(self):
with dummy_devices(2) as (nic1, nic2):
with bond_device() as base_bond, bond_device() as edit_bond:
--
To view, visit https://gerrit.ovirt.org/64345
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c88dd66056cbb1f65f77e8b1a7cf1f03e4fb80a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
7 years, 8 months
Change in vdsm[master]: [WIP] core: Expose API for qemu-img commit
by ahino@redhat.com
Ala Hino has uploaded a new change for review.
Change subject: [WIP] core: Expose API for qemu-img commit
......................................................................
[WIP] core: Expose API for qemu-img commit
Change-Id: If7a13be40541fb268541bd8614a642263b96b487
Signed-off-by: Ala Hino <ahino(a)redhat.com>
---
M lib/vdsm/qemuimg.py
M tests/qemuimg_test.py
2 files changed, 35 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/64222/1
diff --git a/lib/vdsm/qemuimg.py b/lib/vdsm/qemuimg.py
index 61ebec3..4ad7073 100644
--- a/lib/vdsm/qemuimg.py
+++ b/lib/vdsm/qemuimg.py
@@ -185,6 +185,16 @@
return QemuImgOperation(cmd, cwd=cwdPath)
+def commit(top, base=None):
+ cmd = [_qemuimg.cmd, "commit", "-p"]
+ if base:
+ cmd.extend(("-b", base))
+ else:
+ cmd.append("-d")
+
+ return QemuImgOperation(cmd)
+
+
class QemuImgOperation(object):
REGEXPR = re.compile(r'\s*\(([\d.]+)/100%\)\s*')
diff --git a/tests/qemuimg_test.py b/tests/qemuimg_test.py
index d7d9fab..3fd97ea 100644
--- a/tests/qemuimg_test.py
+++ b/tests/qemuimg_test.py
@@ -23,6 +23,7 @@
from functools import partial
from monkeypatch import MonkeyPatch, MonkeyPatchScope
+from storagetestlib import qemu_pattern_write, qemu_pattern_verify
from testlib import VdsmTestCase as TestCaseBase
from testlib import permutations, expandPermutations
from testlib import make_config
@@ -329,3 +330,27 @@
p.poll()
self.assertEquals(p.finished, True)
+
+class TestCommit(TestCaseBase):
+
+ @MonkeyPatch(qemuimg, 'config', CONFIG)
+ def test_commit(self):
+ with namedTemporaryDir() as tmpdir:
+ base = os.path.join(tmpdir, 'base.img')
+ top = os.path.join(tmpdir, 'top.img')
+ size = 1048576
+ qemuimg.create(base, size=size, format=qemuimg.FORMAT.RAW)
+ qemu_pattern_write(base, qemuimg.FORMAT.RAW, '0', 0xf0)
+
+ qemuimg.create(top, format=qemuimg.FORMAT.QCOW2, backing=base)
+ qemu_pattern_write(top, qemuimg.FORMAT.QCOW2, '1024', 0xf1)
+
+ op = qemuimg.commit(top=top)
+ op.wait_for_completion()
+
+ # top should not change after commit
+ qemu_pattern_verify(top, qemuimg.FORMAT.RAW, '0', 0xf1)
+
+ # base now should include original data and top's data
+ qemu_pattern_verify(base, qemuimg.FORMAT.RAW, '0', 0xf0)
+ qemu_pattern_verify(base, qemuimg.FORMAT.RAW, '1024', 0xf1)
--
To view, visit https://gerrit.ovirt.org/64222
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If7a13be40541fb268541bd8614a642263b96b487
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <ahino(a)redhat.com>
7 years, 8 months