Skip to content

[pfcwd]: add docker exec to avoid tty error #470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2018
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
32 changes: 16 additions & 16 deletions ansible/roles/test/tasks/pfc_wd/functional_test/functional_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
delegate_to: "{{ ptf_host }}"

- name: Get queue OID
shell: "redis-cli -n 2 HGET COUNTERS_QUEUE_NAME_MAP {{ pfc_wd_test_port }}:{{ pfc_queue_index }}"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS_QUEUE_NAME_MAP {{ pfc_wd_test_port }}:{{ pfc_queue_index }}"
register: queue_oid

# Verify PFCWD detection when queue buffer is not empty and proper function of drop action
Expand Down Expand Up @@ -101,11 +101,11 @@
include: roles/test/files/tools/loganalyzer/loganalyzer_end.yml

- name: Get PFC_WD_QUEUE_STATS_TX_DROPPED_PACKETS before test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_DROPPED_PACKETS"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_DROPPED_PACKETS"
register: pfc_wd_tx_drop_before

- name: Get PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS before test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS"
register: pfc_wd_rx_drop_before

- name: "check egress drop, tx port {{pfc_wd_test_port}}"
Expand Down Expand Up @@ -222,7 +222,7 @@
when: "{{ pfc_wd_tx_drop_last.stdout | int != pfc_wd_test_pkt_count }}"

- name: Get PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS after test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS"
register: pfc_wd_rx_drop_after

- name: Verify rx drop counter
Expand All @@ -231,7 +231,7 @@
when: "{{ pfc_wd_rx_drop_after.stdout | int - pfc_wd_rx_drop_before.stdout | int != pfc_wd_test_pkt_count }}"

- name: Get PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS_LAST after test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS_LAST"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS_LAST"
register: pfc_wd_rx_drop_last

- name: Verify last rx drop counter
Expand Down Expand Up @@ -262,11 +262,11 @@
include: roles/test/tasks/run_command_with_log_analyzer.yml

- name: Get PFC_WD_QUEUE_STATS_TX_DROPPED_PACKETS before test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_DROPPED_PACKETS"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_DROPPED_PACKETS"
register: pfc_wd_tx_drop_before

- name: Get PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS before test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS"
register: pfc_wd_rx_drop_before

- set_fact:
Expand Down Expand Up @@ -387,7 +387,7 @@
include: roles/test/files/tools/loganalyzer/loganalyzer_end.yml

- name: Get PFC_WD_QUEUE_STATS_TX_DROPPED_PACKETS after test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_DROPPED_PACKETS"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_DROPPED_PACKETS"
register: pfc_wd_tx_drop_after

- name: Verify tx drop counter
Expand All @@ -405,7 +405,7 @@
when: "{{ pfc_wd_tx_drop_last.stdout | int != pfc_wd_test_pkt_count }}"

- name: Get PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS after test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS"
register: pfc_wd_rx_drop_after

- name: Verify rx drop counter
Expand All @@ -414,7 +414,7 @@
when: "{{ pfc_wd_rx_drop_after.stdout | int - pfc_wd_rx_drop_before.stdout | int != pfc_wd_test_pkt_count }}"

- name: Get PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS_LAST after test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS_LAST"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_DROPPED_PACKETS_LAST"
register: pfc_wd_rx_drop_last

- name: Verify last rx drop counter
Expand Down Expand Up @@ -445,11 +445,11 @@
include: roles/test/tasks/run_command_with_log_analyzer.yml

- name: Get PFC_WD_QUEUE_STATS_TX_PACKETS before test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_PACKETS"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_PACKETS"
register: pfc_wd_tx_before

- name: Get PFC_WD_QUEUE_STATS_RX_PACKETS before test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_PACKETS"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_PACKETS"
register: pfc_wd_rx_before

- set_fact:
Expand Down Expand Up @@ -538,7 +538,7 @@
include: roles/test/files/tools/loganalyzer/loganalyzer_end.yml

- name: Get PFC_WD_QUEUE_STATS_TX_PACKETS after test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_PACKETS"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_PACKETS"
register: pfc_wd_tx_after

- name: Verify tx counter
Expand All @@ -547,7 +547,7 @@
when: "{{ pfc_wd_tx_after.stdout | int - pfc_wd_tx_before.stdout | int != pfc_wd_test_pkt_count }}"

- name: Get PFC_WD_QUEUE_STATS_TX_PACKETS_LAST after test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_PACKETS_LAST"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_TX_PACKETS_LAST"
register: pfc_wd_tx_last

- name: Verify last tx counter
Expand All @@ -556,7 +556,7 @@
when: "{{ pfc_wd_tx_last.stdout | int != pfc_wd_test_pkt_count }}"

- name: Get PFC_WD_QUEUE_STATS_RX_PACKETS after test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_PACKETS"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_PACKETS"
register: pfc_wd_rx_after

- name: Verify rx counter
Expand All @@ -565,7 +565,7 @@
when: "{{ pfc_wd_rx_after.stdout | int - pfc_wd_rx_before.stdout | int != pfc_wd_test_pkt_count }}"

- name: Get PFC_WD_QUEUE_STATS_RX_PACKETS_LAST after test
shell: "redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_PACKETS_LAST"
shell: "docker exec -i database redis-cli -n 2 HGET COUNTERS:{{ queue_oid.stdout }} PFC_WD_QUEUE_STATS_RX_PACKETS_LAST"
register: pfc_wd_rx_last

- name: Verify last rx counter
Expand Down