From: Kamoltat (Junior) Sirivadhna Date: Wed, 29 Apr 2026 14:11:41 +0000 (+0000) Subject: src/test: update show-choose-tries.t tests X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F68662%2Fhead;p=ceph.git src/test: update show-choose-tries.t tests Since we modified crushtool cli commands, we need to also update its test with new flag: --show-retry-exhaustion and also the modified --show-choose-tries option Also added /src/script/run-cli-tests.sh to run the cram test easily without having the config headache Signed-off-by: Kamoltat (Junior) Sirivadhna --- diff --git a/doc/dev/developer_guide/tests-unit-tests.rst b/doc/dev/developer_guide/tests-unit-tests.rst index e6026dd3c63..0ee13779234 100644 --- a/doc/dev/developer_guide/tests-unit-tests.rst +++ b/doc/dev/developer_guide/tests-unit-tests.rst @@ -71,6 +71,31 @@ teuthology using the `cram task`_. .. _`cram`: https://bitheap.org/cram/ .. _`cram task`: https://github.com/ceph/ceph/blob/master/qa/tasks/cram.py +Running CLI tools tests +----------------------- + +A convenience script is provided to run CLI tests easily without having to manually set up the environment. +From the Ceph source tree root directory: + + .. prompt:: bash $ + + # Run all CLI tests + ./src/script/run-cli-tests.sh + + # Run with custom build directory + ./src/script/run-cli-tests.sh -b /path/to/build + +Alternatively, you can run the tests directly from the build directory by setting up your PATH: + + .. prompt:: bash $ + + cd build + PATH="$PWD/bin:$PATH" ../src/test/run-cli-tests + +The test suite includes tests for: ``ceph-authtool``, ``ceph-conf``, +``ceph-kvstore-tool``, ``crushtool``, ``monmaptool``, ``osdmaptool``, +``radosgw-admin``, and ``rbd``. + Tox-based testing of Python modules ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Some of the Python modules in Ceph use `tox `_ diff --git a/src/script/run-cli-tests.sh b/src/script/run-cli-tests.sh new file mode 100755 index 00000000000..1e6c8522e61 --- /dev/null +++ b/src/script/run-cli-tests.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +CEPH_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" +BUILD_DIR="${BUILD_DIR:-$CEPH_ROOT/build}" + +usage() { + cat <