Commit Graph

215 Commits

Author SHA1 Message Date
Alex Young
a767d4bc8c Test the source handles a dest crash after write correctly 2012-07-03 14:52:27 +01:00
Alex Young
64ebbe7688 Refactor FakeSource from a module to a class 2012-07-03 14:39:05 +01:00
Alex Young
ded4914c84 Simplified FlexNBD::FakeDest 2012-07-03 14:23:20 +01:00
Alex Young
9e67f228f0 Rename a test class 2012-07-03 13:35:47 +01:00
Alex Young
2283b99834 Split acceptance tests into separate files 2012-07-03 13:33:52 +01:00
Alex Young
988b2ec014 Moved acceptance tests into tests/acceptance 2012-07-03 10:59:31 +01:00
Alex Young
c0c9c6f076 Moved unit tests into tests/unit 2012-07-03 10:53:08 +01:00
Alex Young
e817129c47 Changes to error severity in readwrite.c made a test fail, this patch fixes it 2012-07-02 18:10:02 +01:00
Alex Young
cc2e67d4bb Test that an invalid write gets an error response 2012-07-02 15:37:52 +01:00
Alex Young
ea4642a878 Check that a mirror write returning an error will cause a reconnect and retry 2012-07-02 15:04:45 +01:00
Alex Young
99f8c24b01 Tweak a timeout to prevent an intermittent test failure 2012-07-02 13:00:30 +01:00
Alex Young
9850f5d0a4 Test that timing out a write causes a disconnect and a reconnect 2012-06-28 14:45:53 +01:00
Alex Young
4de4cee3d0 Test for acl rejection 2012-06-28 13:29:22 +01:00
Alex Young
9b717d6391 Factor common code out of fake destinations 2012-06-28 11:34:36 +01:00
Alex Young
192471ee82 Factor common code out of the test fake sources
* * *
More fake source refacoring
2012-06-27 17:28:24 +01:00
Alex Young
137a764cc7 Add a test for a second client connecting during a mirror 2012-06-27 16:32:01 +01:00
Alex Young
04a10179a0 check_acl correctly sets log_level 2012-06-27 16:18:38 +01:00
Alex Young
ac3e6692a8 make sure that an invalid flexnbd signal fd can't break the serve accept loop 2012-06-27 16:17:51 +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
80f298f6cd Make non-fatal errors return properly 2012-06-21 18:01:56 +01:00
Alex Young
f37a217cb9 Add listen mode 2012-06-21 18:01:50 +01:00
Alex Young
79ba1cf728 Make max_nbd_clients configurable per struct server 2012-06-21 17:22:34 +01:00
Alex Young
e21beb1866 Add the REQUEST_ENTRUST nbd request type 2012-06-21 17:12:06 +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
43e95dc4db Make sure all the lines we read get freed (including the trailing blank) 2012-06-21 15:31:28 +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
c7525f87dc Removed proxying completely and fixed the pthread_join bug revealed in the process 2012-06-12 15:08:07 +01:00
Alex Young
c6182b9edf Merge 2012-06-11 14:59:52 +01:00
Alex Young
e2d3161a4a Set default log level to warn to shut the tests up 2012-06-11 14:59:26 +01:00
nick
5ab9e10019 test: make check_serve bind() its outgoing socket to a known IP for these tests 2012-06-11 14:40:41 +01:00
Alex Young
25fc0969cf Make the compiler stricter and tidy up code to make the subsequent errors and warnings go away 2012-06-11 13:57:03 +01:00
nick
893db71d7c Whitespace 2012-06-11 13:05:22 +01:00
nick
224bdcbf87 Fix handling ACLs where > 1 entry exists 2012-06-11 12:56:45 +01:00
nick
0b90517035 tests: Get rid of a warning 2012-06-11 10:08:24 +01:00
nick
0441ef9d74 tests: Get check_serve working after the merge of doom 2012-06-11 10:04:31 +01:00
Matthew Bloch
e8b5fae7ab Merge, just renaming old error macros. 2012-06-09 02:37:23 +01:00
Matthew Bloch
b546539ab8 Rewrote error & log functions to be more general, use longjmp to get out of
trouble and into predictable cleanup functions (one for each of serve,
client & control contexts).  We use 'fatal' to mean 'kill the thread' and
'error' to mean 'don't kill the thread', assuming some recovery action,
except I don't use error anywhere yet.
2012-06-09 02:25:12 +01:00
Alex Young
b7096ef908 Audit client connections on acl update 2012-06-08 18:03:41 +01:00
Alex Young
35ca93b42c Lock around acl updates 2012-06-08 11:02:40 +01:00
Alex Young
f7e1a098b1 Move updating the acl object into serve.c
* * *
Replacing the server acl sends an acl_updated signal
2012-06-08 10:32:33 +01:00
Alex Young
5fb0cd4cca Fix O_NONBLOCK setting on self_pipes 2012-06-08 10:11:06 +01:00
Alex Young
2d9d00b636 Pull ACLs into their own struct 2012-06-07 17:47:43 +01:00
Alex Young
1cd8f4660f Merge of doom 2012-06-07 14:40:55 +01:00
Alex Young
5930f25034 Use client stop signals for thread stopping 2012-06-07 14:25:30 +01:00
Matthew Bloch
3810a8210f Added some record-keeping / printing to fuzzer to assist with backtracking. 2012-06-07 12:25:56 +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