@@ -418,6 +418,31 @@ var _ = Describe("Server", func() {
418418 Expect (configRewrite .Err ()).NotTo (HaveOccurred ())
419419 Expect (configRewrite .Val ()).To (Equal ("OK" ))
420420 })
421+
422+ // Test for cache-value-item-max-size & max-key-size-in-cache
423+ It ("should handle cache size configurations correctly" , func () {
424+ configGet := client .ConfigGet (ctx , "cache-value-item-max-size" )
425+ Expect (configGet .Err ()).NotTo (HaveOccurred ())
426+ Expect (configGet .Val ()).To (HaveKey ("cache-value-item-max-size" ))
427+
428+ configGet2 := client .ConfigGet (ctx , "max-key-size-in-cache" )
429+ Expect (configGet2 .Err ()).NotTo (HaveOccurred ())
430+ Expect (configGet2 .Val ()).To (HaveKey ("max-key-size-in-cache" ))
431+
432+ configSet1 := client .ConfigSet (ctx , "cache-value-item-max-size" , "1024" )
433+ Expect (configSet1 .Err ()).NotTo (HaveOccurred ())
434+ Expect (configSet1 .Val ()).To (Equal ("OK" ))
435+
436+ configSet2 := client .ConfigSet (ctx , "max-key-size-in-cache" , "1048576" )
437+ Expect (configSet2 .Err ()).NotTo (HaveOccurred ())
438+ Expect (configSet2 .Val ()).To (Equal ("OK" ))
439+
440+ configGet3 := client .ConfigGet (ctx , "cache-value-item-max-size" )
441+ Expect (configGet3 .Val ()["cache-value-item-max-size" ]).To (Equal ("1024" ))
442+
443+ configGet4 := client .ConfigGet (ctx , "max-key-size-in-cache" )
444+ Expect (configGet4 .Val ()["max-key-size-in-cache" ]).To (Equal ("1048576" ))
445+ })
421446 //It("should DBSize", func() {
422447 // Expect(client.Set(ctx, "key", "value", 0).Val()).To(Equal("OK"))
423448 // Expect(client.Do(ctx, "info", "keyspace", "1").Err()).NotTo(HaveOccurred())
@@ -739,5 +764,27 @@ var _ = Describe("Server", func() {
739764 Expect (client .Get (ctx , "foo" ).Err ()).To (MatchError (redis .Nil ))
740765 Expect (client .Get (ctx , "key1" ).Err ()).To (MatchError (redis .Nil ))
741766 })
767+
768+ //fix: added the correct loading of admin-cmd-list in the configuration file
769+ It ("should load admin-cmd-list from config correctly" , func () {
770+ configGet := client .ConfigGet (ctx , "admin-cmd-list" )
771+ Expect (configGet .Err ()).NotTo (HaveOccurred ())
772+ Expect (configGet .Val ()).To (HaveLen (1 ))
773+
774+ adminCmdList , ok := configGet .Val ()["admin-cmd-list" ]
775+ Expect (ok ).To (BeTrue ())
776+
777+ Expect (adminCmdList ).To (ContainSubstring ("auth" ))
778+ Expect (adminCmdList ).To (ContainSubstring ("config" ))
779+ Expect (adminCmdList ).To (ContainSubstring ("info" ))
780+ Expect (adminCmdList ).To (ContainSubstring ("ping" ))
781+ Expect (adminCmdList ).To (ContainSubstring ("monitor" ))
782+ })
783+
784+ // fix add auth command to admin-thread-pool
785+ It ("should process auth command in admin thread pool" , func () {
786+ auth := client .Do (ctx , "auth" , "wrongpassword" )
787+ Expect (auth .Err ()).To (HaveOccurred ())
788+ })
742789 })
743790})
0 commit comments