@@ -137,13 +137,13 @@ func TestACLHostsInNetMapTable(t *testing.T) {
137137 ACLs : []policyv1.ACL {
138138 {
139139 Action : "accept" ,
140- Sources : []string {"user1" },
141- Destinations : []string {"user1:*" },
140+ Sources : []string {"user1@ " },
141+ Destinations : []string {"user1@ :*" },
142142 },
143143 {
144144 Action : "accept" ,
145- Sources : []string {"user2" },
146- Destinations : []string {"user2:*" },
145+ Sources : []string {"user2@ " },
146+ Destinations : []string {"user2@ :*" },
147147 },
148148 },
149149 }, want : map [string ]int {
@@ -160,23 +160,23 @@ func TestACLHostsInNetMapTable(t *testing.T) {
160160 ACLs : []policyv1.ACL {
161161 {
162162 Action : "accept" ,
163- Sources : []string {"user1" },
164- Destinations : []string {"user1:22" },
163+ Sources : []string {"user1@ " },
164+ Destinations : []string {"user1@ :22" },
165165 },
166166 {
167167 Action : "accept" ,
168- Sources : []string {"user2" },
169- Destinations : []string {"user2:22" },
168+ Sources : []string {"user2@ " },
169+ Destinations : []string {"user2@ :22" },
170170 },
171171 {
172172 Action : "accept" ,
173- Sources : []string {"user1" },
174- Destinations : []string {"user2:22" },
173+ Sources : []string {"user1@ " },
174+ Destinations : []string {"user2@ :22" },
175175 },
176176 {
177177 Action : "accept" ,
178- Sources : []string {"user2" },
179- Destinations : []string {"user1:22" },
178+ Sources : []string {"user2@ " },
179+ Destinations : []string {"user1@ :22" },
180180 },
181181 },
182182 }, want : map [string ]int {
@@ -194,18 +194,18 @@ func TestACLHostsInNetMapTable(t *testing.T) {
194194 ACLs : []policyv1.ACL {
195195 {
196196 Action : "accept" ,
197- Sources : []string {"user1" },
198- Destinations : []string {"user1:*" },
197+ Sources : []string {"user1@ " },
198+ Destinations : []string {"user1@ :*" },
199199 },
200200 {
201201 Action : "accept" ,
202- Sources : []string {"user2" },
203- Destinations : []string {"user2:*" },
202+ Sources : []string {"user2@ " },
203+ Destinations : []string {"user2@ :*" },
204204 },
205205 {
206206 Action : "accept" ,
207- Sources : []string {"user1" },
208- Destinations : []string {"user2:*" },
207+ Sources : []string {"user1@ " },
208+ Destinations : []string {"user2@ :*" },
209209 },
210210 },
211211 }, want : map [string ]int {
@@ -219,18 +219,18 @@ func TestACLHostsInNetMapTable(t *testing.T) {
219219 ACLs : []policyv1.ACL {
220220 {
221221 Action : "accept" ,
222- Sources : []string {"user1" },
223- Destinations : append ([]string {"user1:*" }, veryLargeDestination ... ),
222+ Sources : []string {"user1@ " },
223+ Destinations : append ([]string {"user1@ :*" }, veryLargeDestination ... ),
224224 },
225225 {
226226 Action : "accept" ,
227- Sources : []string {"user2" },
228- Destinations : append ([]string {"user2:*" }, veryLargeDestination ... ),
227+ Sources : []string {"user2@ " },
228+ Destinations : append ([]string {"user2@ :*" }, veryLargeDestination ... ),
229229 },
230230 {
231231 Action : "accept" ,
232- Sources : []string {"user1" },
233- Destinations : append ([]string {"user2:*" }, veryLargeDestination ... ),
232+ Sources : []string {"user1@ " },
233+ Destinations : append ([]string {"user2@ :*" }, veryLargeDestination ... ),
234234 },
235235 },
236236 }, want : map [string ]int {
@@ -299,8 +299,8 @@ func TestACLAllowUser80Dst(t *testing.T) {
299299 ACLs : []policyv1.ACL {
300300 {
301301 Action : "accept" ,
302- Sources : []string {"user1" },
303- Destinations : []string {"user2:80" },
302+ Sources : []string {"user1@ " },
303+ Destinations : []string {"user2@ :80" },
304304 },
305305 },
306306 },
@@ -351,7 +351,7 @@ func TestACLDenyAllPort80(t *testing.T) {
351351 scenario := aclScenario (t ,
352352 & policyv1.ACLPolicy {
353353 Groups : map [string ][]string {
354- "group:integration-acl-test" : {"user1" , "user2" },
354+ "group:integration-acl-test" : {"user1@ " , "user2@ " },
355355 },
356356 ACLs : []policyv1.ACL {
357357 {
@@ -400,8 +400,8 @@ func TestACLAllowUserDst(t *testing.T) {
400400 ACLs : []policyv1.ACL {
401401 {
402402 Action : "accept" ,
403- Sources : []string {"user1" },
404- Destinations : []string {"user2:*" },
403+ Sources : []string {"user1@ " },
404+ Destinations : []string {"user2@ :*" },
405405 },
406406 },
407407 },
@@ -456,7 +456,7 @@ func TestACLAllowStarDst(t *testing.T) {
456456 ACLs : []policyv1.ACL {
457457 {
458458 Action : "accept" ,
459- Sources : []string {"user1" },
459+ Sources : []string {"user1@ " },
460460 Destinations : []string {"*:*" },
461461 },
462462 },
@@ -912,8 +912,8 @@ func TestACLDevice1CanAccessDevice2(t *testing.T) {
912912 "group" : {
913913 policy : policyv1.ACLPolicy {
914914 Groups : map [string ][]string {
915- "group:one" : {"user1" },
916- "group:two" : {"user2" },
915+ "group:one" : {"user1@ " },
916+ "group:two" : {"user2@ " },
917917 },
918918 ACLs : []policyv1.ACL {
919919 {
@@ -1079,15 +1079,12 @@ func TestPolicyUpdateWhileRunningWithCLIInDatabase(t *testing.T) {
10791079 ACLs : []policyv1.ACL {
10801080 {
10811081 Action : "accept" ,
1082- Sources : []string {"user1" },
1083- Destinations : []string {"user2:*" },
1082+ Sources : []string {"user1@ " },
1083+ Destinations : []string {"user2@ :*" },
10841084 },
10851085 },
10861086 Hosts : policyv1.Hosts {},
10871087 }
1088- if usePolicyV2ForTest {
1089- hsic .RewritePolicyToV2 (& p )
1090- }
10911088
10921089 pBytes , _ := json .Marshal (p )
10931090
0 commit comments