From e46cfff13a72ca3a15d5f3585b7213e9c302c7a2 Mon Sep 17 00:00:00 2001 From: Alex Ainscow Date: Fri, 17 Apr 2026 08:52:38 +0100 Subject: [PATCH] test: Add help to ceph_test_rados Basic help text to compliment the full docs in the previous commit. Signed-off-by: Alex Ainscow --- src/test/osd/TestRados.cc | 47 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/test/osd/TestRados.cc b/src/test/osd/TestRados.cc index e790f8689ae9..cc8331c674fd 100644 --- a/src/test/osd/TestRados.cc +++ b/src/test/osd/TestRados.cc @@ -464,6 +464,47 @@ private: RadosTestContext *context; }; +void usage(const char *prog) +{ + cout << "Usage: " << prog << std::endl; + cout << " --op " << std::endl; + cout << " [--op ...]" << std::endl; + cout << " [--pool ]" << std::endl; + cout << " [--max-ops ]" << std::endl; + cout << " [--objects ]" << std::endl; + cout << " [--max-in-flight ]" << std::endl; + cout << " [--size ]" << std::endl; + cout << " [--min-stride-size ]" << std::endl; + cout << " [--max-stride-size ]" << std::endl; + cout << " [--max-seconds ]" << std::endl; + cout << " [--ec-pool]" << std::endl; + cout << " [--no-omap]" << std::endl; + cout << " [--no-sparse]" << std::endl; + cout << " [--pool-snaps]" << std::endl; + cout << " [--balance-reads]" << std::endl; + cout << " [--localize-reads]" << std::endl; + cout << " [--offlen_randomization_ratio <0-100>]" << std::endl; + cout << " [--write-fadvise-dontneed]" << std::endl; + cout << " [--max-attr-len ]" << std::endl; + cout << " [--set_redirect]" << std::endl; + cout << " [--set_chunk]" << std::endl; + cout << " [--low_tier_pool ]" << std::endl; + cout << " [--enable_dedup]" << std::endl; + cout << " [--dedup_chunk_algo ]" << std::endl; + cout << " [--dedup_chunk_size ]" << std::endl; + cout << " [--timestamps]" << std::endl; + cout << std::endl; + cout << "Model-based RADOS integration stress test. Verifies data correctness by" << std::endl; + cout << "comparing object data and metadata returned by RADOS against an in-memory model." << std::endl; + cout << std::endl; + cout << "At least one --op with a positive weight is required." << std::endl; + cout << "See doc/dev/osd_internals/ceph_test_rados.rst for full documentation." << std::endl; +} + int main(int argc, char **argv) { int ops = 1000; @@ -536,7 +577,10 @@ int main(int argc, char **argv) for (int i = 1; i < argc; ++i) { - if (strcmp(argv[i], "--max-ops") == 0) + if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) { + usage(argv[0]); + exit(0); + } else if (strcmp(argv[i], "--max-ops") == 0) ops = atoi(argv[++i]); else if (strcmp(argv[i], "--pool") == 0) pool_name = argv[++i]; @@ -645,6 +689,7 @@ int main(int argc, char **argv) timestamp = true; } else { cerr << "unknown arg " << argv[i] << std::endl; + usage(argv[0]); exit(1); } } -- 2.47.3