File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
src/dataprotection/azext_dataprotection/tests/latest Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -297,20 +297,15 @@ def test_dataprotection_backup_instance_update_aks_configuration(test):
297297
298298 # Fetch original BI backupDatasourceParametersList (if any) to allow resetting later
299299 original_bi = test .cmd ('az dataprotection backup-instance show -g "{rg}" --vault-name "{vaultName}" --name "{backupInstanceName}"' ).get_output_in_json ()
300- original_bi_backup_config_json = original_bi ['properties' ]['policyInfo' ]['policyParameters' ].get ('backupDatasourceParametersList' )[0 ]
300+ originalBackupConfig = original_bi ['properties' ]['policyInfo' ]['policyParameters' ].get ('backupDatasourceParametersList' )[0 ]
301301 test .kwargs .update ({
302- 'backupConfig' : original_bi_backup_config_json
302+ 'backupConfig' : originalBackupConfig
303303 })
304304
305- # Generate the AKS backup configuration using the dedicated CLI helper
306- new_backup_config_json = test .cmd ('az dataprotection backup-instance initialize-backupconfig --datasource-type AzureKubernetesService' ).get_output_in_json ()
307-
308- # mutate a visible field to make the change observable
309- new_backup_config_json ['included_namespaces' ] = ["nsA" , "nsB" ]
310- new_backup_config_json ['label_selectors' ] = ["app=web" ]
311- new_backup_config_json ['excluded_resource_types' ] = ["ResourceX" ]
312- new_backup_config_json ['include_cluster_scope_resources' ] = False
313- new_backup_config_json ['snapshot_volumes' ] = False
305+ # Generate the AKS backup configuration with specific values in a single command to make the change observable
306+ new_backup_config_json = test .cmd ('az dataprotection backup-instance initialize-backupconfig --datasource-type AzureKubernetesService '
307+ '--included-namespaces "nsA" "nsB" --label-selectors "app=web" --excluded-resource-types "ResourceX" '
308+ '--include-cluster-scope-resources false --snapshot-volumes false' ).get_output_in_json ()
314309 test .kwargs .update ({
315310 'tempBackupConfig' : new_backup_config_json
316311 })
You can’t perform that action at this time.
0 commit comments