[libvirt] [PATCH v4 0/5] Apparmor support for less common devices
by Christian Ehrhardt
So far users added manual rules for most of these uncommon devices,
but recent changes made some of the callbacks mandatory for hotplug
so we should take shot at implementing them as those callbacks as well
as for the initial start of a guest via virt-aa-helper.
*Updates since v1*
- Set(Memory|Input)Label: remove seclabel check already done in reload_profile
- virt-aa-helper: check pointers before accessing them
- add tests for new virt-aa-helper supported xml elements
- extend tests to check for expected content (new patch in series)
*Updates since v2*
- Restore(Memory|Input)Label: drop secdef/relabel check
- Set(Memory|Input)Label: check more pointers to be valid before using them
*Updates since v3*
- added the Acked-by of Jamie Strandboge on patches 1-4
- reuse the already existing tmpdir in virt-aa-helper-test for better cleanup
Christian Ehrhardt (5):
security, apparmor: add (Set|Restore)MemoryLabel
security, apparmor: add (Set|Restore)InputLabel
virt-aa-helper: generate rules for passthrough input devices
virt-aa-helper: generate rules for nvdimm memory
virt-aa-helper: test: check for expected profile content
src/security/security_apparmor.c | 94 ++++++++++++++++++++++++++++++++++++++++
src/security/virt-aa-helper.c | 16 +++++++
tests/virt-aa-helper-test | 87 ++++++++++++++++++++++---------------
3 files changed, 163 insertions(+), 34 deletions(-)
--
2.7.4
6 years, 9 months
[libvirt] [PATCH] tools: fix variable scope in in check_guests_shutdown
by Christian Ehrhardt
libvirt-guests.sh when run with more active guests than requested to
shut down in parallel will run until it times out only shutting down
the first set of guests.
This patch fixes parallel shutdown by fixing a variable scope issue
where check_guests_shutdown unintentionally reset $guests which
prevented further progress.
Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1688508
Signed-off-by: Christian Ehrhardt <christian.ehrhardt(a)canonical.com>
---
tools/libvirt-guests.sh.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
index d5e68e5..fcada31 100644
--- a/tools/libvirt-guests.sh.in
+++ b/tools/libvirt-guests.sh.in
@@ -333,11 +333,11 @@ guest_count()
check_guests_shutdown()
{
uri=$1
- guests=$2
+ guests_to_check=$2
guests_shutting_down=
for guest in $guests; do
- if ! guest_is_on "$uri" "$guest" >/dev/null 2>&1; then
+ if ! guest_is_on "$uri" "$guests_to_check" >/dev/null 2>&1; then
eval_gettext "Failed to determine state of guest: \$guest. Not tracking it anymore."
echo
continue
--
2.7.4
6 years, 9 months
[libvirt] [PATCH v2] test_driver: Add testDomainDestroyFlags
by Katerina Koukiou
Adding this for completeness
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
Needed by the libvirt-dbus which is using test_driver for tests.
src/test/test_driver.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 4de0cc533..99c27cc0a 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1782,13 +1782,16 @@ static int testConnectListDomains(virConnectPtr conn,
NULL, NULL);
}
-static int testDomainDestroy(virDomainPtr domain)
+static int testDomainDestroyFlags(virDomainPtr domain,
+ unsigned int flags)
{
testDriverPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom;
virObjectEventPtr event = NULL;
int ret = -1;
+ virCheckFlags(VIR_DOMAIN_DESTROY_GRACEFUL, -1);
+
if (!(privdom = testDomObjFromDomain(domain)))
goto cleanup;
@@ -1813,6 +1816,11 @@ static int testDomainDestroy(virDomainPtr domain)
return ret;
}
+static int testDomainDestroy(virDomainPtr domain)
+{
+ return testDomainDestroyFlags(domain, 0);
+}
+
static int testDomainResume(virDomainPtr domain)
{
testDriverPtr privconn = domain->conn->privateData;
@@ -6872,6 +6880,7 @@ static virHypervisorDriver testHypervisorDriver = {
.domainShutdownFlags = testDomainShutdownFlags, /* 0.9.10 */
.domainReboot = testDomainReboot, /* 0.1.1 */
.domainDestroy = testDomainDestroy, /* 0.1.1 */
+ .domainDestroyFlags = testDomainDestroyFlags, /* 4.2.0 */
.domainGetOSType = testDomainGetOSType, /* 0.1.9 */
.domainGetMaxMemory = testDomainGetMaxMemory, /* 0.1.4 */
.domainSetMaxMemory = testDomainSetMaxMemory, /* 0.1.1 */
--
2.15.0
6 years, 9 months
[libvirt] [PATCH 00/11] tests: Add QAPI schema validation (blockdev-add saga)
by Peter Krempa
The new test APIs allow to validate JSON objects against the QAPI
schema. The infrastructure was developed as part of not-yet-posted
blockdev JSON property generator. It is quite useful for developing
generators for complex objects against the schema.
Since it's kind of useful by itself I decided to post it prior to
finishing the blockdev work. It at least makes the 'simple' test cases
in the qemumonitorjsontest slightly useful.
Peter Krempa (11):
util: buffer: Tolerate NULL 'buf' in virBufferStrcat
qemu: caps: Move QAPI schema related code into separate file
qemu: qapi: Fix naming of moved functions
qemu: monitor: Move processing of QMP schema to the new file
util: json: Add accessor for looking up JSON value type
qemu: qapi: Return correct entry in virQEMUQapiSchemaTraverse
tests: Add data file with QEMU QAPI schema
tests: qemu: Add infrastructure for QAPI schema testing
tests: qemumonitorjson: Fix few arguments of test cases
tests: qemumonitor: Allow testing schema for fake monitor interactions
tests: qemumonitorjson: Do some useful testing in the 'simple' tests
po/POTFILES.in | 1 +
src/libvirt_private.syms | 1 +
src/qemu/Makefile.inc.am | 2 +
src/qemu/qemu_capabilities.c | 171 +-
src/qemu/qemu_monitor.c | 2 +-
src/qemu/qemu_monitor.h | 2 +-
src/qemu/qemu_monitor_json.c | 41 +-
src/qemu/qemu_monitor_json.h | 2 +-
src/qemu/qemu_qapi.c | 237 +
src/qemu/qemu_qapi.h | 40 +
src/util/virbuffer.c | 3 +
src/util/virjson.c | 7 +
src/util/virjson.h | 2 +
tests/Makefile.am | 3 +
tests/qemuhotplugtest.c | 3 +-
tests/qemumonitorjsontest.c | 117 +-
tests/qemumonitortestutils.c | 85 +-
tests/qemumonitortestutils.h | 7 +-
tests/qemuqapischema.json | 11364 +++++++++++++++++++++++++++++++++++++++++
tests/testutilsqemuschema.c | 536 ++
tests/testutilsqemuschema.h | 30 +
21 files changed, 12446 insertions(+), 210 deletions(-)
create mode 100644 src/qemu/qemu_qapi.c
create mode 100644 src/qemu/qemu_qapi.h
create mode 100644 tests/qemuqapischema.json
create mode 100644 tests/testutilsqemuschema.c
create mode 100644 tests/testutilsqemuschema.h
--
2.16.2
6 years, 9 months
[libvirt] [PATCH v2 0/7] Add support for video and input devices on S390
by Farhan Ali
Hi,
This patch series adds Libvirt support for video and input devices
for QEMU guests on S390. QEMU v2.11.0 added support for the
virtio-gpu-ccw device [1] and virtio-{keyboard, mouse, tablet}-ccw devices [2],
which can be used as video and input devices respectively.
Thanks
Farhan
[1] https://git.qemu.org/?p=qemu.git;a=commit;h=1f8ad88935f5cb5a2968909e392db...
[2] https://git.qemu.org/?p=qemu.git;a=commit;h=3382cf1fabbf722dce931846853da...
ChangeLog
---------
v1 -> v2
- Split virtio-gpu-ccw capability (patch 1) and functionality (patch 2)
into 2 patches.
- Code changes per John's comments (patch 2).
- Split capability for input devices (patch 4) and functionality (patch 5)
into 2 patches.
- Modify news update as per John's suggestion (patch 7).
Farhan Ali (7):
qemu: Introduce a new capability for virtio-gpu-ccw
qemu: Add support for virtio-gpu-ccw video device on S390
tests: Add test cases for virtio-gpu-ccw
qemu: Introduce capabilities for virtio input ccw devices
qemu: Add support for virtio input ccw devices
tests: Add test case for virtio input ccw devices
news: Update for virtio-gpu-ccw and virtio input ccw devices
docs/formatdomain.html.in | 5 ++
docs/news.xml | 10 +++
src/qemu/qemu_capabilities.c | 13 ++++
src/qemu/qemu_capabilities.h | 6 ++
src/qemu/qemu_command.c | 27 +++++--
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_domain_address.c | 12 +++-
src/qemu/qemu_process.c | 5 +-
.../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 83 +++++++++++++++++++---
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 6 +-
tests/qemuxml2argvdata/input-virtio-ccw.args | 26 +++++++
tests/qemuxml2argvdata/input-virtio-ccw.xml | 29 ++++++++
.../qemuxml2argvdata/video-virtio-gpu-ccw-auto.xml | 18 +++++
tests/qemuxml2argvdata/video-virtio-gpu-ccw.args | 25 +++++++
tests/qemuxml2argvdata/video-virtio-gpu-ccw.xml | 35 +++++++++
tests/qemuxml2argvtest.c | 15 ++++
tests/qemuxml2xmloutdata/input-virtio-ccw.xml | 37 ++++++++++
.../video-virtio-gpu-ccw-auto.xml | 35 +++++++++
tests/qemuxml2xmloutdata/video-virtio-gpu-ccw.xml | 39 ++++++++++
tests/qemuxml2xmltest.c | 22 ++++++
20 files changed, 431 insertions(+), 19 deletions(-)
create mode 100644 tests/qemuxml2argvdata/input-virtio-ccw.args
create mode 100644 tests/qemuxml2argvdata/input-virtio-ccw.xml
create mode 100644 tests/qemuxml2argvdata/video-virtio-gpu-ccw-auto.xml
create mode 100644 tests/qemuxml2argvdata/video-virtio-gpu-ccw.args
create mode 100644 tests/qemuxml2argvdata/video-virtio-gpu-ccw.xml
create mode 100644 tests/qemuxml2xmloutdata/input-virtio-ccw.xml
create mode 100644 tests/qemuxml2xmloutdata/video-virtio-gpu-ccw-auto.xml
create mode 100644 tests/qemuxml2xmloutdata/video-virtio-gpu-ccw.xml
--
2.7.4
6 years, 9 months
[libvirt] [PATCH 0/2] rpc: cleanup some misc cruft
by Daniel P. Berrangé
Daniel P. Berrangé (2):
rpc: remove remains of obsolete log_buffer_size config parameter
rpc: avoid duplicating config in virtlockd/virtlogd augeas tests
src/locking/test_virtlockd.aug.in | 15 ++++-----------
src/locking/virtlockd.aug | 1 -
src/locking/virtlockd.conf | 15 +++------------
src/logging/test_virtlogd.aug.in | 15 ++++-----------
src/logging/virtlogd.aug | 1 -
src/logging/virtlogd.conf | 5 ++++-
src/remote/libvirtd.aug | 1 -
src/remote/libvirtd.conf | 7 -------
src/remote/test_libvirtd.aug.in | 1 -
9 files changed, 15 insertions(+), 46 deletions(-)
--
2.14.3
6 years, 9 months
[libvirt] [PATCH] test_driver: Add testDomainDestroyFlags
by Katerina Koukiou
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
src/test/test_driver.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 4de0cc533..f9482970a 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1782,13 +1782,17 @@ static int testConnectListDomains(virConnectPtr conn,
NULL, NULL);
}
-static int testDomainDestroy(virDomainPtr domain)
+static int testDomainDestroyFlags(virDomainPtr domain,
+ unsigned int flags)
{
testDriverPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom;
virObjectEventPtr event = NULL;
int ret = -1;
+ virCheckFlags(0, -1);
+
+
if (!(privdom = testDomObjFromDomain(domain)))
goto cleanup;
@@ -1813,6 +1817,11 @@ static int testDomainDestroy(virDomainPtr domain)
return ret;
}
+static int testDomainDestroy(virDomainPtr domain)
+{
+ return testDomainDestroyFlags(domain, 0);
+}
+
static int testDomainResume(virDomainPtr domain)
{
testDriverPtr privconn = domain->conn->privateData;
@@ -6872,6 +6881,7 @@ static virHypervisorDriver testHypervisorDriver = {
.domainShutdownFlags = testDomainShutdownFlags, /* 0.9.10 */
.domainReboot = testDomainReboot, /* 0.1.1 */
.domainDestroy = testDomainDestroy, /* 0.1.1 */
+ .domainDestroyFlags = testDomainDestroyFlags, /* 4.2.0 */
.domainGetOSType = testDomainGetOSType, /* 0.1.9 */
.domainGetMaxMemory = testDomainGetMaxMemory, /* 0.1.4 */
.domainSetMaxMemory = testDomainSetMaxMemory, /* 0.1.1 */
--
2.15.0
6 years, 9 months
[libvirt] [dbus PATCH] Convert testsuite from unittest to pytest
by Katerina Koukiou
Also add flake8 target in tests Makefile and rewrite
some parts to be more pythonic.
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
HACKING.md | 2 +-
test/Makefile.am | 15 ++++++++++++---
test/conftest.py | 15 +++++++++++++++
test/libvirttest.py | 51 ++++++++++++++++++++++++++++-----------------------
test/test_connect.py | 35 +++++++++++++++--------------------
test/test_domain.py | 39 +++++++++++++++++----------------------
test/travis-run | 4 ++--
7 files changed, 90 insertions(+), 71 deletions(-)
create mode 100644 test/conftest.py
diff --git a/HACKING.md b/HACKING.md
index 75aa6d0..30d321c 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -35,7 +35,7 @@ Running from git repository
make check
```
- The test tool requires python3 and python3-dbus.
+ The test tool requires python3, pytest and python3-dbus.
* To run libvirt-dbus directly from the build dir without installing it
diff --git a/test/Makefile.am b/test/Makefile.am
index d3997f3..554c433 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,17 +1,26 @@
test_helpers = \
- libvirttest.py
+ libvirttest.py \
+ conftest.py
test_programs = \
test_connect.py \
test_domain.py
-TESTS = $(test_programs)
-
EXTRA_DIST = \
$(test_helpers) \
$(test_programs) \
travis-run
+TEST_PATH=./
+
+lint:
+ flake8 --exclude=.tox --ignore=E501
+
+test:
+ py.test --verbose --color=yes $(TEST_PATH)
+
+check: lint test
+
TESTS_ENVIRONMENT = \
abs_top_builddir=$(abs_top_builddir) \
VIRT_DBUS_INTERFACES_DIR=$(abs_top_srcdir)/data
diff --git a/test/conftest.py b/test/conftest.py
new file mode 100644
index 0000000..a468599
--- /dev/null
+++ b/test/conftest.py
@@ -0,0 +1,15 @@
+import os
+import subprocess
+import pytest
+
+
+(a)pytest.fixture(scope="session", autouse=True)
+def dbus_daemon_session():
+ """Fixture to start D-Bus message bus session daemon for use in the whole test suite.
+ """
+ dbus_daemon = subprocess.Popen(['dbus-daemon', '--session', '--print-address'],
+ stdout=subprocess.PIPE, universal_newlines=True)
+ os.environ['DBUS_SESSION_BUS_ADDRESS'] = dbus_daemon.stdout.readline().strip()
+ yield
+ dbus_daemon.terminate()
+ dbus_daemon.wait(timeout=10)
diff --git a/test/libvirttest.py b/test/libvirttest.py
index 6a00aea..fc8c5c4 100644
--- a/test/libvirttest.py
+++ b/test/libvirttest.py
@@ -1,34 +1,33 @@
#!/usr/bin/python3
-from dbus.mainloop.glib import DBusGMainLoop
-from gi.repository import GLib
-import dbus
import os
import subprocess
import time
-import unittest
+import pytest
+from gi.repository import GLib
+from dbus.mainloop.glib import DBusGMainLoop
+import dbus
-root = os.environ.get('abs_top_builddir', os.path.dirname(os.path.dirname(__file__)))
-exe = os.path.join(root, 'src', 'libvirt-dbus')
+ROOT = os.environ.get('abs_top_builddir', os.path.dirname(os.path.dirname(__file__)))
+EXE = os.path.join(ROOT, 'src', 'libvirt-dbus')
DBusGMainLoop(set_as_default=True)
-class TestCase(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- cls.bus = subprocess.Popen(['dbus-daemon', '--session', '--print-address'],
- stdout=subprocess.PIPE, universal_newlines=True)
- os.environ['DBUS_SESSION_BUS_ADDRESS'] = cls.bus.stdout.readline().strip()
- @classmethod
- def tearDownClass(cls):
- cls.bus.terminate()
- cls.bus.wait(timeout=10)
+class BaseTestClass():
+ """ Base test class for whole test suite
+ """
+ connect = None
+ bus = None
+ libvirt_dbus = None
+ loop = False
- def setUp(self):
+ @pytest.fixture(autouse=True)
+ def libvirt_dbus_setup(self, request):
+ """Start libvirt-dbus for each test function
+ """
os.environ['LIBVIRT_DEBUG'] = '3'
-
- self.daemon = subprocess.Popen([exe])
+ self.libvirt_dbus = subprocess.Popen([EXE])
self.bus = dbus.SessionBus()
for i in range(10):
@@ -41,12 +40,18 @@ class TestCase(unittest.TestCase):
obj = self.bus.get_object('org.libvirt', '/org/libvirt/Test')
self.connect = dbus.Interface(obj, 'org.libvirt.Connect')
- def tearDown(self):
- self.daemon.terminate()
- self.daemon.wait(timeout=10)
+ @pytest.fixture(autouse=True)
+ def libvirt_dbus_teardown(self):
+ """Terminate libvirt-dbus at the teardown of each test
+ """
+ yield
+ self.libvirt_dbus.terminate()
+ self.libvirt_dbus.wait(timeout=10)
def main_loop(self):
- self.assertFalse(getattr(self, 'loop', False))
+ """Initializes the mainloop
+ """
+ assert getattr(self, 'loop', False) is False
def timeout():
self.loop.quit()
diff --git a/test/test_connect.py b/test/test_connect.py
index 4ec3fe0..14f70d5 100755
--- a/test/test_connect.py
+++ b/test/test_connect.py
@@ -1,10 +1,9 @@
-#!/usr/bin/python3
-
import dbus
import libvirttest
-import unittest
-minimal_xml = '''
+
+class TestConnect(libvirttest.BaseTestClass):
+ minimal_xml = '''
<domain type="test">
<name>foo</name>
<memory>1024</memory>
@@ -12,16 +11,15 @@ minimal_xml = '''
<type>hvm</type>
</os>
</domain>
-'''
+ '''
-class TestConnect(libvirttest.TestCase):
def test_list_domains(self):
domains = self.connect.ListDomains(0)
- self.assertEqual(type(domains), dbus.Array)
- self.assertEqual(len(domains), 1)
+ assert isinstance(domains, dbus.Array)
+ assert len(domains) == 1
for path in domains:
- self.assertEqual(type(path), dbus.ObjectPath)
+ assert isinstance(path, dbus.ObjectPath)
domain = self.bus.get_object('org.libvirt', path)
# ensure the path exists by calling Introspect on it
@@ -29,29 +27,26 @@ class TestConnect(libvirttest.TestCase):
def test_create(self):
def domain_started(name, path):
- self.assertEqual(name, 'foo')
- self.assertEqual(type(path), dbus.ObjectPath)
+ assert name == 'foo'
+ assert isinstance(path, dbus.ObjectPath)
self.loop.quit()
self.connect.connect_to_signal('DomainStarted', domain_started)
- path = self.connect.CreateXML(minimal_xml, 0)
- self.assertEqual(type(path), dbus.ObjectPath)
+ path = self.connect.CreateXML(self.minimal_xml, 0)
+ assert isinstance(path, dbus.ObjectPath)
self.main_loop()
def test_define(self):
def domain_defined(name, path):
- self.assertEqual(name, 'foo')
- self.assertEqual(type(path), dbus.ObjectPath)
+ assert name == 'foo'
+ assert isinstance(path, dbus.ObjectPath)
self.loop.quit()
self.connect.connect_to_signal('DomainDefined', domain_defined)
- path = self.connect.DefineXML(minimal_xml)
- self.assertEqual(type(path), dbus.ObjectPath)
+ path = self.connect.DefineXML(self.minimal_xml)
+ assert isinstance(path, dbus.ObjectPath)
self.main_loop()
-
-if __name__ == '__main__':
- unittest.main(verbosity=2)
diff --git a/test/test_domain.py b/test/test_domain.py
index b1ab7a5..b176c29 100755
--- a/test/test_domain.py
+++ b/test/test_domain.py
@@ -1,10 +1,8 @@
-#!/usr/bin/python3
-
import dbus
import libvirttest
-import unittest
-class TestDomain(libvirttest.TestCase):
+
+class TestDomain(libvirttest.BaseTestClass):
def domain(self):
path = self.connect.ListDomains(0)[0]
obj = self.bus.get_object('org.libvirt', path)
@@ -14,21 +12,21 @@ class TestDomain(libvirttest.TestCase):
obj, domain = self.domain()
props = obj.GetAll('org.libvirt.Domain', dbus_interface=dbus.PROPERTIES_IFACE)
- self.assertEqual(type(props['Name']), dbus.String)
- self.assertEqual(type(props['UUID']), dbus.String)
- self.assertEqual(type(props['Id']), dbus.UInt32)
- self.assertEqual(type(props['Vcpus']), dbus.UInt32)
- self.assertEqual(type(props['OSType']), dbus.String)
- self.assertEqual(type(props['Active']), dbus.Boolean)
- self.assertEqual(type(props['Persistent']), dbus.Boolean)
- self.assertEqual(type(props['State']), dbus.String)
- self.assertEqual(type(props['Autostart']), dbus.Boolean)
+ assert isinstance(props['Name'], dbus.String)
+ assert isinstance(props['UUID'], dbus.String)
+ assert isinstance(props['Id'], dbus.UInt32)
+ assert isinstance(props['Vcpus'], dbus.UInt32)
+ assert isinstance(props['OSType'], dbus.String)
+ assert isinstance(props['Active'], dbus.Boolean)
+ assert isinstance(props['Persistent'], dbus.Boolean)
+ assert isinstance(props['State'], dbus.String)
+ assert isinstance(props['Autostart'], dbus.Boolean)
# Call all methods except Reset and GetStats, because the test backend
# doesn't support those
xml = domain.GetXMLDesc(0)
- self.assertEqual(type(xml), dbus.String)
+ assert isinstance(xml, dbus.String)
domain.Reboot(0)
domain.Shutdown()
@@ -38,8 +36,8 @@ class TestDomain(libvirttest.TestCase):
def test_shutdown(self):
def domain_stopped(name, path):
- self.assertEqual(name, 'test')
- self.assertEqual(type(path), dbus.ObjectPath)
+ assert name == 'test'
+ assert isinstance(path, dbus.ObjectPath)
self.loop.quit()
self.connect.connect_to_signal('DomainStopped', domain_stopped)
@@ -48,14 +46,14 @@ class TestDomain(libvirttest.TestCase):
domain.Shutdown()
state = obj.Get('org.libvirt.Domain', 'State', dbus_interface=dbus.PROPERTIES_IFACE)
- self.assertEqual(state, 'shutoff')
+ assert state == 'shutoff'
self.main_loop()
def test_undefine(self):
def domain_undefined(name, path):
- self.assertEqual(name, 'test')
- self.assertEqual(type(path), dbus.ObjectPath)
+ assert name == 'test'
+ assert isinstance(path, dbus.ObjectPath)
self.loop.quit()
self.connect.connect_to_signal('DomainUndefined', domain_undefined)
@@ -65,6 +63,3 @@ class TestDomain(libvirttest.TestCase):
domain.Undefine()
self.main_loop()
-
-if __name__ == '__main__':
- unittest.main(verbosity=2)
diff --git a/test/travis-run b/test/travis-run
index 7577253..c2ab729 100755
--- a/test/travis-run
+++ b/test/travis-run
@@ -22,7 +22,7 @@ sudo chroot "$CHROOT" << EOF
set -ex
# install build deps
apt-get update
-apt-get install -y dh-autoreconf pkg-config libvirt-dev libglib2.0-dev libtool python3-gi python3-dbus dbus
+apt-get install -y dh-autoreconf pkg-config libvirt-dev libglib2.0-dev libtool python3-gi python3-dbus dbus pytest
# run build and tests as user
chown -R buildd:buildd /build
@@ -31,6 +31,6 @@ set -ex
cd /build/src
./autogen.sh
make -j4
-make check || { cat test-suite.log; exit 1; }
+make check
EOU
EOF
--
2.15.0
6 years, 9 months
[libvirt] [PATCH] qemu: Fix virQEMUCapsCommands formatting
by John Ferlan
Starting with commit id 'fab9d6e1' the formatting of:
{ "command-name", QEMU_CAPS_NAME },
was altered to:
{ "command-name", QEMU_CAPS_NAME},
and then commit id 'e2b05c9a' altered that to:
{ "command-name", QEMU_CAPS_NAME}
So, let's just fix that up to make things consistent with the
rest of the structures.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Although I could say this was trivial, it does impact at least one
upstream series (query-cpus-fast), so rather than just take that route,
I figured it'd be better to give ample warning... I can also wait, but
that series propagates the middle format with the comma at the end.
src/qemu/qemu_capabilities.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 3eb5ed6d1a..3b1bc051af 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1577,9 +1577,9 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = {
{ "migrate-incoming", QEMU_CAPS_INCOMING_DEFER },
{ "query-hotpluggable-cpus", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS },
{ "query-qmp-schema", QEMU_CAPS_QUERY_QMP_SCHEMA },
- { "query-cpu-model-expansion", QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION},
- { "query-cpu-definitions", QEMU_CAPS_QUERY_CPU_DEFINITIONS},
- { "query-named-block-nodes", QEMU_CAPS_QUERY_NAMED_BLOCK_NODES}
+ { "query-cpu-model-expansion", QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION },
+ { "query-cpu-definitions", QEMU_CAPS_QUERY_CPU_DEFINITIONS },
+ { "query-named-block-nodes", QEMU_CAPS_QUERY_NAMED_BLOCK_NODES },
};
struct virQEMUCapsStringFlags virQEMUCapsMigration[] = {
--
2.13.6
6 years, 9 months
[libvirt] [PATCH] remote: fix path for locating libvirtd in source tree during autostart
by Daniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/remote/remote_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index f765c09416..0eec50b6bd 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -1063,7 +1063,7 @@ doRemoteOpen(virConnectPtr conn,
if ((flags & VIR_DRV_OPEN_REMOTE_AUTOSTART) &&
!(daemonPath = virFileFindResourceFull("libvirtd",
NULL, NULL,
- abs_topbuilddir "/daemon",
+ abs_topbuilddir "/src",
SBINDIR,
"LIBVIRTD_PATH")))
goto failed;
--
2.14.3
6 years, 9 months