On Tue, Jul 30, 2013 at 03:05:35PM +0200, Peter Krempa wrote: > As promised earlier I'm sending a unit test for guest agent interaction. > > This series contains a few refactors and additions of monitor test utils > and then add tests for all agent interaction functions. The refactors > done in this series will allow to do a more thorough testing on the json > monitor too. > > The small drawback of this test suite is a 6 second run time introduced > to test timeout of a guest agent command. The test may be removed in > case it's too much. > > Peter Krempa (20): > conf: Export virDomainChrSourceDefClear() > qemu_agent: Output newline at the end of the sync JSON message > qemu_agent: Move updater function for VCPU hotplug into qemu_agent.c > qemu_agent: Remove obvious comments > qemumonitortestutils: Use consistent header style and line spacing > qemumonitortestutils: Use VIR_DELETE_ELEMENT and VIR_APPEND_ELEMENT > qemumonitortestutils: remove multiline function calls > qemumonitortestutils: Don't crash on non fully initialized test > qemumonitortestutils: Split up creation of the test to allow reuse > qemumonitortestutils: Refactor the test helpers to allow reuse > qemumonitortestutils: Split lines on \n instead of \r\n > qemumonitortestutils: Add instrumentation for guest agent testing > qemumonitortestutils: Improve error reporting from mock qemu monitor > qemumonitortestutils: Add the ability to check arguments of commands > tests: Add qemuagenttest > qemuagenttest: Test the filesystem trimming > qemuagenttest: Add testing of agent suspend modes > qemuagenttest: Introduce testing of shutdown commands > qemuagenttest: Test arbitrary qemu commands and timeouting of commands > qemuagenttest: Add tests for CPU plug functions and helpers > > .gitignore | 1 + > src/conf/domain_conf.c | 2 +- > src/conf/domain_conf.h | 2 + > src/libvirt_private.syms | 1 + > src/qemu/qemu_agent.c | 73 ++++- > src/qemu/qemu_agent.h | 3 + > src/qemu/qemu_driver.c | 64 +--- > tests/Makefile.am | 11 +- > tests/qemuagenttest.c | 580 ++++++++++++++++++++++++++++++++++++ > tests/qemumonitortestutils.c | 684 +++++++++++++++++++++++++++++++++---------- > tests/qemumonitortestutils.h | 39 ++- > 11 files changed, 1231 insertions(+), 229 deletions(-) > create mode 100644 tests/qemuagenttest.c Great job on this test suite - it turned out very nicely. Good that we have coverage of this code, since handling data from untrusted guests is security critical Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list