@@ -381,13 +381,22 @@ var _ = Describe("Commands", func() {
381
381
382
382
It ("should ConfigSet Modules" , func () {
383
383
SkipBeforeRedisMajor (8 , "Config doesn't include modules before Redis 8" )
384
+ defaults := map [string ]string {}
384
385
expected := map [string ]string {
385
386
"search-min-prefix" : "32" ,
386
387
"ts-retention-policy" : "2" ,
387
388
"bf-error-rate" : "0.13" ,
388
389
"cf-initial-size" : "64" ,
389
390
}
390
391
392
+ // read the defaults to set them back later
393
+ for setting , _ := range expected {
394
+ val , err := client .ConfigGet (ctx , setting ).Result ()
395
+ Expect (err ).NotTo (HaveOccurred ())
396
+ defaults [setting ] = val [setting ]
397
+ }
398
+
399
+ // check if new values can be set
391
400
for setting , value := range expected {
392
401
val , err := client .ConfigSet (ctx , setting , value ).Result ()
393
402
Expect (err ).NotTo (HaveOccurred ())
@@ -401,6 +410,14 @@ var _ = Describe("Commands", func() {
401
410
Expect (val ).NotTo (BeEmpty ())
402
411
Expect (val [setting ]).To (Equal (value ))
403
412
}
413
+
414
+ // set back to the defaults
415
+ for setting , value := range defaults {
416
+ val , err := client .ConfigSet (ctx , setting , value ).Result ()
417
+ Expect (err ).NotTo (HaveOccurred ())
418
+ Expect (val ).NotTo (BeEmpty ())
419
+ Expect (val ).To (Equal ("OK" ))
420
+ }
404
421
})
405
422
406
423
It ("should Fail ConfigSet Modules" , func () {
0 commit comments