From 4df08eb481a2f52efe9c56581dfe14ec8f01806a Mon Sep 17 00:00:00 2001 From: John Spray Date: Wed, 7 Nov 2018 07:01:43 -0500 Subject: [PATCH] test: update librados tests for CLI arg syntax Signed-off-by: John Spray --- src/test/librados/list.cc | 2 +- src/test/librados/pool.cc | 4 ++-- src/test/librados/testcase_cxx.cc | 4 ++-- src/test/pybind/test_rados.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/librados/list.cc b/src/test/librados/list.cc index a1bda0aaff4..3ee9ae24bab 100644 --- a/src/test/librados/list.cc +++ b/src/test/librados/list.cc @@ -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)); diff --git a/src/test/librados/pool.cc b/src/test/librados/pool.cc index 14906651922..4b0a3cc0246 100644 --- a/src/test/librados/pool.cc +++ b/src/test/librados/pool.cc @@ -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)); diff --git a/src/test/librados/testcase_cxx.cc b/src/test/librados/testcase_cxx.cc index 0a71fa39ca2..abe16e854c4 100644 --- a/src/test/librados/testcase_cxx.cc +++ b/src/test/librados/testcase_cxx.cc @@ -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 = ""; } diff --git a/src/test/pybind/test_rados.py b/src/test/pybind/test_rados.py index 522751504f1..5eda5d612e8 100644 --- a/src/test/pybind/test_rados.py +++ b/src/test/pybind/test_rados.py @@ -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) -- 2.39.5