(t *testing.T)
| 86 | } |
| 87 | |
| 88 | func TestSyncedEnforcerSelfAddPolicy(t *testing.T) { |
| 89 | for i := 0; i < 10; i++ { |
| 90 | e, _ := NewSyncedEnforcer("examples/basic_model.conf", "examples/basic_policy.csv") |
| 91 | go func() { _, _ = e.SelfAddPolicy("p", "p", []string{"user1", "data1", "read"}) }() |
| 92 | go func() { _, _ = e.SelfAddPolicy("p", "p", []string{"user2", "data2", "read"}) }() |
| 93 | go func() { _, _ = e.SelfAddPolicy("p", "p", []string{"user3", "data3", "read"}) }() |
| 94 | go func() { _, _ = e.SelfAddPolicy("p", "p", []string{"user4", "data4", "read"}) }() |
| 95 | go func() { _, _ = e.SelfAddPolicy("p", "p", []string{"user5", "data5", "read"}) }() |
| 96 | go func() { _, _ = e.SelfAddPolicy("p", "p", []string{"user6", "data6", "read"}) }() |
| 97 | time.Sleep(100 * time.Millisecond) |
| 98 | |
| 99 | testSyncedEnforcerGetPolicy(t, e, [][]string{ |
| 100 | {"alice", "data1", "read"}, |
| 101 | {"bob", "data2", "write"}, |
| 102 | {"user1", "data1", "read"}, |
| 103 | {"user2", "data2", "read"}, |
| 104 | {"user3", "data3", "read"}, |
| 105 | {"user4", "data4", "read"}, |
| 106 | {"user5", "data5", "read"}, |
| 107 | {"user6", "data6", "read"}, |
| 108 | }) |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | func TestSyncedEnforcerSelfAddPolicies(t *testing.T) { |
| 113 | for i := 0; i < 10; i++ { |
nothing calls this directly
no test coverage detected
searching dependent graphs…