@@ -344,6 +344,23 @@ var _ = Describe("Commands", func() {
344344 Expect (val ).NotTo (BeEmpty ())
345345 })
346346
347+ It ("should ConfigGet Modules" , func () {
348+ SkipBeforeRedisMajor (8 , "Config doesn't include modules before Redis 8" )
349+ expected := map [string ]string {
350+ "search-*" : "search-min-prefix" ,
351+ "ts-*" : "ts-retention-policy" ,
352+ "bf-*" : "bf-error-rate" ,
353+ "cf-*" : "cf-initial-size" ,
354+ }
355+
356+ for prefix , lookup := range expected {
357+ val , err := client .ConfigGet (ctx , prefix ).Result ()
358+ Expect (err ).NotTo (HaveOccurred ())
359+ Expect (val ).NotTo (BeEmpty ())
360+ Expect (val [lookup ]).NotTo (BeEmpty ())
361+ }
362+ })
363+
347364 It ("should ConfigResetStat" , Label ("NonRedisEnterprise" ), func () {
348365 r := client .ConfigResetStat (ctx )
349366 Expect (r .Err ()).NotTo (HaveOccurred ())
@@ -362,6 +379,47 @@ var _ = Describe("Commands", func() {
362379 Expect (configSet .Val ()).To (Equal ("OK" ))
363380 })
364381
382+ It ("should ConfigSet Modules" , func () {
383+ SkipBeforeRedisMajor (8 , "Config doesn't include modules before Redis 8" )
384+ expected := map [string ]string {
385+ "search-min-prefix" : "32" ,
386+ "ts-retention-policy" : "2" ,
387+ "bf-error-rate" : "0.13" ,
388+ "cf-initial-size" : "64" ,
389+ }
390+
391+ for setting , value := range expected {
392+ val , err := client .ConfigSet (ctx , setting , value ).Result ()
393+ Expect (err ).NotTo (HaveOccurred ())
394+ Expect (val ).NotTo (BeEmpty ())
395+ Expect (val ).To (Equal ("OK" ))
396+ }
397+
398+ for setting , value := range expected {
399+ val , err := client .ConfigGet (ctx , setting ).Result ()
400+ Expect (err ).NotTo (HaveOccurred ())
401+ Expect (val ).NotTo (BeEmpty ())
402+ Expect (val [setting ]).To (Equal (value ))
403+ }
404+ })
405+
406+ It ("should Fail ConfigSet Modules" , func () {
407+ SkipBeforeRedisMajor (8 , "Config doesn't include modules before Redis 8" )
408+ expected := map [string ]string {
409+ "search-min-prefix" : "-32" ,
410+ "ts-retention-policy" : "-10" ,
411+ "bf-error-rate" : "1.5" ,
412+ "cf-initial-size" : "-10" ,
413+ }
414+
415+ for setting , value := range expected {
416+ val , err := client .ConfigSet (ctx , setting , value ).Result ()
417+ Expect (err ).To (HaveOccurred ())
418+ Expect (err ).To (MatchError (ContainSubstring (setting )))
419+ Expect (val ).To (BeEmpty ())
420+ }
421+ })
422+
365423 It ("should ConfigRewrite" , Label ("NonRedisEnterprise" ), func () {
366424 configRewrite := client .ConfigRewrite (ctx )
367425 Expect (configRewrite .Err ()).NotTo (HaveOccurred ())
0 commit comments