Commit Graph

160 Commits

Author SHA1 Message Date
Tomasz Grabiec
4dc8a6a09c test: distrubuted_test: Test that constructor arguments are copied on each core 2015-03-25 09:39:34 +01:00
Tomasz Grabiec
5133a0b2ab tests: distributed_test: Add missing start() invocation 2015-03-25 09:39:34 +01:00
Tomasz Grabiec
dc4eb7af2d tests: Rename map_reduce_test.cc to distributed_test.cc 2015-03-25 09:39:34 +01:00
Tomasz Grabiec
040f8ffcfb tests: Convert tabs to spaces 2015-03-25 09:39:34 +01:00
Gleb Natapov
406fbf76f7 rpc: add no_wait and client_info tests 2015-03-22 16:16:30 +02:00
Raphael S. Carvalho
6e049a4a98 tests: add test_fstream_unaligned testcase to fstream test
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-03-18 13:10:00 +02:00
Avi Kivity
d3acb5acc2 linecount: better error handling 2015-03-15 14:48:52 +02:00
Avi Kivity
0537a8ffe5 linecount: don't try to create the file.
It's read-only.
2015-03-15 14:48:31 +02:00
Avi Kivity
d5817ab965 Merge branch 'gleb/rpc' of github.com:cloudius-systems/seastar-dev
Conflicts:
	configure.py
2015-03-12 16:30:15 +02:00
Shlomi Livne
83998a8934 tests: Boostify the fstream_test
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-03-12 15:56:25 +02:00
Gleb Natapov
7adf4f935d rpc test program 2015-03-12 15:38:18 +02:00
Shlomi Livne
83c0196255 tests: make sure each SEASTAR_TEST_CASE has at least a single BOOST_XXX check
SEASTAR_TEST_CASE that did not execute a single BOOST_XXX check was
maakred as "[Message] - Test case .... did not check any assertions" and
is placed in /usr/include/boost/test/impl/results_collector instead of
the correct test file.

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-03-12 15:21:29 +02:00
Avi Kivity
3a35fe061b tests: tighten when_all() compare
Fails on one compiler.
2015-03-11 19:31:55 +02:00
Avi Kivity
5b6e23ebde tests: reduce BOOST_REQUIRE() calls
when_all() tests generate two million calls to BOOST_REQUIRE(), which
overwhelms the test result parser.  Replace with two calls and use all_of()
to process the result array.
2015-03-11 19:25:54 +02:00
Avi Kivity
e659ca2629 Merge branch 'when_all' of github.com:cloudius-systems/seastar-dev
when_all() variant for runtime-sized lists of futures.
2015-03-11 17:06:23 +02:00
Tomasz Grabiec
293a6e7547 tests: Test distributed::map_reduce() version which takes a functor 2015-03-11 13:33:53 +01:00
Tomasz Grabiec
200f4698b5 tests: Add test for map_reduce() 2015-03-11 13:24:31 +01:00
Raphael S. Carvalho
10a71dadac tests: add fstream testcase 2015-03-10 18:44:40 -03:00
Avi Kivity
a3695dbcc4 future: add a test case for runtime sized when_all() 2015-03-10 22:01:55 +02:00
Shlomi Livne
f8d773dd47 tests: fix future unitest that sometimes fails because of scheduling
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-03-10 16:38:43 +02:00
Nadav Har'El
7a04d1f662 fstream: refactor file input stream interface
The file_input_stream interface was messy: it was not fiber safe (e.g., code
doing seek() in the middle of an ongoing read_exactly()), and went against
the PIMPL philosophy.

So this patch removes the file_input_stream class, and replaces it with a
completely different design:

We now have in fstream.hh a global function:

input_stream<char>
make_file_input_stream(
        lw_shared_ptr<file> file, uint64_t offset = 0,
	uint64_t buffer_size = 8192);

In other words, instead of "seeking" in an input stream, we just open a new
input stream object at a particular offset of the given file. Multiple input
streams might be concurrently active on the same file.

Note how make_file_input_stream now returns a regular "input_stream", not a
subtype, and it can be used just like any normal input_stream to read the stream
starting at the given position.

This patch makes "input_stream" a "final" type: we no longer subclass it in our
code, and we shouldn't in the future because it goes against the PIMPL design
(the subclass should be of the inner workings, like the data_source_impl, not
of input_stream).

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-03-10 15:39:17 +02:00
Amnon Heiman
810d8c88d8 Adding httpd tests 2015-03-08 21:55:57 +02:00
Amnon Heiman
29391d9a9b Extending sstring
This patch adds some of the common functionalities from std:string to
sstring.

It adds length (implement by size() )
It define the constant npos to indicate no possition.
It adds the at (reference and const reference)
It define the find char and find sstring methods
and the substr method

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>

need merge sstring
2015-03-08 21:55:57 +02:00
Shlomi Livne
a40ef8bfe1 future: Add test case for finally being called on non immediate available future
Found that we are missing tests in code coverage review

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
[avi: fix formatting]
2015-03-08 16:52:26 +02:00
Tomasz Grabiec
7502f2a3a3 tests: Add test for returning bare values from callbacks 2015-03-06 11:35:56 +01:00
Raphael S. Carvalho
41846256d8 tests: fix fileiotest
engine() cannot be called before the local_engine was constructed because it
dereferences the pointer local_engine to create a reference.
Consequently, the following error can be seen while running fileiotest:
./core/reactor.hh:854:13: runtime error: reference binding to null pointer of
type 'struct reactor' ASAN:SIGSEGV

