Skip to content

Commit

Permalink
Merge pull request #9694 from renhwztetecs/renhw-wip-librados-iotest
Browse files Browse the repository at this point in the history
test: add the necessary judgment

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
  • Loading branch information
tchaikov committed Aug 19, 2016
2 parents ee4d094 + 6c67073 commit 34a80e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
10 changes: 8 additions & 2 deletions src/test/libcephfs/access.cc
Expand Up @@ -368,8 +368,14 @@ int main(int argc, char **argv)

srand(getpid());

rados_create(&cluster, NULL);
rados_conf_read_file(cluster, NULL);
r = rados_create(&cluster, NULL);
if (r < 0)
exit(1);

r = rados_conf_read_file(cluster, NULL);
if (r < 0)
exit(1);

rados_conf_parse_env(cluster, NULL);
r = rados_connect(cluster);
if (r < 0)
Expand Down
12 changes: 6 additions & 6 deletions src/test/librados/io.cc
Expand Up @@ -50,12 +50,12 @@ TEST_F(LibRadosIo, ReadTimeout) {
// set up a second client
rados_t cluster;
rados_ioctx_t ioctx;
rados_create(&cluster, "admin");
rados_conf_read_file(cluster, NULL);
rados_conf_parse_env(cluster, NULL);
rados_conf_set(cluster, "rados_osd_op_timeout", "0.00001"); // use any small value that will result in a timeout
rados_connect(cluster);
rados_ioctx_create(cluster, pool_name.c_str(), &ioctx);
ASSERT_EQ(0, rados_create(&cluster, "admin"));
ASSERT_EQ(0, rados_conf_read_file(cluster, NULL));
ASSERT_EQ(0, rados_conf_parse_env(cluster, NULL));
ASSERT_EQ(0, rados_conf_set(cluster, "rados_osd_op_timeout", "0.00001")); // use any small value that will result in a timeout
ASSERT_NE(0, rados_connect(cluster));
ASSERT_EQ(0, rados_ioctx_create(cluster, pool_name.c_str(), &ioctx));
rados_ioctx_set_namespace(ioctx, nspace.c_str());

// then we show that the buffer is changed after rados_read returned
Expand Down

0 comments on commit 34a80e8

Please sign in to comment.