summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtests/bugs/bug-1168803-snapd-option-validation-fix.t30
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c3
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/bugs/bug-1168803-snapd-option-validation-fix.t b/tests/bugs/bug-1168803-snapd-option-validation-fix.t
new file mode 100755
index 00000000000..e29cbe43db6
--- /dev/null
+++ b/tests/bugs/bug-1168803-snapd-option-validation-fix.t
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+## Test case for BZ-1168803 - snapd option validation should not fail if the
+#snapd is not running
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup;
+
+## Start glusterd
+TEST glusterd;
+TEST pidof glusterd;
+
+## create volume
+TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2};
+TEST $CLI volume set $V0 features.uss enable
+
+## Now set another volume option, this should not fail
+TEST $CLI volume set $V0 features.file-snapshot on
+
+## start the volume
+TEST $CLI volume start $V0
+
+## Kill snapd daemon and then try to stop the volume which should not fail
+kill $(ps aux | grep glusterfsd | grep snapd | awk '{print $2}')
+
+TEST $CLI volume stop $V0
+
+cleanup;
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 6eaa5f6d05a..39323897045 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -13521,6 +13521,9 @@ glusterd_handle_snapd_option (glusterd_volinfo_t *volinfo)
"Couldn't stop snapd for "
"volume: %s",
volinfo->volname);
+ } else {
+ /* Since snapd is not running set ret to 0 */
+ ret = 0;
}
goto out;
}