-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed sonar in changelog.yaml * Fixed security hotspots * FIxed sonar issues * Fixed sonar issues for Integration tests * Fixed space errors * SOnar fixes * Sanity fixed * Fixing sonar * Fixing sonar idrac_certificate * Minor change --------- Co-authored-by: Kritika-Bhateja-03 <[email protected]> Co-authored-by: Rajshekar P <[email protected]> Co-authored-by: Kritika-Bhateja-03 <[email protected]>
- Loading branch information
1 parent
6ed1483
commit 43e633b
Showing
23 changed files
with
221 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
scenario: | ||
test_sequence: | ||
- dependency | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,10 @@ | |
|
||
- name: Get all storage controller ids. | ||
ansible.builtin.set_fact: | ||
storage_ids_list: "{{ idrac_gather_facts_controllers_result.json.Members | map('dict2items') | flatten | map(attribute='value') }}" | ||
storage_ids_list: | ||
"{{ idrac_gather_facts_controllers_result.json.Members | | ||
map('dict2items') | flatten | map(attribute='value') }}" | ||
when: idrac_gather_facts_controllers_result.json.Members is defined | ||
|
||
- name: Get physical disk information using API. | ||
ansible.builtin.uri: | ||
|
@@ -52,17 +55,25 @@ | |
loop: "{{ storage_ids_list }}" | ||
no_log: true | ||
register: idrac_gather_facts_disk_result | ||
when: storage_ids_list is defined | ||
|
||
- name: Count the number of drives in drives_result.results | ||
ansible.builtin.set_fact: | ||
drives_count: "{{ idrac_gather_facts_disk_result.results | map(attribute='json.drives') | list | length }}" | ||
drives_count: "{{ idrac_gather_facts_disk_result.results | | ||
map(attribute='json.drives') | list | length }}" | ||
when: idrac_gather_facts_disk_result.results is defined | ||
|
||
- name: Set Physical Disk facts | ||
ansible.builtin.set_fact: | ||
api_response: | ||
"{{ idrac_gather_facts_disk_result.results | selectattr('json', 'defined') | map(attribute='json') | selectattr('Drives', 'defined') | | ||
map(attribute='Drives') | flatten | ansible.utils.remove_keys(target=['@odata.context', '@odata.id', '@odata.type', | ||
'Actions', 'Assembly', 'Links', 'DellDriveSMARTAttributes', 'DellNVMeSMARTAttributes', '[email protected]']) }}" | ||
"{{ idrac_gather_facts_disk_result.results | | ||
selectattr('json', 'defined') | map(attribute='json') | | ||
selectattr('Drives', 'defined') | map(attribute='Drives') | | ||
flatten | ansible.utils.remove_keys(target=['@odata.context', | ||
'@odata.id', '@odata.type', 'Actions', 'Assembly', 'Links', | ||
'DellDriveSMARTAttributes', 'DellNVMeSMARTAttributes', | ||
'[email protected]']) }}" | ||
when: idrac_gather_facts_disk_result.results is defined | ||
|
||
- name: Gather Facts for the Physical Disk component | ||
ansible.builtin.include_role: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
--- | ||
- name: Get Thermal Metrics information. | ||
ansible.builtin.uri: | ||
url: "https://{{ hostname }}{{ api_chassis }}/ThermalSubsystem/ThermalMetrics" | ||
url: | ||
"https://{{ hostname }}{{ api_chassis }}/ThermalSubsystem/ThermalMetrics" | ||
validate_certs: "{{ validate_certs }}" | ||
method: "{{ idrac_gather_facts_uri_method }}" | ||
user: "{{ username }}" | ||
|
@@ -16,19 +17,24 @@ | |
- name: Set Thermal Metrics facts | ||
ansible.builtin.set_fact: | ||
api_thermal_metrics: "{{ response_thermal_metrics.json | | ||
ansible.utils.remove_keys(target=['@odata.context', '@odata.type', '@odata.id', 'DataSourceUri', '[email protected]']) }}" | ||
ansible.utils.remove_keys(target=['@odata.context', '@odata.type', | ||
'@odata.id', 'DataSourceUri', | ||
'[email protected]']) }}" | ||
when: response_thermal_metrics is defined | ||
|
||
- name: Assert thermal metrics | ||
ansible.builtin.assert: | ||
that: | ||
- "((api_thermal_metrics | length == 0) and (thermal_metrics | length == 0))" | ||
- "((api_thermal_metrics | length == 0) and | ||
(thermal_metrics | length == 0))" | ||
fail_msg: "The response from the role does not match" | ||
success_msg: "The response from the role matches" | ||
when: api_thermal_metrics| length == 0 | ||
|
||
- name: Check whether output differs | ||
ansible.builtin.set_fact: | ||
result_diff: "{{ thermal_metrics | symmetric_difference(api_thermal_metrics) }}" | ||
result_diff: "{{ thermal_metrics | | ||
symmetric_difference(api_thermal_metrics) }}" | ||
when: api_thermal_metrics | length > 0 | ||
|
||
- name: Assert the differences in List | ||
|
Oops, something went wrong.