Skip to content

Commit

Permalink
Add input json files
Browse files Browse the repository at this point in the history
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
  • Loading branch information
ZhaohuiS committed Aug 30, 2022
1 parent 91d4932 commit 6f6803f
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion acl_loader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def incremental_update(self):
namespace_configdb.mod_entry(self.ACL_RULE, key, None)

for key in existing_controlplane_rules:
if operator.eq(self.rules_info[key], self.rules_db_info[key]) == False:
if not operator.eq(self.rules_info[key], self.rules_db_info[key]):
self.configdb.set_entry(self.ACL_RULE, key, self.rules_info[key])
# Program for per-asic namespace corresponding to front asic also if present.
# For control plane ACL it's not needed but to keep all db in sync program everywhere
Expand Down
32 changes: 32 additions & 0 deletions tests/acl_input/incremental_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"acl": {
"acl-sets": {
"acl-set": {
"ntp-acl": {
"acl-entries": {
"acl-entry": {
"1": {
"ip": {
"config": {
"source-ip-address": "20.0.0.12/32"
}
},
"config": {
"sequence-id": 1
},
"actions": {
"config": {
"forwarding-action": "ACCEPT"
}
}
}
}
},
"config": {
"name": "ntp-acl"
}
}
}
}
}
}
32 changes: 32 additions & 0 deletions tests/acl_input/incremental_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"acl": {
"acl-sets": {
"acl-set": {
"ntp-acl": {
"acl-entries": {
"acl-entry": {
"1": {
"ip": {
"config": {
"source-ip-address": "20.0.0.12/32"
}
},
"config": {
"sequence-id": 1
},
"actions": {
"config": {
"forwarding-action": "DROP"
}
}
}
}
},
"config": {
"name": "ntp-acl"
}
}
}
}
}
}

0 comments on commit 6f6803f

Please sign in to comment.