Update tests for datadisk name change

This commit is contained in:
Vijay Rajah 2020-04-05 01:16:24 +05:30
parent 5340af4d49
commit 0589f57d4d
22 changed files with 79 additions and 12 deletions

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},
@ -144,9 +147,9 @@
"createOption": "Empty",
"diskSizeGB": 32,
"lun": 0,
"name": "datadisk-1",
"name": "[concat(parameters('dataDiskName'),'-1'",
"vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/datadisk-', '1','.vhd')]"
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),parameters('dataDiskName'), '-1','.vhd')]"
}
}
],

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},
@ -147,7 +150,7 @@
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"name": "datadisk-1"
"name": "[concat(parameters('dataDiskName'),'-1'"
}
],
"imageReference": {

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -243,7 +243,8 @@ func (s *TemplateBuilder) SetAdditionalDisks(diskSizeGB []int32, dataDiskname st
for i, additionalSize := range diskSizeGB {
dataDisks[i].DiskSizeGB = to.Int32Ptr(additionalSize)
dataDisks[i].Lun = to.IntPtr(i)
dataDisks[i].Name = to.StringPtr(fmt.Sprintf("%s-%d", dataDiskname, i+1))
// dataDisks[i].Name = to.StringPtr(fmt.Sprintf("%s-%d", dataDiskname, i+1))
dataDisks[i].Name = to.StringPtr(fmt.Sprintf("[concat(parameters('dataDiskName'),'-%d'", i+1))
dataDisks[i].CreateOption = "Empty"
dataDisks[i].Caching = cachingType
if isManaged {
@ -251,7 +252,7 @@ func (s *TemplateBuilder) SetAdditionalDisks(diskSizeGB []int32, dataDiskname st
dataDisks[i].ManagedDisk = profile.OsDisk.ManagedDisk
} else {
dataDisks[i].Vhd = &compute.VirtualHardDisk{
URI: to.StringPtr(fmt.Sprintf("[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/%s-', '%d','.vhd')]", dataDiskname, i+1)),
URI: to.StringPtr(fmt.Sprintf("[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),parameters('dataDiskName'), '-%d','.vhd')]", i+1)),
}
dataDisks[i].ManagedDisk = nil
}
@ -581,7 +582,10 @@ const BasicTemplate = `{
},
"vmName": {
"type": "string"
}
},
"dataDiskName": {
"type": "string"
}
},
"variables": {
"addressPrefix": "10.0.0.0/16",

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},
@ -161,7 +164,7 @@
"managedDisk": {
"storageAccountType": "Premium_LRS"
},
"name": "datadisk-1"
"name": "[concat(parameters('dataDiskName'),'-1'"
},
{
"caching": "ReadWrite",
@ -171,7 +174,7 @@
"managedDisk": {
"storageAccountType": "Premium_LRS"
},
"name": "datadisk-2"
"name": "[concat(parameters('dataDiskName'),'-2'"
}
],
"imageReference": {

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},
@ -158,9 +161,9 @@
"createOption": "Empty",
"diskSizeGB": 32,
"lun": 0,
"name": "datadisk-1",
"name": "[concat(parameters('dataDiskName'),'-1'",
"vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/datadisk-', '1','.vhd')]"
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),parameters('dataDiskName'), '-1','.vhd')]"
}
},
{
@ -168,9 +171,9 @@
"createOption": "Empty",
"diskSizeGB": 64,
"lun": 1,
"name": "datadisk-2",
"name": "[concat(parameters('dataDiskName'),'-2'",
"vhd": {
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/datadisk-', '2','.vhd')]"
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),parameters('dataDiskName'), '-2','.vhd')]"
}
}
],

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},

View File

@ -8,6 +8,9 @@
"adminUsername": {
"type": "string"
},
"dataDiskName": {
"type": "string"
},
"dnsNameForPublicIP": {
"type": "string"
},