On 11/18/2010 04:49 AM, Stefan Berger wrote:
V2:
- following Eric's suggestions from review of V1
- all scripts started by the main script trap on signal 2 and clean up
- the main program waits for all child processes to have terminated
- the test now requires each child process to do 10 steps:
- 1 VM start-destroy cycle is 1 step
- 50 filter changes are considered 1 step
- the test terminates after 3 minutes (in case the test system is
very slow / busy) with a bail out message
Now that the existing scripts are cleaned up and my POSIX compliancy
shell-scripting skills have temporarily:-) improved, I am now adding a
test case that exercises concurrency. The test case creates and destroys
2 VMs concurrently as well as changes their referenced filters in a
tight loop. This kind of test previously uncovered
- deadlocks in libvirt due to lock-ordering in the nwfilter subsystem
- libvirt termination bug in libaugeas due to doubly closed file
descriptors and the side effects
All of these have been fixed recently.
The test script is known to run in bash, dash and ksh shells.
They are still Linux-specific (things like date +%s aren't required by
POSIX), but so is the functionality we're testing, so no need to come up
with an alternate timeout method. I only have a couple of trivial nits:
+ # Test runs for a maximum of 3 minutes
+ now=`date +%s`
+ test_end=$(($now + 3 * 60))
+
+ while :;
+ do
+ # The logs give us the number of cycles the VMs were created
+ # and destroyed.
+ val=$(cat "${logvm1}" 2>/dev/null | tail -n 1)
Useless use of cat. val=$(tail -n1 "${logvm1}" 2>/dev/null)
+ val=$(cat "${logvm2}" 2>/dev/null | tail -n 1)
Likewise.
ACK with that fixed.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org