Let's switch the test to use app_template.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-03-06 10:06:16 +02:00
Tomasz Grabiec
83963b23d3 Replace rescue() usages with then_wrapped()
They are pretty much the same. This change removes rescue().
2015-03-04 17:34:59 +01:00
Raphael S. Carvalho
89ec1f8f6a slab: Add reclaimer functionality
Basic explanation of the reclaimer algorithm:
- Each slab page has a descriptor containing information about it, such as
refcnt, vector of free objects, link into LRU, etc.
- The LRU list will only contain slab pages which items are unused, so as
to make the reclaiming process faster and easier. Maintaining the LRU of slab
pages has a performance penalty of ~1.3%. Shlomi suggested an approach where
LRU would no longer exist and timestamp would be used instead to keep track of
recency. Reclaimer would then iterate through all slab pages checking for an
unused slab page with the lowest timestamp.
- Reclaimer will get the least-recently-used slab page from the LRU list,
do all the management stuff required, and iterate through the page erasing any
of the items there contained. Once reclaimer was called, it's likely that slab
memory usage is calibrated, thus slab pages shouldn't be allocated anymore.
- Reclaimer is enabled by default but can be disabled by specifying the slab
size using the application parameter --max-slab-size.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-03-04 17:40:58 +02:00
Glauber Costa
6b77cf7d08 linecount: change rw to ro
Avi says it is enough.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-02-26 17:30:02 +02:00
Glauber Costa
9861bfca01 open_file_dma: allow the specification of open flags
It is sometimes frustrating to use open_file_dma, because it has the hardcoded
behavior of always assuming O_CREAT. Sometimes this is not desirable, and it
would be nice to have the option not to do so.

Note that, by design, I am only including in the open_flags enum things that we
want the user of the API to control. Stuff like O_DIRECT should not be
optional, and therefore is not included in the visible interface.

Because of that I am changing the function signature to include a paramater
that specifies whether or not we should create the file if it does not exist.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-02-26 17:30:02 +02:00
Raphael S. Carvalho
67560bec48 test: Add slab allocator testcase
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-02-25 19:32:57 -03:00
Tomasz Grabiec
e0bff0c28e tests: Add test exploiting dynamic_pointer_cast bug 2015-02-25 11:56:07 +02:00
Avi Kivity
7f8d88371a Add LICENSE, NOTICE, and copyright headers to all source files.
The two files imported from the OSv project retain their original licenses.
2015-02-19 16:52:34 +02:00
Avi Kivity
ebc2ebbf12 Upgrade http_client to an application, not a test
and rename it to 'seawreck', after wrk.
2015-02-12 14:21:44 +02:00
Asias He
51adb20bda tests: Add http_client
It is based on tcp_client and works with our httpd server.

1) timer based, to run the test for 10 seconds
$ http_client --server 192.168.66.100:10000 --conn 100  --duration 10 --smp 2
========== http_client ============
Server: 192.168.66.100:10000
Connections: 100
Requests/connection: dynamic (timer based)
Requests on cpu 0: 33400
Requests on cpu 1: 33368
Total cpus: 2
Total requests: 66768
Total time: 10.011478
Requests/sec: 6669.145442
========== done ============

2) nr of reqs per connection based, to run the test with 100 connections
each has to run 1000 reqs
$ http_client --server 192.168.66.100:10000 --conn 100 --reqs 1000 --smp 2
========== http_client ============
Server: 192.168.66.100:10000
Connections: 100
Requests/connection: 1000
Requests on cpu 0: 50000
Requests on cpu 1: 50000
Total cpus: 2
Total requests: 100000
Total time: 15.002731
Requests/sec: 6665.453192
========== done ============

This patch is based on Shlomi's initial version.

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
Signed-off-by: Asias He <asias@cloudius-systems.com>
2015-02-12 10:02:48 +02:00
Avi Kivity
64930bc610 tests: add linecount tests
Demonstrates and tests file_input_stream.
2015-02-11 15:38:51 +02:00
Tomasz Grabiec
10e58e0cda tests: Make test runner catch and forward exceptions thrown directly from task 2015-02-10 14:47:42 +02:00
Tomasz Grabiec
85c67001dd tests: Add test for exceptions thrown from do_until() 2015-02-10 14:47:42 +02:00
Avi Kivity
94e01e6d0e tests: exit after timertest ends 2015-01-29 12:24:03 +02:00
Avi Kivity
070eb7d496 tests: serialize timer tests
Otherwise the output gets interspersed.
2015-01-29 12:20:39 +02:00
Tomasz Grabiec
661bb3d478 tests: Use test_runner to run boost tests 2015-01-29 10:30:14 +02:00
Tomasz Grabiec
a1fecad8cb tests: Introduce test_runner class
It uses app_template to launch seastar framework and can be used from
outside threads to inject tasks.
2015-01-29 10:30:14 +02:00
Tomasz Grabiec
8ad50d6614 core: Add exchanger class 2015-01-29 10:30:13 +02:00
Takuya ASADA
9de86ed651 tests: Support tcp_server tests(ping,txtx,rxrx) on tcp_client
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-01-28 16:26:46 +02:00
Gleb Natapov
7a92efe8d1 core: add local engine accessor function
Do not use thread local engine variable directly, but use accessor
instead.
2015-01-27 14:46:49 +02:00
Avi Kivity
2e4122ddd7 futures_test: add broken semaphore test 2015-01-20 11:30:56 +02:00
Avi Kivity
555be6f4bc tests: test aligned allocator 2015-01-19 09:49:32 +02:00
Avi Kivity
4c3eb49aaf tests: add smp test
Test calling a function, and calling a function that returns an exception.

The second test verifies that cross cpu free works.
2015-01-15 15:19:02 +02:00
Takuya ASADA
e1552ad3b6 core: rename smp.hh to distributed.hh
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-01-14 11:16:09 +02:00
Avi Kivity
4c46f4db8c tests: test literal + sstring concatenation 2015-01-13 10:13:05 +02:00