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

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
Expand Up @@ -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',
Expand All @@ -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'
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Contributor

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.

})

# create sql managed_instance
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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',
Expand All @@ -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'
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ azure-mgmt-security==0.4.1
azure-mgmt-servicebus==0.6.0
azure-mgmt-servicefabric==0.4.0
azure-mgmt-signalr==0.4.0
azure-mgmt-sql==0.19.0
azure-mgmt-sql==0.20.0
azure-mgmt-sqlvirtualmachine==0.5.0
azure-mgmt-storage==11.1.0
azure-mgmt-trafficmanager==0.51.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ azure-mgmt-security==0.4.1
azure-mgmt-servicebus==0.6.0
azure-mgmt-servicefabric==0.4.0
azure-mgmt-signalr==0.4.0
azure-mgmt-sql==0.19.0
azure-mgmt-sql==0.20.0
azure-mgmt-sqlvirtualmachine==0.5.0
azure-mgmt-storage==11.1.0
azure-mgmt-trafficmanager==0.51.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ azure-mgmt-security==0.4.1
azure-mgmt-servicebus==0.6.0
azure-mgmt-servicefabric==0.4.0
azure-mgmt-signalr==0.4.0
azure-mgmt-sql==0.19.0
azure-mgmt-sql==0.20.0
azure-mgmt-sqlvirtualmachine==0.5.0
azure-mgmt-storage==11.1.0
azure-mgmt-trafficmanager==0.51.0
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
'azure-mgmt-servicebus~=0.6.0',
'azure-mgmt-servicefabric~=0.4.0',
'azure-mgmt-signalr~=0.4.0',
'azure-mgmt-sql~=0.19.0',
'azure-mgmt-sql~=0.20.0',
'azure-mgmt-sqlvirtualmachine~=0.5.0',
'azure-mgmt-storage~=11.1.0',
'azure-mgmt-trafficmanager~=0.51.0',
Expand Down