Commit Graph

18 Commits

Author SHA1 Message Date
Alex Young
137a764cc7 Add a test for a second client connecting during a mirror 2012-06-27 16:32:01 +01:00
Alex Young
94b4fa887c Add mboxes 2012-06-27 15:45:33 +01:00
Alex Young
2078d17053 connect failure scenarios 2012-06-22 10:05:41 +01:00
Alex Young
a3dc670939 Squash valgrind errors by making sure client threads get joined on termination 2012-06-21 17:11:12 +01:00
Alex Young
4e8a9670e5 Merge 2012-06-21 11:37:18 +01:00
Alex Young
e3c04ade29 Added early-exit on any valgrind error 2012-06-21 11:37:00 +01:00
Alex Young
7d1c15b07a Fix two bugs in mirroring.
First, Leaving off the source address caused a segfault in the
command-sending process because there was no NULL check on the ARGV
entry.

Second, while the migration thread sent a signal to the server to close
on successful completion, it didn't wait until the close actually
happened before releasing the IO lock.  This meant that any client
thread waiting on that IO lock could have a read or a write queued up
which could succeed despite the server shutdown.  This would have meant
dataloss as the guest would see a successful write to the wrong instance
of the file.  This patch adds a noddy serve_wait_for_close() function
which the mirror_runner calls to ensure that any clients will reject
operations they're waiting to complete.

This patch also adds a simple scenario test for migration, and fixes
TempFileWriter#read_original.
2012-06-13 13:44:21 +01:00
Alex Young
1cd8f4660f Merge of doom 2012-06-07 14:40:55 +01:00
Alex Young
a90f84972b Add stop signals to client threads 2012-06-07 11:44:19 +01:00
Matthew Bloch
08f3d42b34 Improved fuzz test to find an actual code bug (previous bug was in the test
<g>).
2012-06-07 02:06:08 +01:00
nick
648f768ff6 tests: fix the Ruby flexnbd wrapper for mirror 2012-06-06 13:33:24 +01:00
Matthew Bloch
d981dde8d1 Fixed FlexNBD#serve parameters, added detection of non-starting server. 2012-06-06 01:28:30 +01:00
Alex Young
074efd9fa4 Add a no-op debug() define for non-debug builds and make valgrind optional in nbd_scenarios 2012-05-31 13:53:04 +01:00
Alex Young
268bebd408 Run the nbd_scenario tests under valgrind 2012-05-31 13:23:12 +01:00
Alex Young
0102217019 Merge 2012-05-30 15:39:55 +01:00
Alex Young
0c62e66a70 Added getopt_long command-line handling.
All parameters now have switches.  The one gotcha is the parameter which
was overloaded - s_length_or_filename to params_readwrite - is only
pretending to be a length at the moment. If you pass a filename it'll
still work, but the help messages don't mention that.  I'll split the
parameter into two in a later commit.
2012-05-30 15:19:40 +01:00
mbloch
cf2400fedd Fixed race in tests. 2012-05-29 17:01:54 +01:00
Matthew Bloch
5a5041a751 First few external tests with test/unit, some minor tidying of internal data
structures.
2012-05-24 01:39:35 +01:00