@@ -1816,45 +1816,6 @@ def teardown():
1816
1816
assert "client-info" in r .acl_log (count = 1 , target_nodes = node )[0 ]
1817
1817
assert r .acl_log_reset (target_nodes = node )
1818
1818
1819
- @skip_if_server_version_lt ("6.0.0" )
1820
- @skip_if_redis_enterprise ()
1821
- def test_acl_log (self , r , request ):
1822
- key = '{cache}:'
1823
- node = r .get_node_from_key (key )
1824
- username = 'redis-py-user'
1825
-
1826
- def teardown ():
1827
- r .acl_deluser (username , target_nodes = 'primaries' )
1828
-
1829
- request .addfinalizer (teardown )
1830
- r .acl_setuser (username , enabled = True , reset = True ,
1831
- commands = ['+get' , '+set' , '+select' , '+cluster' ,
1832
- '+command' ], keys = ['{cache}:*' ], nopass = True ,
1833
- target_nodes = 'primaries' )
1834
- r .acl_log_reset (target_nodes = node )
1835
-
1836
- user_client = _get_client (RedisCluster , request , flushdb = False ,
1837
- username = username )
1838
-
1839
- # Valid operation and key
1840
- assert user_client .set ('{cache}:0' , 1 )
1841
- assert user_client .get ('{cache}:0' ) == b'1'
1842
-
1843
- # Invalid key
1844
- with pytest .raises (NoPermissionError ):
1845
- user_client .get ('{cache}violated_cache:0' )
1846
-
1847
- # Invalid operation
1848
- with pytest .raises (NoPermissionError ):
1849
- user_client .hset ('{cache}:0' , 'hkey' , 'hval' )
1850
-
1851
- assert isinstance (r .acl_log (target_nodes = node ), list )
1852
- assert len (r .acl_log (target_nodes = node )) == 2
1853
- assert len (r .acl_log (count = 1 , target_nodes = node )) == 1
1854
- assert isinstance (r .acl_log (target_nodes = node )[0 ], dict )
1855
- assert 'client-info' in r .acl_log (count = 1 , target_nodes = node )[0 ]
1856
- assert r .acl_log_reset (target_nodes = node )
1857
-
1858
1819
1859
1820
@pytest .mark .onlycluster
1860
1821
class TestNodesManager :
0 commit comments