path: root/tests/bugs/bug-982174.t
diff options
authorRavishankar N <>2013-07-08 15:45:54 +0530
committerVijay Bellur <>2013-07-12 04:14:12 -0700
commit07833f13d43a3e3532171bb2edbe068e3a7205b1 (patch)
tree257e92d04fabce1b7968a5b68ea3d5494f5ef2b1 /tests/bugs/bug-982174.t
parentec64f13476cbd2f7702cecfef929f3ea8efc0a51 (diff)
cli: check for null in is_server_debug_xlator()
Command: gluster volume set <volname> diagnostics.client-log-level trace Expected output: "volume set: failed: option log-level trace: 'trace' is not valid (possible options are DEBUG, WARNING, ERROR, INFO, CRITICAL, NONE, TRACE.)" Current output: gluster cli receives a segmentation fault Fix: check for NULL before calling strstr Change-Id: If4c7a85a635849a388cf122543e12349c109643c BUG: 982174 Signed-off-by: Ravishankar N <> Reviewed-on: Reviewed-by: Kaushal M <> Tested-by: Gluster Build System <>
Diffstat (limited to 'tests/bugs/bug-982174.t')
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/bugs/bug-982174.t b/tests/bugs/bug-982174.t
new file mode 100644
index 00000000..460af751
--- /dev/null
+++ b/tests/bugs/bug-982174.t
@@ -0,0 +1,36 @@
+# Test to check
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+#Check if incorrect log-level keywords does not crash the CLI
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume create $V0 $H0:$B0/brick1 $H0:$B0/brick2
+TEST $CLI volume start $V0
+function set_log_level_status {
+ local level=$1
+ $CLI volume set $V0 diagnostics.client-log-level $level 2>&1 |grep -oE 'success|failed'
+EXPECT "failed" set_log_level_status $LOG_LEVEL
+EXPECT "failed" set_log_level_status $LOG_LEVEL
+EXPECT "success" set_log_level_status $LOG_LEVEL
+EXPECT "$LOG_LEVEL" echo `$CLI volume info | grep diagnostics | awk '{print $2}'`
+TEST $CLI volume stop $V0;
+TEST $CLI volume delete $V0;