Re: [PATCH v2] [TCK] nwfilter: add a test case using concurrency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/19/2010 02:09 PM, Eric Blake wrote:
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.

Removed the cat's.
ACK with that fixed.

Pushed.

   Stefan

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]