Patrick J Cherry
a4d641b215
Ensure ev abandon_watcher is stopped before reuse.
2018-12-07 21:47:14 +00:00
Patrick J Cherry
70a3a4bb55
Close the control socket during cleanup
...
This should prevent further requests coming in, triggering deadlocks.
2018-12-07 15:02:55 +00:00
Patrick J Cherry
ce9499efce
Rubocop; add test to bombard a migration source with status commands
2018-12-07 13:59:49 +00:00
Patrick J Cherry
93308bbda1
Added jessie back.
2018-11-14 17:20:33 +00:00
Patrick J Cherry
b7b50faa17
Updated comments
2018-11-14 16:58:05 +00:00
Patrick J Cherry
b26b308e68
Add test to check when proxy times-out mid-write to upstream
...
I've add to add code to allow the environment to specify the upstream
tiemout so we don't have to wait 30s for this test to happen.
2018-11-14 16:49:55 +00:00
Patrick J Cherry
af3bb16ff7
Merge branch 'develop' into fix-formatting
2018-02-20 11:06:58 +00:00
Patrick J Cherry
8893cd06c4
Re-formatted tests with a bit of tinkering by hand
2018-02-20 11:02:33 +00:00
Patrick J Cherry
103bd7ad5b
Undo formatting on test suite -- it wasn't right
2018-02-20 10:13:42 +00:00
Patrick J Cherry
7bee1aadfe
Enable request flags test
...
Missed this out when I wrote the test!
2018-02-20 10:11:38 +00:00
Patrick J Cherry
f47f56d4c4
Formatted all code using indent
2018-02-20 10:05:35 +00:00
Patrick J Cherry
623007bfff
Remove last reference to removed test_gets_num_clients
2018-02-19 10:22:01 +00:00
Patrick J Cherry
27a94a807e
Remove the test_gets_num_clients test from the C unit tests
...
This test was causing problems by using dummy pointers to simulate
connections. When calling the cleanup code, these pointers were
thought to be real, and the code attemtped to clean up threads
referenced by those pointers, causing a segfault.
I've reimplemented the test in the ruby acceptance suite.
2018-02-16 13:46:31 +00:00
Patrick J Cherry
d0439dab88
Call the thread cleanup code when requesting status
...
This ensures the correct number of connected clients is returned when
the status command is issued.
Previously the thread pool would only be cleaned up on a new connection.
2018-02-16 12:58:03 +00:00
James F. Carter
9f56f38f42
Merge branch 'rationalise-ld-preload-tests' into develop
2018-02-14 16:48:57 +00:00
Patrick J Cherry
2e17e8955f
Added tests for NBD_MAX_SIZE
...
This constant is only used in the proxy, so the tests only cover proxy
mode.
2018-02-13 17:04:51 +00:00
Patrick J Cherry
9817fd7b0a
Final tidies, comments etc.
2018-02-09 11:42:25 +00:00
Patrick J Cherry
195de41d86
Remove extra line
2018-02-09 11:32:26 +00:00
Patrick J Cherry
b75a6529d0
Move LdPreload include to correct place
2018-02-09 10:41:24 +00:00
Patrick J Cherry
8e67180999
Check that TCP_NODELAY is set on upstream sockets on reconnection
...
Also rationalize the test to see if a function has been called. Still
not great, but getting there :)
2018-02-09 10:26:08 +00:00
Patrick J Cherry
c053a54faa
Added test to cover setsockopt for tcpkeepalive
2018-02-08 23:07:17 +00:00
Patrick J Cherry
ebacf738bc
Tidy up ld preload hacks
2018-02-08 22:28:34 +00:00
Patrick J Cherry
347b7978e4
Discs must be sized in multiples of 512 bytes or odd things happen
...
In #36 some of the odd errors were due to seeks beyond the end of the
disc. This was because the disc was "specially crafted" to be 25GB + 1
byte, which doesn't fit into the normal 512 byte sectors expected of a
disc. This lead to reads going beyond the end of the disc etc.
If a similarly evil disc is used with `losetup`, it just ignores the
last bytes of the disc that don't fit into 512 chunks. This is what
that patch does, logging an error at the same time.
2018-02-08 16:31:28 +00:00
Patrick J Cherry
8beb3f0af6
Allow proxy to pass NBD protocol errors downstream; server returns EINVAL/ENOSPC appropriately
...
Previously the proxy would just disconnect when it saw an NBD protocol
error, and retry the operation it was in the middle of.
Additionally, the server needs to return the correct error types when
this happens.
2018-02-08 13:19:51 +00:00
Patrick J Cherry
f71b872622
Only set up LD_PRELOAD for tests that actually need it.
2018-02-07 22:05:07 +00:00
Patrick J Cherry
79181b3153
Added LD_PRELOAD library to monitor msync calls in testing
2018-02-07 21:45:20 +00:00
Patrick J Cherry
55548cc969
Change ordering of @env configuration/start so we can alter the blocksize.
...
argh.
2018-02-06 10:24:54 +00:00
Patrick J Cherry
da35187af0
Allow blocksize to be changed in Environment
...
This number is peppered all over the test suite, so changing @blocksize
for everything is not a goer, when we really only need to change it for
one test.
2018-02-06 09:55:32 +00:00
Patrick J Cherry
7704f9e5c8
Fix tests to reflect new filesize.
2018-02-06 07:57:40 +00:00
Patrick J Cherry
3a86870c9f
Use sysconf to determine actual page size for msync
...
Also added comments in tests around testing for msync offsets/lengths.
2018-02-06 07:32:58 +00:00
Patrick J Cherry
2b58468800
Added test for FUA acceptance.
...
Although I think this might be a bit useless as servers normally just
ingore flags.
2018-02-03 20:29:15 +00:00
Patrick J Cherry
4d9db4d6e9
Added basic FLUSH test
2018-02-03 20:10:47 +00:00
Patrick J Cherry
d6057a4244
Use 'English' in ruby
2018-02-02 21:41:07 +00:00
Patrick J Cherry
1d98ba1d3e
Further rubocopping
2018-02-02 21:36:30 +00:00
Patrick J Cherry
9c48da82cc
Rubocop
2018-02-02 21:34:14 +00:00
Patrick J Cherry
1b7b688f7a
Tidied up nbd init test
2018-02-02 21:30:55 +00:00
Patrick J Cherry
051576df6d
Remove warnings about Object#timeout
2018-02-02 20:46:46 +00:00
Patrick J Cherry
72c8c6f757
Altered test to check for type as a 16-bit uint; added flags test
2018-02-02 20:30:39 +00:00
Chris Elsworth
42d206cfb7
Update test
2017-07-14 16:26:25 +01:00
James Carter
b4cb2d9240
Merge branch 'fix-wrong-handle-type' into 'master'
...
Fix up "wrong" handle type from char* to uint64_t
Following from the NBD handle comparison simplifications.
See merge request !25
2016-10-07 10:20:35 +01:00
James Carter
1efb7bada6
Merge branch 'fix-unsigned-longs-in-bitset-test' into 'master'
...
fix check_bitset test on 32-bit platforms
The use of `unsigned long` and `UL` suffices caused this test to fail
on 32 bit platforms, where these are just 4, not 8 bits long.
```
tests/unit/check_bitset.c:73:F:bit:test_bit_ranges:0: longs[32] = 0 SHOULD BE ffffffff
```
See merge request !24
2016-10-07 10:20:08 +01:00
Patrick J Cherry
209da655b3
Skip large file test on 32-bit platforms
...
This test cannot run on 32-bit machines as they cannot access files
large than 2G. Makes flexnbd on 32-bit a bit useless really..
2016-10-06 21:42:52 +01:00
Patrick J Cherry
52b45e6b40
fix check_bitset test on 32-bit platforms
...
The use of `unsigned long` and `UL` suffices caused this test to fail
on 32 bit platforms, where these are just 4, not 8 bits long.
```
tests/unit/check_bitset.c:73:F:bit:test_bit_ranges:0: longs[32] = 0 SHOULD BE ffffffff
```
2016-10-06 21:22:53 +01:00
Patrick J Cherry
d279eb7570
Fix up "wrong" handle type from char* to uint64_t
...
Following from the NBD handle comparison simplifications.
2016-10-06 21:19:15 +01:00
Patrick J Cherry
d1e6e835c4
OK removed the cast and fixed the function def in the test
...
This should definitely clear the warning.
2016-10-06 15:56:57 +01:00
Patrick J Cherry
898f3f6c7e
Reinstated char * cast to remove compiler warning
2016-10-06 15:43:20 +01:00
Patrick J Cherry
1338d9e910
Fix up nbdtypes test to correctly use htobe64
...
Previous change hadn't taken this into account, and hopefully this makes
our test a little clearer.
2016-10-06 14:46:29 +01:00
Patrick J Cherry
191b3bc72c
Merge branch 'master' of gitlab.bytemark.co.uk:open-source/flexnbd-c into fix-check-readwrite
2016-10-06 14:06:21 +01:00
Patrick J Cherry
6505588f25
Fixed check_readwrite test to pass correct handle to fd_write_reply
...
The (char*) cast to resp->received.handle.b was causing a segfault
2016-10-06 14:01:47 +01:00
Patrick J Cherry
957707bcfc
Fixed up internal test names (copy/pasta?)
...
The test names output by `make check` now reflect reality.
2016-10-06 13:44:20 +01:00