]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
add WatchNotifyTimeoutTestPP
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 18 Aug 2011 22:06:54 +0000 (15:06 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 18 Aug 2011 22:06:54 +0000 (15:06 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/test/rados-api/watch_notify.cc

index 1fceee4e8075b4ca4e8556e390db4ed1687ebb67..88dcabfa3bc724a384620e984bd24a4b5a96ffa1 100644 (file)
@@ -70,3 +70,19 @@ TEST(LibRadosWatchNotify, WatchNotifyTestPP) {
   ASSERT_EQ(0, destroy_one_pool_pp(pool_name, cluster));
   sem_destroy(&sem);
 }
+
+TEST(LibRadosWatchNotify, WatchNotifyTimeoutTestPP) {
+  ASSERT_EQ(0, sem_init(&sem, 0, 0));
+  Rados cluster;
+  std::string pool_name = get_temp_pool_name();
+  ASSERT_EQ("", create_one_pool_pp(pool_name, cluster));
+  IoCtx ioctx;
+  cluster.ioctx_create(pool_name.c_str(), ioctx);
+  ioctx.set_notify_timeout(1);
+  uint64_t handle;
+  WatchNotifyTestCtx ctx;
+  ASSERT_EQ(0, ioctx.watch("foo", 0, &handle, &ctx));
+  ioctx.close();
+  ASSERT_EQ(0, destroy_one_pool_pp(pool_name, cluster));
+  sem_destroy(&sem);
+}