Commit Graph

63 Commits

Author SHA1 Message Date
Asias He
52f2a2b35b tests: Add tcp_sever
Currently, it is a ping/pong sever. When the client sends a ping, the
server responds a pong. We can add more tests to extend.
This is useful for testing TCP_RR.
2014-11-03 09:53:32 +02:00
Avi Kivity
3d414111eb future: make .rescue() require an rvalue reference for its future
This makes it harder to misuse.
2014-10-30 14:07:42 +02:00
Tomasz Grabiec
ca85016556 tests: memcache: fix regex
Some versions of python do not tolerate this regex:

   r'(\w*)?'

ERROR: test_incr (__main__.TestCommands)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/memcached/test_memcached.py", line 464, in test_incr
    self.assertRegexpMatches(call('incr key 1\r\n').decode(), r'0(\w*)?\r\n')
  File "/usr/lib64/python3.3/unittest/case.py", line 1178, in deprecated_func
    return original_func(*args, **kwargs)
  File "/usr/lib64/python3.3/unittest/case.py", line 1153, in assertRegex
    expected_regex = re.compile(expected_regex)
  File "/usr/lib64/python3.3/re.py", line 214, in compile
    return _compile(pattern, flags)
  File "/usr/lib64/python3.3/re.py", line 281, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib64/python3.3/sre_compile.py", line 498, in compile
    code = _code(p, flags)
  File "/usr/lib64/python3.3/sre_compile.py", line 483, in _code
    _compile(code, p.data, flags)
  File "/usr/lib64/python3.3/sre_compile.py", line 75, in _compile
    elif _simple(av) and op is not REPEAT:
  File "/usr/lib64/python3.3/sre_compile.py", line 362, in _simple
    raise error("nothing to repeat")
sre_constants.error: nothing to repeat
2014-10-30 10:17:52 +02:00
Avi Kivity
b1ec66900f memcached: reindent ascii parser test 2014-10-28 11:04:45 +02:00
Avi Kivity
90cb9376ab memcached: enhance test to check for differently scattered packets
Use funky indentation to reduce diff size; can be adjutsed later.
2014-10-28 11:01:37 +02:00
Avi Kivity
6dcf24f98d Move contents of async-action.hh into future-util.hh 2014-10-27 19:28:10 +02:00
Tomasz Grabiec
c6545bf2df tests: add another test case for future::forward_to() 2014-10-27 15:58:59 +02:00
Avi Kivity
332cd6424b ip: use indirection to access tcp
This reduces the number of files that include tcp.hh.
2014-10-24 22:18:46 +03:00
Tomasz Grabiec
0cf6564097 tests: add tests for future::forward_to() 2014-10-24 19:40:48 +03:00
Tomasz Grabiec
3eaac67a09 tests: memcache: make test_connection_statistics a bit more robust
It some times fails because the server records connection closure with
a delay.
2014-10-21 16:43:09 +02:00
Tomasz Grabiec
f921a9787b tests: make test_memcache.py return non-zero exit code on failure 2014-10-21 16:43:09 +02:00
Pekka Enberg
6723c0cbdd apps/memcache => apps/memcached
The protocol is called the "memcache protocol" but the server should
follow the same naming convention as httpd does.

It should not be a big deal but it annoys the hell out of simple people
like myself who have their brain hard-wired to type the final "d"...

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-10-21 17:30:14 +03:00
Tomasz Grabiec
7903acdeb8 tests: memcache: add incr/decr tests 2014-10-18 12:59:59 +02:00
Tomasz Grabiec
e3fa358075 test: memcache: flush all keys after each test 2014-10-18 12:59:59 +02:00
Tomasz Grabiec
6ed212e7c6 tests: memcache: add tests for 'stats' command 2014-10-18 12:59:59 +02:00
Tomasz Grabiec
51f52ed2b5 tests: memcache: make tests more robust
By automatically detecting when memcache is up and running.
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
e07e6ccbef tests: memcache: add tests for 'cas' and 'gets' 2014-10-18 12:59:59 +02:00
Tomasz Grabiec
f134fe1a94 tests: memcache: add tests for 'add' and 'replace' 2014-10-18 12:59:59 +02:00
Tomasz Grabiec
d5a0e9654e tests: memcache: add tests for 'noreply' variant of 'set' and 'delete'
This also extracts some code to a common base class.
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
a1848ca6a7 tests: memcache: add test for 'version' command 2014-10-18 12:59:58 +02:00
Tomasz Grabiec
e30b097867 tests: memcache: fix assertion so that it works with stock memcached too 2014-10-18 12:59:58 +02:00
Tomasz Grabiec
3347a78289 tests: memcache: add tests for 'flush_all' command 2014-10-18 12:59:58 +02:00
Tomasz Grabiec
fdc4e7bbf5 tests: memcache: cleanup: rename methods 2014-10-18 12:59:58 +02:00
Tomasz Grabiec
09faeff196 tests: distinguish between fast and slow tests
Most of the tests are fast and they cover most of the
functionality. The slow minority of tests takes significantly more
time to run. Developers should run tests frequently in order to get
feedback on correctness of their changes. The test runner
distinguishes now between fast and slow tests. When given '--fast'
switch it skips tests marked as slow.

