From 1e98c72dfcea58877daa6907c0c637e00e3588e6 Mon Sep 17 00:00:00 2001 From: Yan Jun Date: Tue, 23 Oct 2018 16:19:10 +0800 Subject: [PATCH] mon: drop repeated 'goodchars' and add osd crush ls testcase Signed-off-by: Yan Jun --- qa/standalone/mon/osd-crush.sh | 10 ++++++++++ src/mon/MonCommands.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/qa/standalone/mon/osd-crush.sh b/qa/standalone/mon/osd-crush.sh index 84a6be2a9e8..b639bcce997 100755 --- a/qa/standalone/mon/osd-crush.sh +++ b/qa/standalone/mon/osd-crush.sh @@ -208,6 +208,16 @@ function TEST_crush_rename_bucket() { ceph osd crush rename-bucket nonexistent something 2>&1 | grep "Error ENOENT" || return 1 } +function TEST_crush_ls_node() { + local dir=$1 + run_mon $dir a || return 1 + ceph osd crush add-bucket default1 root + ceph osd crush add-bucket host1 host + ceph osd crush move host1 root=default1 + ceph osd crush ls default1 | grep host1 || return 1 + ceph osd crush ls default2 2>&1 | grep "Error ENOENT" || return 1 +} + function TEST_crush_reject_empty() { local dir=$1 run_mon $dir a || return 1 diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 0e1c1049fed..202282c1a06 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -671,7 +671,7 @@ COMMAND("osd crush tree " "name=shadow,type=CephChoices,strings=--show-shadow,req=false", \ "dump crush buckets and items in a tree view", "osd", "r", "cli,rest") -COMMAND("osd crush ls name=node,type=CephString,goodchars=goodchars=[A-Za-z0-9-_.]", +COMMAND("osd crush ls name=node,type=CephString,goodchars=[A-Za-z0-9-_.]", "list items beneath a node in the CRUSH tree", "osd", "r", "cli,rest") COMMAND("osd crush class ls", \ -- 2.39.5