The get_command_descriptions function is not designed to be tested in
C++ because all the validation happens in pybind/ceph_argparse.py. The
get_command_descriptions program is designed to be used by python unit
tests as a mean to get a JSON dump of the content of mon/MonCommands.h
get_command_descriptions --all
{"cmd000":{"sig":["pg","stat"],"help": ... "avail":"cli,rest"}}
It also provides a way to reproduce and keep track of past errors
( typos etc. ) to ensure the python validation keeps catching it.
get_command_descriptions --pull585
Add /get_command_descriptions to .gitignore so that
git ls-files --exclude-standard --others
does not see it which is required for
f018d220f2/build-ceph.sh (L73)http://tracker.ceph.com/issues/6274 refs #6274
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
The get_command_descriptions is added to Monitor.h and contains
the code previously inlined in Monitor::handle_command to implement
the get_command_descriptions command. It is intended for tests to
convert command descriptions into json, including error cases.
http://tracker.ceph.com/issues/6274 refs #6274
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
The check_SCRIPTS is added in Makefile-env.am to list the tests that do
not require compilation. The scripts listed in check-local and in the
TESTS variable use check_SCRIPTS instead.
The PYTHONPATH environment variable is added to Makefile-env.am and
includes the pybind directory so that python unit tests can load the
libraries from sources.
http://tracker.ceph.com/issues/6274 refs #6274
Reviewed-by: Roald J. van Loon <roaldvanloon@gmail.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
libkeyutils is only available on linux. before the automake refactoring
secret.c was compiled into rbd and ceph_mount targets which are linux
only targets. secret.c was moved to libcommon during the refactoring,
but the conditional compilation was lost.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
The minimum_to_decode function simply returns the available chunks if no
recovery is necessary.
Add unit tests covering all minimum_to_decode situations:
* trying to read nothing
* read a chunk if none are available
* reading a subset of the available chunks
* read a missing chunk if there is less than k chunks available.
* reading when a chunk must be recovered
Signed-off-by: Loic Dachary <loic@dachary.org>
AM_COMMON_FLAGS included both CPP and C[XX] flags. This can cause
re-definition errors like this:
make[4]: Nothing to be done for `all-am'.
CXX cls/version/cls_version_client.o
<command-line>: warning: "__STDC_FORMAT_MACROS" redefined
because the macro definition appears in both AM_CXXFLAGS and
AM_CPPFLAGS.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
perfglue/heapprofiler: expect cmd name when handling command instead of 'heap <cmd>'
This was broken by the cli rework.
Reviewed-by: Samuel Just <sam.just@inktank.com>
Fix the copy_from operation to not remove the objects from the in_use list
until after the entire operation is complete. In particular, the racing
read was completing and removing the dest oid from the in-use list before
the copy-from completed. This keeps the model in sync with what the OSD
is actually doing.
If another new read started up, it would grab the previous value from the
model and expect to see that, but would instead see the updated value.
Signed-off-by: Sage Weil <sage@inktank.com>
Fixes: #6176
Backport: dumpling
We take different code paths in copy_obj, make sure we close the handle
when we exit the function. Move the call to finish_get_obj() out of
copy_obj_data() as we don't create the handle there, so that should
makes code less confusing and less prone to errors.
Also, note that RGWRados::get_obj() also calls finish_get_obj(). For
everything to work in concert we need to pass a pointer to the handle
and not the handle itself. Therefore we needed to also change the call
to copy_obj_data().
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
The heap profiler doesn't care, nor should it, what our command name is.
It only cares about the commands it handles.
Backport: dumpling
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
We used to pass 'heap' as the first element of the cmd vector when
handling commands. We haven't been doing so for a while now, so we
needed to fix this.
Not expecting 'heap' also makes sense, considering that what we need to
know when we reach this function is what command we should handle, and
we should not care what the caller calls us when handling his business.
Fixes: #6361
Backport: dumpling
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
Fixes: #6359
Introduced in 17c5d765d7c7573f875f6b3ba66e3b6813110a06
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
replace list::size() with map::size(), which should have
a constant time complexity.
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
This code was originally used in a token cache, now
as a generic infrastructure rename token fields.
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
They belong next to the class. Also, if rgw isn't built, ceph-dencoder
will fail to link.
Fixes: #6352
Tested-by: Haomai Wang <haomaiwang@gmail.com>
Signed-off-by: Sage Weil <sage@inktank.com>
When using the properties key=value only, the test was inverted
and an attempt to obtain a substring at index string::npos throws
an exception.
Add variations of osd pool create to qa/workunits/mon/pool_ops.sh
to assert the problem has been fixed and all code paths are used.
http://tracker.ceph.com/issues/6357fixes#6357
Signed-off-by: Loic Dachary <loic@dachary.org>
Function `get_process_name` has platform specific dependencies. Check
for Linux prctl function and correct command flag.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
push_back() expects char *, whereas append can append a single char.
Appending a NULL char to push_back is cast as a NULL pointer which is
bad.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>