From 1353b0e79fc34c48bfdd4dfd8fffca6b930a2b44 Mon Sep 17 00:00:00 2001 From: Vishal Pandey Date: Tue, 15 Jan 2019 15:47:26 +0530 Subject: [PATCH] Set options metadata-self-heal, entry-self-heal and data-self-heal in glustershd e2e tests to successfully heal. Change introduced in https://review.gluster.org/#/c/glusterfs/+/21938/. The above three options are not set to off by default in glustershd volfile. Signed-off-by: Vishal Pandey --- e2e/glustershd_test.go | 18 ++++++++++++++++-- glusterd2/options/options.go | 3 +-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/e2e/glustershd_test.go b/e2e/glustershd_test.go index d61d8969..3d09b3bf 100644 --- a/e2e/glustershd_test.go +++ b/e2e/glustershd_test.go @@ -52,6 +52,14 @@ func testSelfHeal(t *testing.T, tc *testCluster) { vol1, err := client.VolumeCreate(reqVol) r.Nil(err) + var optionReq api.VolOptionReq + + optionReq.Options = map[string]string{"cluster/replicate.self-heal-daemon": "off"} + optionReq.AllowAdvanced = true + + r.Nil(client.VolumeSet(vol1.Name, optionReq)) + r.False(isProcessRunning(pidpath), "glustershd is still running") + r.Nil(client.VolumeStart(vol1.Name, false), "volume start failed") checkFuseAvailable(t) @@ -120,9 +128,15 @@ func testSelfHeal(t *testing.T, tc *testCluster) { } r.Nil(client.VolumeStop(vol1.Name), "Volume stop failed") - r.Nil(client.VolumeStart(vol1.Name, false), "volume start failed") - var optionReq api.VolOptionReq + optionReq.Options = map[string]string{"cluster/replicate.entry-self-heal": "on", + "cluster/replicate.metadata-self-heal": "on", + "cluster/replicate.data-self-heal": "on"} + optionReq.AllowAdvanced = true + + r.Nil(client.VolumeSet(vol1.Name, optionReq)) + + r.Nil(client.VolumeStart(vol1.Name, false), "volume start failed") optionReq.Options = map[string]string{"cluster/replicate.self-heal-daemon": "on"} optionReq.AllowAdvanced = true diff --git a/glusterd2/options/options.go b/glusterd2/options/options.go index d51a1c3a..25e9ae2f 100644 --- a/glusterd2/options/options.go +++ b/glusterd2/options/options.go @@ -383,9 +383,8 @@ func ValidateStr(o *Option, val string) error { if t == op { return nil } - return ErrInvalidArg } - return nil + return ErrInvalidArg } // ValidateTime validates if the option is valid time format