]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test: update librados tests for CLI arg syntax
authorJohn Spray <john.spray@redhat.com>
Wed, 7 Nov 2018 12:01:43 +0000 (07:01 -0500)
committerJohn Spray <john.spray@redhat.com>
Wed, 7 Nov 2018 12:02:41 +0000 (07:02 -0500)
Signed-off-by: John Spray <john.spray@redhat.com>
src/test/librados/list.cc
src/test/librados/pool.cc
src/test/librados/testcase_cxx.cc
src/test/pybind/test_rados.py

index a1bda0aaff4835446aa3dfa97320d6613842be03..3ee9ae24bab51d5c8d8801d0435fd0dd21887f05 100644 (file)
@@ -385,7 +385,7 @@ TEST_F(LibRadosListNP, ListObjectsError) {
     size_t buflen, stlen;
     string c = "{\"prefix\":\"osd pool rm\",\"pool\": \"" + pool_name +
       "\",\"pool2\":\"" + pool_name +
-      "\",\"sure\": \"--yes-i-really-really-mean-it-not-faking\"}";
+      "\",\"yes_i_really_really_mean_it_not_faking\": true}";
     const char *cmd[2] = { c.c_str(), 0 };
     ASSERT_EQ(0, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
     ASSERT_EQ(0, rados_wait_for_latest_osdmap(cluster));
index 14906651922f08570213b0e015c1e46ce85c60b0..4b0a3cc0246a9b24a4a990b9b54d475178fe6c14 100644 (file)
@@ -125,8 +125,8 @@ TEST(LibRadosPools, PoolGetBaseTier) {
   ASSERT_EQ(0, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, NULL, 0, NULL, 0));
 
   cmdstr = "{\"prefix\": \"osd tier cache-mode\", \"pool\": \"" +
-     tier_pool_name + "\", \"mode\":\"readonly\", \"sure\": " +
-    "\"--yes-i-really-mean-it\"}";
+     tier_pool_name + "\", \"mode\":\"readonly\"," +
+    " \"yes_i_really_mean_it\": true}";
   cmd[0] = (char *)cmdstr.c_str();
   ASSERT_EQ(0, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, NULL, 0, NULL, 0));
 
index 0a71fa39ca20608e1bae2a5f87e7bd72535b6f94..abe16e854c447b7dece2b4235cca889c6e6c7fef 100644 (file)
@@ -91,7 +91,7 @@ void RadosTestParamPPNS::TearDownTestCase()
       inbl, NULL, NULL));
     ASSERT_EQ(0, s_cluster.mon_command(
       "{\"prefix\": \"osd pool delete\", \"pool\": \"" + cache_pool_name +
-      "\", \"pool2\": \"" + cache_pool_name + "\", \"sure\": \"--yes-i-really-really-mean-it\"}",
+      "\", \"pool2\": \"" + cache_pool_name + "\", \"yes_i_really_really_mean_it\": true}",
       inbl, NULL, NULL));
     cache_pool_name = "";
   }
@@ -286,7 +286,7 @@ void RadosTestParamPP::TearDownTestCase()
       inbl, NULL, NULL));
     ASSERT_EQ(0, s_cluster.mon_command(
       "{\"prefix\": \"osd pool delete\", \"pool\": \"" + cache_pool_name +
-      "\", \"pool2\": \"" + cache_pool_name + "\", \"sure\": \"--yes-i-really-really-mean-it\"}",
+      "\", \"pool2\": \"" + cache_pool_name + "\", \"yes_i_really_really_mean_it\": true}",
       inbl, NULL, NULL));
     cache_pool_name = "";
   }
index 522751504f1f2a51487cc8f07ede346b619a868b..5eda5d612e8662d71256027b1c353ca38fd4d687 100644 (file)
@@ -221,7 +221,7 @@ class TestRados(object):
                 eq(ret, 0)
 
                 try:
-                    cmd = {"prefix":"osd tier cache-mode", "pool":"foo-cache", "tierpool":"foo-cache", "mode":"readonly", "sure":"--yes-i-really-mean-it"}
+                    cmd = {"prefix":"osd tier cache-mode", "pool":"foo-cache", "tierpool":"foo-cache", "mode":"readonly", "yes_i_really_mean_it": True}
                     ret, buf, errs = self.rados.mon_command(json.dumps(cmd), b'', timeout=30)
                     eq(ret, 0)