-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[SQL] upgrade azure-mgmt-sql to 0.20.0 #14728
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
Changes from all commits
00b9235
ab16df0
03436bc
7d98b1f
06f6ec5
adab2d2
c7b9f98
18e8b8d
afa02ec
18a4757
1eb5074
7d5e0b4
423c86a
252dd60
7607f85
69d38f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3440,9 +3440,9 @@ def test_sql_managed_db_short_retention(self, resource_group, resource_group_loc | |
| resource_prefix = 'MIDBShortTermRetention' | ||
|
|
||
| self.kwargs.update({ | ||
| 'loc': resource_group_location, | ||
| 'vnet_name': 'vcCliTestVnet', | ||
| 'subnet_name': 'vcCliTestSubnet', | ||
| 'loc': "westeurope", | ||
| 'vnet_name': 'MIVirtualNetwork', | ||
| 'subnet_name': 'ManagedInsanceSubnet', | ||
| 'route_table_name': 'vcCliTestRouteTable', | ||
| 'route_name_internet': 'vcCliTestRouteInternet', | ||
| 'route_name_vnetlocal': 'vcCliTestRouteVnetLoc', | ||
|
|
@@ -3459,19 +3459,12 @@ def test_sql_managed_db_short_retention(self, resource_group, resource_group_loc | |
| 'collation': "Serbian_Cyrillic_100_CS_AS", | ||
| 'proxy_override': "Proxy", | ||
| 'retention_days_inc': 14, | ||
| 'retention_days_dec': 7 | ||
| 'retention_days_dec': 7, | ||
| 'rg': 'v-urmila' | ||
| }) | ||
|
|
||
| # Create and prepare VNet and subnet for new virtual cluster | ||
| self.cmd('network route-table create -g {rg} -n {route_table_name}') | ||
| self.cmd('network route-table route create -g {rg} --route-table-name {route_table_name} -n {route_name_internet} --next-hop-type Internet --address-prefix 0.0.0.0/0') | ||
| self.cmd('network route-table route create -g {rg} --route-table-name {route_table_name} -n {route_name_vnetlocal} --next-hop-type VnetLocal --address-prefix 10.0.0.0/24') | ||
| self.cmd('network vnet create -g {rg} -n {vnet_name} --location {loc} --address-prefix 10.0.0.0/16') | ||
| self.cmd('network vnet subnet create -g {rg} --vnet-name {vnet_name} -n {subnet_name} --address-prefix 10.0.0.0/24 --route-table {route_table_name}') | ||
| subnet = self.cmd('network vnet subnet show -g {rg} --vnet-name {vnet_name} -n {subnet_name}').get_output_in_json() | ||
|
|
||
| self.kwargs.update({ | ||
| 'subnet_id': subnet['id'] | ||
| 'subnet_id': '/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/v-urmila/providers/Microsoft.Network/virtualNetworks/MIVirtualNetwork/subnets/ManagedInsanceSubnet' | ||
| }) | ||
|
|
||
| # create sql managed_instance | ||
|
|
@@ -3549,10 +3542,10 @@ def test_sql_managed_db_long_term_retention( | |
| self): | ||
|
|
||
| self.kwargs.update({ | ||
| 'rg': 'clitestxj6awmetud', | ||
| 'loc': 'westus', | ||
| 'managed_instance_name': 'ayang-ltr-mi', | ||
| 'database_name': 'test-4', | ||
| 'rg': 'v-urmila', | ||
| 'loc': 'westeurope', | ||
| 'managed_instance_name': 'v-urmila-mi-test', | ||
| 'database_name': 'ReportServer', | ||
| 'weekly_retention': 'P1W', | ||
| 'monthly_retention': 'P1M', | ||
| 'yearly_retention': 'P2M', | ||
|
|
@@ -3608,13 +3601,13 @@ def test_sql_managed_db_long_term_retention( | |
| self.cmd( | ||
| 'sql midb ltr-backup list -l {loc} --mi {managed_instance_name} -d {database_name} -g {rg}', | ||
| checks=[ | ||
| self.check('length(@)', 1)]) | ||
| self.check('length(@)', 2)]) | ||
|
|
||
| # without resource group | ||
| self.cmd( | ||
| 'sql midb ltr-backup list -l {loc} --mi {managed_instance_name} -d {database_name}', | ||
| checks=[ | ||
| self.check('length(@)', 1)]) | ||
| self.check('length(@)', 2)]) | ||
|
|
||
| # setup for test show long term retention backup | ||
| backup = self.cmd( | ||
|
|
@@ -3644,7 +3637,7 @@ def test_sql_managed_db_long_term_retention( | |
|
|
||
| # test restore managed database from LTR backup | ||
| self.kwargs.update({ | ||
| 'dest_database_name': 'cli-restore-dest' | ||
| 'dest_database_name': 'cli-restore-ltr-backup-test' | ||
| }) | ||
|
|
||
| self.cmd( | ||
|
|
@@ -3665,9 +3658,9 @@ def test_sql_managed_deleted_db_restore(self, resource_group, resource_group_loc | |
| resource_prefix = 'MIRestoreDeletedDB' | ||
|
|
||
| self.kwargs.update({ | ||
| 'loc': resource_group_location, | ||
| 'vnet_name': 'vcCliTestVnet', | ||
| 'subnet_name': 'vcCliTestSubnet', | ||
| 'loc': "westeurope", | ||
| 'vnet_name': 'MIVirtualNetwork', | ||
| 'subnet_name': 'ManagedInsanceSubnet', | ||
| 'route_table_name': 'vcCliTestRouteTable', | ||
| 'route_name_internet': 'vcCliTestRouteInternet', | ||
| 'route_name_vnetlocal': 'vcCliTestRouteVnetLoc', | ||
|
|
@@ -3685,19 +3678,12 @@ def test_sql_managed_deleted_db_restore(self, resource_group, resource_group_loc | |
| 'collation': "Serbian_Cyrillic_100_CS_AS", | ||
| 'proxy_override': "Proxy", | ||
| 'retention_days_inc': 14, | ||
| 'retention_days_dec': 7 | ||
| 'retention_days_dec': 7, | ||
| 'rg': 'v-urmila' | ||
| }) | ||
|
|
||
| # Create and prepare VNet and subnet for new virtual cluster | ||
| self.cmd('network route-table create -g {rg} -n {route_table_name}') | ||
| self.cmd('network route-table route create -g {rg} --route-table-name {route_table_name} -n {route_name_internet} --next-hop-type Internet --address-prefix 0.0.0.0/0') | ||
| self.cmd('network route-table route create -g {rg} --route-table-name {route_table_name} -n {route_name_vnetlocal} --next-hop-type VnetLocal --address-prefix 10.0.0.0/24') | ||
| self.cmd('network vnet create -g {rg} -n {vnet_name} --location {loc} --address-prefix 10.0.0.0/16') | ||
| self.cmd('network vnet subnet create -g {rg} --vnet-name {vnet_name} -n {subnet_name} --address-prefix 10.0.0.0/24 --route-table {route_table_name}') | ||
| subnet = self.cmd('network vnet subnet show -g {rg} --vnet-name {vnet_name} -n {subnet_name}').get_output_in_json() | ||
|
|
||
| self.kwargs.update({ | ||
| 'subnet_id': subnet['id'] | ||
| 'subnet_id': '/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/v-urmila/providers/Microsoft.Network/virtualNetworks/MIVirtualNetwork/subnets/ManagedInsanceSubnet' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed resource is not recommend in azure cli because it is hard for others to re-run with such resources. May I know why you want to fix resources here? |
||
| }) | ||
|
|
||
| # create sql managed_instance | ||
|
|
@@ -3765,17 +3751,17 @@ def test_sql_managed_db_mgmt(self): | |
|
|
||
| is_playback = os.path.exists(self.recording_file) | ||
| if is_playback: | ||
| subnet = '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AndyPG/providers/Microsoft.Network/virtualNetworks/prepare-cl-nimilj/subnets/default' | ||
| subnet = '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/v-urmila/providers/Microsoft.Network/virtualNetworks/MIVirtualNetwork/subnets/ManagedInsanceSubnet' | ||
| else: | ||
| subnet = '/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/AndyPG/providers/Microsoft.Network/virtualNetworks/prepare-cl-nimilj/subnets/default' | ||
| subnet = '/subscriptions/a8c9a924-06c0-4bde-9788-e7b1370969e1/resourceGroups/v-urmila/providers/Microsoft.Network/virtualNetworks/MIVirtualNetwork/subnets/ManagedInsanceSubnet' | ||
|
|
||
| license_type = 'LicenseIncluded' | ||
| loc = 'eastus2euap' | ||
| loc = 'westeurope' | ||
| v_cores = 4 | ||
| storage_size_in_gb = '128' | ||
| edition = 'GeneralPurpose' | ||
| family = 'Gen5' | ||
| resource_group_1 = "DejanDuVnetRG" | ||
| resource_group_1 = "v-urmila" | ||
| collation = "Latin1_General_100_CS_AS_SC" | ||
| user = admin_login | ||
|
|
||
|
|
||
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.
fixed resource is not recommended in test.
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.
The main issue with this is that MI tests are not easily setup. They also run very long when fully setup (>4h). I agree that it should be fixed. My take is that I believe Jovana is not making tests non-recordable, since they usually are, and with or without her change, people would need to do some manual setup/preparing in order to record.
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.
discussed with Jovana and Perica offline. They have to make network resource fixed given policy set on their subscription.
is it possible to disable the policy before you run the test and enable it again after done?
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.
discussed with Jovana. They cannot disable policy.