@@ -40,7 +40,7 @@ func TestVolume(t *testing.T) {
4040 r .Nil (err )
4141 defer teardownCluster (gds )
4242
43- client = initRestclient (gds [0 ]. ClientAddress , gds [ 0 ]. LocalStateDir )
43+ client = initRestclient (gds [0 ])
4444
4545 t .Run ("CreateWithoutName" , testVolumeCreateWithoutName )
4646
@@ -418,7 +418,7 @@ func TestVolumeOptions(t *testing.T) {
418418 brickPath , err := ioutil .TempDir (brickDir , "brick" )
419419 r .Nil (err )
420420
421- client := initRestclient (gds [0 ]. ClientAddress , gds [ 0 ]. LocalStateDir )
421+ client := initRestclient (gds [0 ])
422422
423423 volname := "testvol"
424424 createReq := api.VolCreateReq {
@@ -451,6 +451,11 @@ func TestVolumeOptions(t *testing.T) {
451451 _ , err = client .VolumeGet (volname , validKey )
452452 r .Nil (err )
453453
454+ var resetOptionReq api.VolOptionResetReq
455+ resetOptionReq .Options = append (resetOptionReq .Options , validKey )
456+ resetOptionReq .Force = true
457+ r .Nil (client .VolumeReset (volname , resetOptionReq ))
458+
454459 err = client .VolumeDelete (volname )
455460 r .Nil (err )
456461 }
@@ -485,9 +490,26 @@ func TestVolumeOptions(t *testing.T) {
485490 settableKey := "afr.use-compound-fops"
486491 optionReq .Options = map [string ]string {settableKey : "on" }
487492 r .Nil (client .VolumeSet (volname , optionReq ))
493+
494+ var resetOptionReq api.VolOptionResetReq
495+ resetOptionReq .Options = []string {"afr.use-compound-fops" }
496+ resetOptionReq .Force = true
497+ r .Nil (client .VolumeReset (volname , resetOptionReq ))
498+
499+ validOpKeys = []string {"io-stats.count-fop-hits" , "io-stats.latency-measurement" }
500+ for _ , validKey := range validOpKeys {
501+ optionReq .Options = map [string ]string {validKey : "on" }
502+ r .Nil (client .VolumeSet (volname , optionReq ))
503+ }
504+
505+ resetOptionReq .Force = true
506+ resetOptionReq .All = true
507+ r .Nil (client .VolumeReset (volname , resetOptionReq ))
508+
488509 notSettableKey := "afr.consistent-io"
489510 optionReq .Options = map [string ]string {notSettableKey : "on" }
490511 r .NotNil (client .VolumeSet (volname , optionReq ))
512+
491513 r .Nil (client .VolumeDelete (volname ))
492514
493515 // group option test cases
@@ -501,7 +523,6 @@ func TestVolumeOptions(t *testing.T) {
501523 err = client .VolumeDelete (volname )
502524 r .Nil (err )
503525 }
504-
505526 for _ , validKey := range groupOpKeys {
506527 createReq .Options = map [string ]string {validKey : "off" }
507528
0 commit comments