-
Notifications
You must be signed in to change notification settings - Fork 55
dcnm_bootflash: IT: update switchX to switch_X #584
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,17 +15,17 @@ | |
| # SETUP | ||
| ################################################################################ | ||
| # | ||
| # 1. Two switches are required for this test; switch1 and switch2. | ||
| # 1. Two switches are required for this test; switch_1 and switch_2. | ||
| # 2. Files must be created on bootflash manually as NDFC does not | ||
| # provide a quick way to create files on bootflash. To create | ||
| # the files manually, we have two choices. | ||
| # A. Do the following directly on the switches: | ||
| # - On switch1, create a file named foo.txt | ||
| # - On switch_1, create files | ||
| # switch# echo 1 > air.ndfc_ut | ||
| # switch# echo 1 > earth.ndfc_ut | ||
| # switch# echo 1 > fire.ndfc_ut | ||
| # switch# echo 1 > water.ndfc_ut | ||
| # - On switch2, create a file named bar.txt | ||
| # - On switch_2, create files | ||
| # switch# echo 1 > black.ndfc_ut | ||
| # switch# echo 1 > blue.ndfc_ut | ||
| # switch# echo 1 > green.ndfc_ut | ||
|
|
@@ -34,7 +34,7 @@ | |
| # ./playbooks/dcnm_bootflash/create_files.yaml | ||
| # This uses the cisco.nxos.nxos_command module to create the files. | ||
| # See the example inventory file in playbooks/roles/dcnm_bootflash/dcnm_hosts.yaml | ||
| # which includes inventory entries for switch1 and switch2 and change to | ||
| # which includes inventory entries for switch_1 and switch_2 and change to | ||
| # match your setup. | ||
| # TEST | ||
| # 3. Ensure dcnm_tests.yaml has uncommented the following: | ||
|
|
@@ -201,8 +201,8 @@ | |
| - filepath: "{{ wildcard_filepath }}" | ||
| supervisor: active | ||
| switches: | ||
| - ip_address: "{{ switch1 }}" | ||
| - ip_address: "{{ switch2 }}" | ||
| - ip_address: "{{ switch_1 }}" | ||
| - ip_address: "{{ switch_2 }}" | ||
| register: result | ||
|
|
||
| - debug: | ||
|
|
@@ -219,12 +219,12 @@ | |
|
|
||
| - assert: | ||
| that: | ||
| - result.diff[0][switch1][0].filepath == switch1_filepath1 | ||
| - result.diff[0][switch1][1].filepath == switch1_filepath2 | ||
| - result.diff[0][switch1][2].filepath == switch1_filepath3 | ||
| - result.diff[0][switch2][0].filepath == switch2_filepath1 | ||
| - result.diff[0][switch2][1].filepath == switch2_filepath2 | ||
| - result.diff[0][switch2][2].filepath == switch2_filepath3 | ||
| - result.diff[0][switch_1][0].filepath == switch1_filepath1 | ||
| - result.diff[0][switch_1][1].filepath == switch1_filepath2 | ||
| - result.diff[0][switch_1][2].filepath == switch1_filepath3 | ||
| - result.diff[0][switch_2][0].filepath == switch2_filepath1 | ||
| - result.diff[0][switch_2][1].filepath == switch2_filepath2 | ||
| - result.diff[0][switch_2][2].filepath == switch2_filepath3 | ||
|
Comment on lines
+222
to
+227
|
||
| - result.changed == true | ||
| - result.failed == false | ||
| - (result.diff | length) == 1 | ||
|
|
@@ -293,8 +293,8 @@ | |
| - result.changed == false | ||
| - result.failed == false | ||
| - (result.diff | length) == 1 | ||
| - switch1 not in result.diff[0] | ||
| - switch2 not in result.diff[0] | ||
| - switch_1 not in result.diff[0] | ||
| - switch_2 not in result.diff[0] | ||
| - result.diff[0].sequence_number == 1 | ||
| - (result.metadata | length) == 1 | ||
| - result.metadata[0].action == "bootflash_delete" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,17 +9,17 @@ | |
| # SETUP | ||
| ################################################################################ | ||
| # | ||
| # 1. Two switches are required for this test; switch1 and switch2. | ||
| # 1. Two switches are required for this test; switch_1 and switch_2. | ||
| # 2. Files must be created on bootflash manually as NDFC does not | ||
| # provide a quick way to create files on bootflash. To create | ||
| # the files manually, we have two choices. | ||
| # A. Do the following directly on the switches: | ||
| # - On switch1, create a file named foo.txt | ||
| # - On switch_1, create a file named foo.txt | ||
| # switch# echo 1 > air.ndfc_ut | ||
| # switch# echo 1 > earth.ndfc_ut | ||
| # switch# echo 1 > fire.ndfc_ut | ||
| # switch# echo 1 > water.ndfc_ut | ||
| # - On switch2, create a file named bar.txt | ||
| # - On switch_2, create a file named bar.txt | ||
| # switch# echo 1 > black.ndfc_ut | ||
| # switch# echo 1 > blue.ndfc_ut | ||
| # switch# echo 1 > green.ndfc_ut | ||
|
|
@@ -28,7 +28,7 @@ | |
| # ./playbooks/dcnm_bootflash/create_files.yaml | ||
| # This uses the cisco.nxos.nxos_command module to create the files. | ||
| # See the example inventory file in playbooks/roles/dcnm_bootflash/dcnm_hosts.yaml | ||
| # which includes inventory entries for switch1 and switch2 and change to | ||
| # which includes inventory entries for switch_1 and switch_2 and change to | ||
| # match your setup. | ||
| # TEST | ||
| # 3. Ensure dcnm_tests.yaml has uncommented the following: | ||
|
|
@@ -219,15 +219,15 @@ | |
| state: query | ||
| config: | ||
| switches: | ||
| - ip_address: "{{ switch1 }}" | ||
| - ip_address: "{{ switch_1 }}" | ||
| targets: | ||
| - filepath: "bootflash:/{{ switch1_file2 }}" | ||
| supervisor: active | ||
| - filepath: "bootflash:/{{ switch1_file3 }}" | ||
| supervisor: active | ||
| - filepath: "bootflash:/{{ switch1_file4 }}" | ||
|
Comment on lines
224
to
228
|
||
| supervisor: active | ||
| - ip_address: "{{ switch2 }}" | ||
| - ip_address: "{{ switch_2 }}" | ||
| targets: | ||
| - filepath: "bootflash:/{{ switch2_file2 }}" | ||
| supervisor: active | ||
|
|
@@ -251,29 +251,29 @@ | |
|
|
||
| - assert: | ||
| that: | ||
| - result.diff[0][switch1][0].filepath == switch1_filepath1 | ||
| - result.diff[0][switch1][1].filepath == switch1_filepath2 | ||
| - result.diff[0][switch1][2].filepath == switch1_filepath3 | ||
| - result.diff[0][switch2][0].filepath == switch2_filepath1 | ||
| - result.diff[0][switch2][1].filepath == switch2_filepath2 | ||
| - result.diff[0][switch2][2].filepath == switch2_filepath3 | ||
| - result.diff[0][switch_1][0].filepath == switch1_filepath1 | ||
| - result.diff[0][switch_1][1].filepath == switch1_filepath2 | ||
| - result.diff[0][switch_1][2].filepath == switch1_filepath3 | ||
| - result.diff[0][switch_2][0].filepath == switch2_filepath1 | ||
| - result.diff[0][switch_2][1].filepath == switch2_filepath2 | ||
| - result.diff[0][switch_2][2].filepath == switch2_filepath3 | ||
|
Comment on lines
+254
to
+259
|
||
| - result.changed == false | ||
| - result.failed == false | ||
| - (result.diff | length) == 1 | ||
| - (result.response | length) == 1 | ||
| - result.response[0][switch1].RETURN_CODE == 200 | ||
| - result.response[0][switch2].RETURN_CODE == 200 | ||
| - result.response[0][switch1].MESSAGE == "OK" | ||
| - result.response[0][switch2].MESSAGE == "OK" | ||
| - result.response[0][switch1].METHOD == "GET" | ||
| - result.response[0][switch2].METHOD == "GET" | ||
| - result.response[0][switch_1].RETURN_CODE == 200 | ||
| - result.response[0][switch_2].RETURN_CODE == 200 | ||
| - result.response[0][switch_1].MESSAGE == "OK" | ||
| - result.response[0][switch_2].MESSAGE == "OK" | ||
| - result.response[0][switch_1].METHOD == "GET" | ||
| - result.response[0][switch_2].METHOD == "GET" | ||
| - (result.metadata | length) == 1 | ||
| - result.metadata[0].action == "bootflash_info" | ||
| - result.metadata[0].check_mode == false | ||
| - result.metadata[0].sequence_number == 1 | ||
| - result.metadata[0].state == "query" | ||
| - (result.result | length) == 1 | ||
| - result.result[0][switch1].found == true | ||
| - result.result[0][switch2].found == true | ||
| - result.result[0][switch1].success == true | ||
| - result.result[0][switch2].success == true | ||
| - result.result[0][switch_1].found == true | ||
| - result.result[0][switch_2].found == true | ||
| - result.result[0][switch_1].success == true | ||
| - result.result[0][switch_2].success == true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,17 +9,17 @@ | |
| # SETUP | ||
| ################################################################################ | ||
| # | ||
| # 1. Two switches are required for this test; switch1 and switch2. | ||
| # 1. Two switches are required for this test; switch_1 and switch_2. | ||
| # 2. Files must be created on bootflash manually as NDFC does not | ||
| # provide a quick way to create files on bootflash. To create | ||
| # the files manually, we have two choices. | ||
| # A. Do the following directly on the switches: | ||
| # - On switch1, create a file named foo.txt | ||
| # - On switch_1, create a file named foo.txt | ||
| # switch# echo 1 > air.ndfc_ut | ||
| # switch# echo 1 > earth.ndfc_ut | ||
| # switch# echo 1 > fire.ndfc_ut | ||
| # switch# echo 1 > water.ndfc_ut | ||
| # - On switch2, create a file named bar.txt | ||
| # - On switch_2, create a file named bar.txt | ||
| # switch# echo 1 > black.ndfc_ut | ||
| # switch# echo 1 > blue.ndfc_ut | ||
| # switch# echo 1 > green.ndfc_ut | ||
|
|
@@ -28,7 +28,7 @@ | |
| # ./playbooks/dcnm_bootflash/create_files.yaml | ||
| # This uses the cisco.nxos.nxos_command module to create the files. | ||
| # See the example inventory file in playbooks/roles/dcnm_bootflash/dcnm_hosts.yaml | ||
| # which includes inventory entries for switch1 and switch2 and change to | ||
| # which includes inventory entries for switch_1 and switch_2 and change to | ||
| # match your setup. | ||
| # TEST | ||
| # 3. Ensure dcnm_tests.yaml has uncommented the following: | ||
|
|
@@ -222,8 +222,8 @@ | |
| - filepath: "{{ wildcard_filepath }}" | ||
| supervisor: active | ||
| switches: | ||
| - ip_address: "{{ switch1 }}" | ||
| - ip_address: "{{ switch2 }}" | ||
| - ip_address: "{{ switch_1 }}" | ||
| - ip_address: "{{ switch_2 }}" | ||
| register: result | ||
|
|
||
| - debug: | ||
|
|
@@ -240,30 +240,30 @@ | |
|
|
||
| - assert: | ||
| that: | ||
| - result.diff[0][switch1][0].filepath == switch1_filepath1 | ||
| - result.diff[0][switch1][1].filepath == switch1_filepath2 | ||
| - result.diff[0][switch1][2].filepath == switch1_filepath3 | ||
| - result.diff[0][switch2][0].filepath == switch2_filepath1 | ||
| - result.diff[0][switch2][1].filepath == switch2_filepath2 | ||
| - result.diff[0][switch2][2].filepath == switch2_filepath3 | ||
| - result.diff[0][switch_1][0].filepath == switch1_filepath1 | ||
| - result.diff[0][switch_1][1].filepath == switch1_filepath2 | ||
| - result.diff[0][switch_1][2].filepath == switch1_filepath3 | ||
| - result.diff[0][switch_2][0].filepath == switch2_filepath1 | ||
| - result.diff[0][switch_2][1].filepath == switch2_filepath2 | ||
| - result.diff[0][switch_2][2].filepath == switch2_filepath3 | ||
|
Comment on lines
+243
to
+248
|
||
| - result.changed == false | ||
| - result.failed == false | ||
| - (result.diff | length) == 1 | ||
| - (result.diff[0] | length) == 3 | ||
| - (result.response | length) == 1 | ||
| - result.response[0][switch1].RETURN_CODE == 200 | ||
| - result.response[0][switch2].RETURN_CODE == 200 | ||
| - result.response[0][switch1].MESSAGE == "OK" | ||
| - result.response[0][switch2].MESSAGE == "OK" | ||
| - result.response[0][switch1].METHOD == "GET" | ||
| - result.response[0][switch2].METHOD == "GET" | ||
| - result.response[0][switch_1].RETURN_CODE == 200 | ||
| - result.response[0][switch_2].RETURN_CODE == 200 | ||
| - result.response[0][switch_1].MESSAGE == "OK" | ||
| - result.response[0][switch_2].MESSAGE == "OK" | ||
| - result.response[0][switch_1].METHOD == "GET" | ||
| - result.response[0][switch_2].METHOD == "GET" | ||
| - (result.metadata | length) == 1 | ||
| - result.metadata[0].action == "bootflash_info" | ||
| - result.metadata[0].check_mode == false | ||
| - result.metadata[0].sequence_number == 1 | ||
| - result.metadata[0].state == "query" | ||
| - (result.result | length) == 1 | ||
| - result.result[0][switch1].found == true | ||
| - result.result[0][switch2].found == true | ||
| - result.result[0][switch1].success == true | ||
| - result.result[0][switch2].success == true | ||
| - result.result[0][switch_1].found == true | ||
| - result.result[0][switch_2].found == true | ||
| - result.result[0][switch_1].success == true | ||
| - result.result[0][switch_2].success == true | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent variable naming: While the dictionary keys have been correctly updated to
switch_1andswitch_2, the comparison variables still use the old naming convention (switch1_filepath1,switch1_filepath2, etc.). For consistency with the standardized naming, consider updating these toswitch_1_filepath1,switch_1_filepath2, etc. This would also require updating the variable definitions indefaults/main.yamland theset_facttask above.