summaryrefslogtreecommitdiffstats
path: root/src/test/system
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-10-17 01:30:21 +0200
committerSage Weil <sage@inktank.com>2012-10-17 02:52:25 +0200
commitc9de24f9cabac4fdcfdd1f8d39383e9f7c6b248d (patch)
tree9711901dcc1c4eac64670a02287f5160b81ea74b /src/test/system
parentobjecter: refactor pool dne checks (diff)
downloadceph-c9de24f9cabac4fdcfdd1f8d39383e9f7c6b248d.tar.xz
ceph-c9de24f9cabac4fdcfdd1f8d39383e9f7c6b248d.zip
testrados_list_parallel: fix
- don't delete the pool during the run - ignore create error codes (may succeed for return EEXIST) - use a unique pool name Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/test/system')
-rw-r--r--src/test/system/rados_list_parallel.cc9
-rw-r--r--src/test/system/rados_open_pools_parallel.cc2
-rw-r--r--src/test/system/st_rados_create_pool.cc9
-rw-r--r--src/test/system/st_rados_delete_objs.cc2
-rw-r--r--src/test/system/st_rados_delete_pool.cc2
-rw-r--r--src/test/system/st_rados_list_objects.cc2
6 files changed, 13 insertions, 13 deletions
diff --git a/src/test/system/rados_list_parallel.cc b/src/test/system/rados_list_parallel.cc
index 741144d97d8..3a68b943627 100644
--- a/src/test/system/rados_list_parallel.cc
+++ b/src/test/system/rados_list_parallel.cc
@@ -14,6 +14,7 @@
#include "cross_process_sem.h"
#include "include/rados/librados.h"
+#include "include/stringify.h"
#include "st_rados_create_pool.h"
#include "st_rados_list_objects.h"
#include "systest_runnable.h"
@@ -30,6 +31,8 @@
#include <string>
#include <time.h>
#include <vector>
+#include <sys/types.h>
+#include <unistd.h>
using std::ostringstream;
using std::string;
@@ -68,7 +71,7 @@ public:
pool_setup_sem->post();
rados_ioctx_t io_ctx;
- RETURN1_IF_NOT_VAL(-EEXIST, rados_pool_create(cl, m_pool_name.c_str()));
+ rados_pool_create(cl, m_pool_name.c_str());
RETURN1_IF_NONZERO(rados_ioctx_create(cl, m_pool_name.c_str(), &io_ctx));
std::map <int, std::string> to_delete;
@@ -149,7 +152,7 @@ public:
pool_setup_sem->post();
rados_ioctx_t io_ctx;
- RETURN1_IF_NOT_VAL(-EEXIST, rados_pool_create(cl, m_pool_name.c_str()));
+ rados_pool_create(cl, m_pool_name.c_str());
RETURN1_IF_NONZERO(rados_ioctx_create(cl, m_pool_name.c_str(), &io_ctx));
std::map <int, std::string> to_add;
@@ -210,7 +213,7 @@ const char *get_id_str()
int main(int argc, const char **argv)
{
const char *num_objects = getenv("NUM_OBJECTS");
- std::string pool = "foo";
+ std::string pool = "foo." + stringify(getpid());
if (num_objects) {
g_num_objects = atoi(num_objects);
if (g_num_objects == 0)
diff --git a/src/test/system/rados_open_pools_parallel.cc b/src/test/system/rados_open_pools_parallel.cc
index 2780765a45f..445f2ebc485 100644
--- a/src/test/system/rados_open_pools_parallel.cc
+++ b/src/test/system/rados_open_pools_parallel.cc
@@ -73,7 +73,7 @@ public:
m_pool_setup_sem->wait();
printf("%s: rados_pool_create.\n", get_id_str());
- RETURN1_IF_NOT_VAL(-EEXIST, rados_pool_create(cl, "foo"));
+ rados_pool_create(cl, "foo");
rados_ioctx_t io_ctx;
printf("%s: rados_ioctx_create.\n", get_id_str());
RETURN1_IF_NOT_VAL(0, rados_ioctx_create(cl, "foo", &io_ctx));
diff --git a/src/test/system/st_rados_create_pool.cc b/src/test/system/st_rados_create_pool.cc
index 17b8adbeff4..4a46b0c04a8 100644
--- a/src/test/system/st_rados_create_pool.cc
+++ b/src/test/system/st_rados_create_pool.cc
@@ -79,13 +79,10 @@ run()
}
RETURN1_IF_NONZERO(rados_connect(cl));
- int ret = rados_pool_delete(cl, m_pool_name.c_str());
- if (!((ret == 0) || (ret == -ENOENT))) {
- printf("%s: rados_pool_delete error %d\n", get_id_str(), ret);
- return ret;
- }
+ int ret;
+
printf("%s: creating pool %s\n", get_id_str(), m_pool_name.c_str());
- RETURN1_IF_NONZERO(rados_pool_create(cl, m_pool_name.c_str()));
+ rados_pool_create(cl, m_pool_name.c_str());
rados_ioctx_t io_ctx;
RETURN1_IF_NONZERO(rados_ioctx_create(cl, m_pool_name.c_str(), &io_ctx));
diff --git a/src/test/system/st_rados_delete_objs.cc b/src/test/system/st_rados_delete_objs.cc
index 2afc7b32157..38dc47a3557 100644
--- a/src/test/system/st_rados_delete_objs.cc
+++ b/src/test/system/st_rados_delete_objs.cc
@@ -50,7 +50,7 @@ int StRadosDeleteObjs::run()
m_setup_sem->post();
rados_ioctx_t io_ctx;
- RETURN1_IF_NOT_VAL(-EEXIST, rados_pool_create(cl, m_pool_name.c_str()));
+ rados_pool_create(cl, m_pool_name.c_str());
RETURN1_IF_NONZERO(rados_ioctx_create(cl, m_pool_name.c_str(), &io_ctx));
for (int i = 0; i < m_num_objs; ++i) {
diff --git a/src/test/system/st_rados_delete_pool.cc b/src/test/system/st_rados_delete_pool.cc
index 441df29161a..d954bf46c23 100644
--- a/src/test/system/st_rados_delete_pool.cc
+++ b/src/test/system/st_rados_delete_pool.cc
@@ -46,7 +46,7 @@ int StRadosDeletePool::run()
m_pool_setup_sem->post();
rados_ioctx_t io_ctx;
- RETURN1_IF_NOT_VAL(-EEXIST, rados_pool_create(cl, m_pool_name.c_str()));
+ rados_pool_create(cl, m_pool_name.c_str());
RETURN1_IF_NONZERO(rados_ioctx_create(cl, m_pool_name.c_str(), &io_ctx));
rados_ioctx_destroy(io_ctx);
printf("%s: deleting pool %s\n", get_id_str(), m_pool_name.c_str());
diff --git a/src/test/system/st_rados_list_objects.cc b/src/test/system/st_rados_list_objects.cc
index 3dde2979633..8c0db947a04 100644
--- a/src/test/system/st_rados_list_objects.cc
+++ b/src/test/system/st_rados_list_objects.cc
@@ -59,7 +59,7 @@ run()
m_pool_setup_sem->post();
rados_ioctx_t io_ctx;
- RETURN1_IF_NOT_VAL(-EEXIST, rados_pool_create(cl, "foo"));
+ rados_pool_create(cl, "foo");
RETURN1_IF_NONZERO(rados_ioctx_create(cl, "foo", &io_ctx));
int ret, saw = 0;