]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
pybind: unit tests for ceph_argparse::parse_json_funcsigs
authorLoic Dachary <loic@dachary.org>
Wed, 11 Sep 2013 16:33:52 +0000 (18:33 +0200)
committerLoic Dachary <loic@dachary.org>
Mon, 23 Sep 2013 21:46:43 +0000 (23:46 +0200)
commit8f0bb2f02fa7c6acd7ee624f13ce6f172e3d68b0
tree1740c13e6a6bd96968203abac5ced1813b3bb259
parent96067e07844a6fb9392595616cebad3f372153cb
pybind: unit tests for ceph_argparse::parse_json_funcsigs

Run parse_json_funcsigs against the builtin commands found
in mon/MonCommands.h. Although it does not provide for a full
validation, it will detect some degenerate cases.

It is expected to raise if a space is missing at the end of an option
specification ( see https://github.com/ceph/ceph/pull/585 ) and this
case is tested. New tests of the same kind can be added whenever an
undetected error is found. Ideally a validation function is implemented
and it would be updated ( with an associated test ) when a new
pathological case is found.

The json string given to parse_json_funcsigs is obtained from
the support program get_command_descriptions.

The python-nose dependencies are added to the build requirements in
debian/control and ceph.spec.in because make check should always be run
at built time.

http://tracker.ceph.com/issues/6274 refs #6274

Reviewed-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
ceph.spec.in
debian/control
src/test/Makefile.am
src/test/pybind/test_ceph_argparse.py [new file with mode: 0755]