Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ansible/roles/test/tasks/acl/acltb_test_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"ip": {
"config": {
"destination-ip-address": "192.168.0.16/32"
"source-ip-address": "192.168.0.16/32"
}
}
},
Expand Down
29 changes: 29 additions & 0 deletions ansible/roles/test/tasks/acl/acltb_test_rules_deny_all.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"acl": {
"acl-sets": {
"acl-set": {
"dataacl": {
"acl-entries": {
"acl-entry": {
"1": {
"actions": {
"config": {
"forwarding-action": "DROP"
}
},
"config": {
"sequence-id": 1
},
"l2": {
"config": {
"ethertype": "2048"
}
}
}
}
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion ansible/roles/test/tasks/acl/acltb_test_rules_part_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"ip": {
"config": {
"destination-ip-address": "192.168.0.16/32"
"source-ip-address": "192.168.0.16/32"
}
}
},
Expand Down
27 changes: 27 additions & 0 deletions ansible/roles/test/tasks/acltb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- "acltb_test_rules-del.json"
- "acltb_test_rules_part_1.json"
- "acltb_test_rules_part_2.json"
- "acltb_test_rules_deny_all.json"

# Generate file with switch information
- template: src=acltb.j2 dest=/tmp/acltb_switch_info.txt
Expand Down Expand Up @@ -95,6 +96,32 @@
- switch_info=\"/tmp/acltb_switch_info.txt\"
- testbed_type=\"{{ testbed_type }}\"

- name: Clean up ACL rules.
vars:
command_to_run: "acl-loader update full /tmp/acltb_test_rules-del.json"
errors_expected: false
include: roles/test/tasks/run_command_with_log_analyzer.yml

- name: Apply Deny All ACL rules.
vars:
command_to_run: "acl-loader update incremental /tmp/acltb_test_rules_deny_all.json"
errors_expected: false
include: roles/test/tasks/run_command_with_log_analyzer.yml

- name: Run the test
include: ptf_runner.yml
vars:
ptf_test_name: ACL Test
ptf_test_dir: acstests
ptf_test_path: acltb_test.AclTest
ptf_platform: remote
ptf_test_params:
- verbose=True
- router_mac=\"{{ ansible_Ethernet0['macaddress'] }}\"
- switch_info=\"/tmp/acltb_switch_info.txt\"
- testbed_type=\"{{ testbed_type }}\"
- deny_all_rule=True

always:
- name: Clean up ACL rules.
vars:
Expand Down