mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
tests: increases unit test coverage for etcd/server/auth isRangeOpPermitted
Signed-off-by: Owayss Kabtoul <owayssk@gmail.com>
This commit is contained in:
parent
0ac617059f
commit
1c18c86e18
@ -450,6 +450,16 @@ func TestIsOpPermitted(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Drop the user's permission from cache and expect a permission denied
|
||||
// error.
|
||||
as.rangePermCacheMu.Lock()
|
||||
delete(as.rangePermCache, "foo")
|
||||
as.rangePermCacheMu.Unlock()
|
||||
if err := as.isOpPermitted("foo", as.Revision(), perm.Key, perm.RangeEnd, perm.PermType); err != ErrPermissionDenied {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestGetUser(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user