mirror of
https://github.com/ceph/ceph
synced 2025-01-10 13:10:46 +00:00
test/rados-api/aio.cc: add RoundTripPP
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
This commit is contained in:
parent
e2d4462ad7
commit
cc25266957
@ -240,6 +240,39 @@ TEST(LibRadosAio, RoundTrip) {
|
||||
rados_aio_release(my_completion2);
|
||||
}
|
||||
|
||||
TEST(LibRadosAio, RoundTripPP) {
|
||||
AioTestDataPP test_data;
|
||||
ASSERT_EQ("", test_data.init());
|
||||
AioCompletion *my_completion = test_data.m_cluster.aio_create_completion(
|
||||
(void*)&test_data, set_completion_complete, set_completion_safe);
|
||||
AioCompletion *my_completion_null = NULL;
|
||||
ASSERT_NE(my_completion, my_completion_null);
|
||||
char buf[128];
|
||||
memset(buf, 0xcc, sizeof(buf));
|
||||
bufferlist bl1;
|
||||
bl1.append(buf, sizeof(buf));
|
||||
ASSERT_EQ(0, test_data.m_ioctx.aio_write("foo", my_completion,
|
||||
bl1, sizeof(buf), 0));
|
||||
{
|
||||
TestAlarm alarm;
|
||||
sem_wait(&test_data.m_sem);
|
||||
sem_wait(&test_data.m_sem);
|
||||
}
|
||||
bufferlist bl2;
|
||||
AioCompletion *my_completion2 = test_data.m_cluster.aio_create_completion(
|
||||
(void*)&test_data, set_completion_complete, set_completion_safe);
|
||||
ASSERT_NE(my_completion2, my_completion_null);
|
||||
ASSERT_EQ(0, test_data.m_ioctx.aio_read("foo",
|
||||
my_completion2, &bl2, sizeof(buf), 0));
|
||||
{
|
||||
TestAlarm alarm;
|
||||
ASSERT_EQ(0, my_completion2->wait_for_complete());
|
||||
}
|
||||
ASSERT_EQ(0, memcmp(buf, bl2.c_str(), sizeof(buf)));
|
||||
delete my_completion;
|
||||
delete my_completion2;
|
||||
}
|
||||
|
||||
TEST(LibRadosAio, RoundTripAppend) {
|
||||
AioTestData test_data;
|
||||
rados_completion_t my_completion, my_completion2, my_completion3;
|
||||
|
Loading…
Reference in New Issue
Block a user