summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-08-20 14:06:21 +0100
committerDaniel P. Berrange <berrange@redhat.com>2012-09-07 13:18:04 +0100
commit8d78fd04be695a069ca166d86c3eae780e81dbf1 (patch)
tree866020b149ddc37945a686b0a4c378b148d93a1e /tests/Makefile.am
parentAdd non-null annotations to qemuMonitorOpen (diff)
downloadlibvirt-8d78fd04be695a069ca166d86c3eae780e81dbf1.tar.gz
libvirt-8d78fd04be695a069ca166d86c3eae780e81dbf1.tar.bz2
libvirt-8d78fd04be695a069ca166d86c3eae780e81dbf1.zip
Add helper library for testing the qemu monitor code
To be able to test the QEMU monitor code, we need to have a fake QEMU monitor server. This introduces a simple (dumb) framework that can do this. The test case registers a series of items to be sent back as replies to commands that will be executed. A thread runs the event loop looking for incoming replies and sending back this pre-registered data. This allows testing all QEMU monitor code that deals with parsing responses and errors from QEMU, without needing QEMU around Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'tests/Makefile.am')
-rw-r--r--tests/Makefile.am22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8cf801559..051f87a47 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -219,12 +219,17 @@ endif
EXTRA_DIST += $(test_scripts)
+test_libraries = libshunload.la
+if WITH_QEMU
+test_libraries += libqemumonitortestutils.la
+endif
+
if WITH_TESTS
noinst_PROGRAMS = $(test_programs) $(test_helpers)
-noinst_LTLIBRARIES = libshunload.la
+noinst_LTLIBRARIES = $(test_libraries)
else
check_PROGRAMS = $(test_programs) $(test_helpers)
-check_LTLIBRARIES = libshunload.la
+check_LTLIBRARIES = $(test_libraries)
endif
TESTS = $(test_programs) \
@@ -298,8 +303,18 @@ EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
testutilsxen.c testutilsxen.h
endif
+QEMUMONITORTESTUTILS_SOURCES = \
+ qemumonitortestutils.c \
+ qemumonitortestutils.h \
+ $(NULL)
+
if WITH_QEMU
+libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES)
+libqemumonitortestutils_la_CFLAGS = \
+ -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
+
+
qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la
if WITH_NETWORK
qemu_LDADDS += ../src/libvirt_driver_network_impl.la
@@ -342,7 +357,8 @@ domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
else
EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
- qemumonitortest.c testutilsqemu.c testutilsqemu.h
+ qemumonitortest.c testutilsqemu.c testutilsqemu.h \
+ $(QEMUMONITORTESTUTILS_SOURCES)
endif
if WITH_LXC