Skip to content
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

[logAnalyzer] Fix the issue that variables are not overridden as expected #844

Merged
merged 1 commit into from
Mar 28, 2019
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Execute ping and check the log.
#-----------------------------------------

- name: Get an unique timestamp to feed to testname_unique
- name: Initialize some variables for loganalyzer
set_fact:
unique_timestamp: "{{ lookup('pipe','date +%Y-%m-%d-%H:%M:%S') }}"
- include_vars: "vars/run_ping_test_vars.yml"
testname_unique: "{{ testname }}.{{ lookup('pipe','date +%Y-%m-%d-%H:%M:%S') }}"
- set_fact:
test_out_dir: "{{ out_dir }}/{{ testname_unique }}"
summary_file: "summary.loganalysis.{{ testname_unique }}.log"
result_file: "result.loganalysis.{{ testname_unique }}.log"

- name: Start log analyser
include: roles/test/files/tools/loganalyzer/loganalyzer_init.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Send some TCP packets.
#-----------------------------------------

- name: Get an unique timestamp to feed to testname_unique
- name: Initialize some variables for loganalyzer
set_fact:
unique_timestamp: "{{ lookup('pipe','date +%Y-%m-%d-%H:%M:%S') }}"
- include_vars: "vars/run_ptf_test_vars.yml"
testname_unique: "{{ testname }}.{{ lookup('pipe','date +%Y-%m-%d-%H:%M:%S') }}"
- set_fact:
test_out_dir: "{{ out_dir }}/{{ testname_unique }}"
summary_file: "summary.loganalysis.{{ testname_unique }}.log"
result_file: "result.loganalysis.{{ testname_unique }}.log"

- block:
- name: Execute ping from host to switch to validate link
Expand Down
13 changes: 10 additions & 3 deletions ansible/roles/test/tasks/run_command_with_log_analyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@
# 3) Run cleanup if needed.
#-----------------------------------------

- name: Get an unique timestamp to feed to testname_unique
- name: Initialize some variables for loganalyzer
set_fact:
unique_timestamp: "{{lookup('pipe','date +%Y-%m-%d-%H:%M:%S')}}"
- include_vars: "vars/run_config_test_vars.yml"
testname_unique: "{{ testname }}.{{ lookup('pipe','date +%Y-%m-%d-%H:%M:%S') }}"
- set_fact:
test_out_dir: "{{ out_dir }}/{{ testname_unique }}"
loganalyzer_init: roles/test/files/tools/loganalyzer/loganalyzer_init.yml
loganalyzer_analyze: roles/test/files/tools/loganalyzer/loganalyzer_analyze.yml
match_file: loganalyzer_common_match.txt
ignore_file: loganalyzer_common_ignore.txt
summary_file: summary.loganalysis.{{ testname_unique }}.log
result_file: result.loganalysis.{{ testname_unique }}.log

- block:
- name: Initialize loganalizer. Put start marker to log file.
Expand Down
13 changes: 10 additions & 3 deletions ansible/roles/test/tasks/run_loganalyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@
# or analyze-phase of loganalyzer.
#-----------------------------------------

- name: Get an unique timestamp to feed to testname_unique
- name: Initialize some variables for loganalyzer
set_fact:
unique_timestamp: "{{lookup('pipe','date +%Y-%m-%d-%H:%M:%S')}}"
- include_vars: "vars/run_loganalyzer_vars.yml"
testname_unique: "{{ testname }}.{{ lookup('pipe','date +%Y-%m-%d-%H:%M:%S') }}"
- set_fact:
test_out_dir: "{{ out_dir }}/{{ testname_unique }}"
loganalyzer_init: roles/test/files/tools/loganalyzer/loganalyzer_init.yml
loganalyzer_analyze: roles/test/files/tools/loganalyzer/loganalyzer_analyze.yml
match_file: loganalyzer_common_match.txt
ignore_file: loganalyzer_common_ignore.txt
summary_file: summary.loganalysis.{{ testname_unique }}.log
result_file: result.loganalysis.{{ testname_unique }}.log

- name: Initialize loganalizer. Put start marker to log file.
include: "{{ loganalyzer_init }}"
Expand Down
13 changes: 0 additions & 13 deletions ansible/vars/run_config_test_vars.yml

This file was deleted.

15 changes: 0 additions & 15 deletions ansible/vars/run_loganalyzer_vars.yml

This file was deleted.

7 changes: 0 additions & 7 deletions ansible/vars/run_ping_test_vars.yml

This file was deleted.

7 changes: 0 additions & 7 deletions ansible/vars/run_ptf_test_vars.yml

This file was deleted.