$ time ./test.py
[8/8] PASSED tests/memcache/test.py --mode release
OK.

real	0m33.084s
user	0m0.501s
sys	0m0.271s

$ time ./test.py --fast
[8/8] PASSED tests/memcache/test.py --mode release --fast
OK.

real	0m1.012s
user	0m0.464s
sys	0m0.247s
2014-10-18 12:59:50 +02:00
Tomasz Grabiec
db5cdc3918 tests: memcache: add test exploiting string_builder issue 2014-10-16 12:35:09 +02:00
Tomasz Grabiec
c1dc3b0d53 memcache: handle end of stream properly on TCP 2014-10-16 11:45:32 +02:00
Tomasz Grabiec
2e5c3c3317 memcache: tests: add tests for error recovery 2014-10-16 11:45:30 +02:00
Tomasz Grabiec
45772b9ab7 test.py: run memcache with --smp 1
It doesn't support more than one CPU yet. The symptom is that TCP
connections will have a chance of hanging when they're routed to the
CPU on which memcache doesn't run.
2014-10-16 09:11:08 +02:00
Raphael S. Carvalho
9ef466bae2 blkdiscard_test: switch to app-template
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2014-10-15 21:22:48 +03:00
Tomasz Grabiec
bb5d1164b1 tests: memcache: test both TCP and UDP 2014-10-15 15:59:42 +02:00
Tomasz Grabiec
50feeef580 tests: memcache: introduce end-to-end tests
These tests exercise memcache instance using a real client. The
test_memcache.py suite can be run against any memcache instance which
conforms to the ASCII protocol.
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
6a31f3762c tests: memcache: add test for ASCII parser 2014-10-15 15:59:42 +02:00
Tomasz Grabiec
da10ab6443 tests: add sstring tests 2014-10-15 15:50:46 +02:00
Tomasz Grabiec
5f3352b7e3 tests: integrate with BOOST UTF
Asynchronous test cases can be delared using SEASTAR_TEST_CASE macro,
which is equivalent to BOOST_AUTO_TEST_CASE, but the function body is
run inside a reactor and can returns a future<> which resolves when
the test is done.
2014-10-15 15:50:28 +02:00
Tomasz Grabiec
700325886d convert non-system includes to use quotes 2014-10-15 15:50:28 +02:00
Raphael S. Carvalho
d7fe901005 tests: add blkdiscard_test
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2014-10-15 12:45:55 +03:00
Asias He
2625dd5944 net: Introduce eth_protocol_num 2014-10-13 11:37:56 +08:00
Gleb Natapov
4e7d8a8506 Introduce packet classification mechanism
Classifier returns what cpu a packets should be processed on. It may
return special broadcast identifier. The patch includes classifier for
tcp, udp and arp. Arp classifier broadcasts arp reply to all cpus. Default
classifier does not forward packet.
2014-10-07 11:03:57 +03:00
Tomasz Grabiec
e4d55258c1 tests: add UDP tests
To start the server:

  $ build/release/tests/udp_server

To start the client:

  $ build/release/tests/udp_client --server localhost:10000
2014-10-06 18:36:42 +02:00
Tomasz Grabiec
3775dae6fb net: convert ipv4_addr.host from array to uint32_t
It will be easier to convert it to a format on which the native stack
works.
2014-10-06 18:34:28 +02:00
Raphael S. Carvalho
89147b2532 fileiotest: verify read size
add assert to dma_read return

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2014-10-02 15:45:06 +03:00
Tomasz Grabiec
86246a4c0e tests: add test for bug in error propagation by future::then() 2014-10-01 13:45:28 +02:00
Tomasz Grabiec
6f1d1d6627 tests: add tests for future::rescue() 2014-10-01 13:45:28 +02:00
Tomasz Grabiec
0269fd6f15 tests: add tests for future::finally() 2014-10-01 13:45:28 +02:00
Tomasz Grabiec
48a86b7073 core: make timer callbacks synchronous with state changes
It allows for simpler client code because the client can assume that
when cancel() returns the callback will not run and thus there's no
need to handle the race between timer teardown and execution of the
callback.
2014-10-01 13:21:10 +02:00
Tomasz Grabiec
9a0ab2f1a4 tests: introduce some basic utilities used by tests 2014-10-01 13:21:09 +02:00
Asias He
c5d623265d net: Support ping 2014-09-25 17:49:38 +03:00
Pekka Enberg
0dfdd3e548 Use braces around subobject initialization
There seems to be some issue with std::array initialization brace elision with Clang:

  http://stackoverflow.com/questions/16985687/brace-elision-in-stdarray-initialization

Sprinkle enough braces to make Clang happy.
2014-09-22 16:37:00 +03:00
Avi Kivity
4ca2d67406 tcp_test: terminate on connection closed 2014-09-22 14:22:17 +03:00
Avi Kivity
313768654a net: remove queuing from l2->l3 rx path
Use a subscription instead.  Queueing should be implemented at the highest
possible level (e.g. tcp), to avoid double-queueing.
2014-09-22 11:28:35 +03:00