Skip to content

Commit

Permalink
Add virtual network & vm upgrade test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrbradley committed Dec 9, 2024
1 parent 692d95a commit 275dee3
Show file tree
Hide file tree
Showing 4 changed files with 508 additions and 0 deletions.
5 changes: 5 additions & 0 deletions provider/pkg/provider/provider_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ func TestUpgradeKeyVault_2_76_0(t *testing.T) {
upgradeTest(t, "upgrade-keyvault", "2.76.0")
}

func TestUpgradeNetworkedVm_2_76_0(t *testing.T) {
t.Parallel()
upgradeTest(t, "upgrade-networked-vm", "2.76.0")
}

func upgradeTest(t *testing.T, testProgramDir string, upgradeFromVersion string, opts ...optproviderupgrade.PreviewProviderUpgradeOpt) {
t.Helper()
if testing.Short() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: upgrade-networked-vm
runtime: yaml
description: Upgrade test for VirtualNetwork and VirtualMachine
resources:
rg:
type: azure-native:resources:ResourceGroup

vnet:
type: azure-native:network:VirtualNetwork
properties:
resourceGroupName: ${rg.name}
addressSpace:
addressPrefixes: ["10.1.0.0/16"]

subnet:
type: azure-native:network:Subnet
properties:
resourceGroupName: ${rg.name}
virtualNetworkName: ${vnet.name}
addressPrefix: "10.1.0.0/24"

networkInterface:
type: azure-native:network:NetworkInterface
properties:
resourceGroupName: ${rg.name}
ipConfigurations:
- name: ipconfig1
subnet:
id: ${subnet.id}
privateIPAllocationMethod: Dynamic

publicIp:
type: azure-native:network:PublicIPAddress
properties:
resourceGroupName: ${rg.name}
sku:
name: basic
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Dynamic

vm:
type: azure-native:compute:VirtualMachine
properties:
resourceGroupName: ${rg.name}
hardwareProfile:
vmSize: Standard_A0
networkProfile:
networkInterfaces:
- id: ${networkInterface.id}
storageProfile:
imageReference:
publisher: "Canonical"
offer: "UbuntuServer"
sku: "18.04-LTS"
version: "latest"
osProfile:
computerName: "mycomputer"
adminUsername: "someusername"
adminPassword: "someFancyp@wd2!"
Loading

0 comments on commit 275dee3

Please sign in to comment.