Skip to content
Merged
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
10 changes: 9 additions & 1 deletion ansible/roles/test/tasks/crm/crm_test_acl_counter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
- name: Copy ACL JSON config to switch.
copy: src=roles/test/tasks/crm/acl.json dest=/tmp

- name: Get original "crm_stats_acl_counter_available" counter value
command: docker exec -i database redis-cli -n 2 HGET {{acl_tbl_key}} crm_stats_acl_counter_available
register: out
- set_fact: original_crm_stats_acl_counter_available={{out.stdout}}

- name: Add ACL
command: acl-loader update full /tmp/acl.json
become: yes
Expand Down Expand Up @@ -76,4 +81,7 @@
assert: {that: "{{new_crm_stats_acl_counter_used|int - crm_stats_acl_counter_used|int == 0}}"}

- name: Verify "crm_stats_acl_counter_available" counter was incremented
assert: {that: "{{new_crm_stats_acl_counter_available|int - crm_stats_acl_counter_available|int == 0}}"}
assert: {that: "{{new_crm_stats_acl_counter_available|int - crm_stats_acl_counter_available|int >= 0}}"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that this is different for certain platforms. But we may want this to be counted properly. How about checking the available counter before add, after add and after delete? Essentially the number of resources that was taken during add, the same must be released after delete leaving this check as it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prsunny
I add the test case to check the available counter before add and after delete.
Please review again.


- name: Verify "crm_stats_acl_counter_available" counter was equal to original value
assert: {that: "{{original_crm_stats_acl_counter_available|int - new_crm_stats_acl_counter_available|int == 0}}"}