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.
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
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>
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
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.
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.
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.
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.
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.