From 5f239fa6477774ace10f96ba8f2229bd205d0033 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Fri, 14 Jan 2011 15:21:46 -0800 Subject: [PATCH] Fix clitests for cconf usage change. --- src/test/cli/cconf/help.t | 7 +++-- src/test/cli/cconf/invalid-args.t | 45 ++++++++++++++++++++++--------- src/test/cli/cconf/simple.t | 45 ++++++++++++++++++++++--------- 3 files changed, 69 insertions(+), 28 deletions(-) diff --git a/src/test/cli/cconf/help.t b/src/test/cli/cconf/help.t index 4892ac92ca97a..24f1e5b6f1d27 100644 --- a/src/test/cli/cconf/help.t +++ b/src/test/cli/cconf/help.t @@ -1,6 +1,4 @@ -#TODO $ cconf --help - Parse error at argument: --help Ceph configuration query tool USAGE @@ -8,12 +6,14 @@ ACTIONS -l|--list-sections List sections in prefix - --lookup [defval] Print a configuration setting to stdout. \t\t\t\t If the setting is not defined, and the (esc) \t\t\t\t optional argument defval is provide, it will (esc) \t\t\t\t be printed instead. variables in defval are (esc) \t\t\t\t interpolated. (esc) + -r|--resolve-search search for the first file that exists and + can be opened in the resulted comma + delimited search list. FLAGS -i id Set id @@ -30,4 +30,3 @@ RETURN CODE Return code will be 0 on success; error code otherwise. - [1] diff --git a/src/test/cli/cconf/invalid-args.t b/src/test/cli/cconf/invalid-args.t index b4e4ae26d95e3..d11ae5d91ef60 100644 --- a/src/test/cli/cconf/invalid-args.t +++ b/src/test/cli/cconf/invalid-args.t @@ -7,16 +7,37 @@ $ cconf -c test.conf broken [1] -# TODO output an error (missing key) +# TODO output an error (missing key), not the whole usage $ cconf -c test.conf -s bar - *** Caught signal (Segmentation fault) *** - in thread [0-9a-f]{12} (re) - ceph version .* (re) - 1: .* (re) - 2: .* (re) - 3: .* (re) - 4: .* (re) - 5: .* (re) - 6: .* (re) - Segmentation fault - [139] + Ceph configuration query tool + + USAGE + cconf + + ACTIONS + -l|--list-sections List sections in prefix + --lookup [defval] Print a configuration setting to stdout. + \t\t\t\t If the setting is not defined, and the (esc) + \t\t\t\t optional argument defval is provide, it will (esc) + \t\t\t\t be printed instead. variables in defval are (esc) + \t\t\t\t interpolated. (esc) + -r|--resolve-search search for the first file that exists and + can be opened in the resulted comma + delimited search list. + + FLAGS + -i id Set id + [-s
] Add to list of sections to search + + If there is no action given, the action will default to --lookup. + + EXAMPLES + [$] cconf -i cconf -c /etc/ceph/ceph.conf -t mon -i 0 'mon addr' (re) + Find out if there is a 'mon addr' defined in /etc/ceph/ceph.conf + + [$] cconf -l mon (re) + List sections beginning with 'mon'. + + RETURN CODE + Return code will be 0 on success; error code otherwise. + [1] diff --git a/src/test/cli/cconf/simple.t b/src/test/cli/cconf/simple.t index 39d2bc64d348b..cc9abb1011abf 100644 --- a/src/test/cli/cconf/simple.t +++ b/src/test/cli/cconf/simple.t @@ -1,13 +1,34 @@ -#TODO +#TODO just show an error, not the whole usage $ cconf - *** Caught signal (Segmentation fault) *** - in thread [0-9a-f]{12} (re) - ceph version .* (re) - 1: .* (re) - 2: .* (re) - 3: .* (re) - 4: .* (re) - 5: .* (re) - 6: .* (re) - Segmentation fault - [139] + Ceph configuration query tool + + USAGE + cconf + + ACTIONS + -l|--list-sections List sections in prefix + --lookup [defval] Print a configuration setting to stdout. + \t\t\t\t If the setting is not defined, and the (esc) + \t\t\t\t optional argument defval is provide, it will (esc) + \t\t\t\t be printed instead. variables in defval are (esc) + \t\t\t\t interpolated. (esc) + -r|--resolve-search search for the first file that exists and + can be opened in the resulted comma + delimited search list. + + FLAGS + -i id Set id + [-s
] Add to list of sections to search + + If there is no action given, the action will default to --lookup. + + EXAMPLES + [$] cconf -i cconf -c /etc/ceph/ceph.conf -t mon -i 0 'mon addr' (re) + Find out if there is a 'mon addr' defined in /etc/ceph/ceph.conf + + [$] cconf -l mon (re) + List sections beginning with 'mon'. + + RETURN CODE + Return code will be 0 on success; error code otherwise. + [1] -- 2.39.5