forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update known vm images to newest (#12352)
* update known vm images to newest * fix compile error * add live test and fix image gen2
- Loading branch information
Showing
11 changed files
with
108 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
...mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachinePopularImageTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.resourcemanager.compute; | ||
|
||
import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; | ||
import com.azure.resourcemanager.compute.models.KnownWindowsVirtualMachineImage; | ||
import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; | ||
import com.azure.resourcemanager.resources.core.TestBase; | ||
import com.azure.resourcemanager.resources.fluentcore.arm.Region; | ||
import com.azure.resourcemanager.resources.fluentcore.model.Indexable; | ||
import org.junit.jupiter.api.Test; | ||
import reactor.core.publisher.Flux; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class VirtualMachinePopularImageTests extends ComputeManagementTest { | ||
private final String rgName = generateRandomResourceName("rg", 10); | ||
|
||
public VirtualMachinePopularImageTests() { | ||
super(TestBase.RunCondition.LIVE_ONLY); | ||
} | ||
|
||
@Test | ||
public void canCreateAllPopularImageVM() { | ||
List<Flux<Indexable>> vmFluxes = new ArrayList<>(); | ||
for (KnownWindowsVirtualMachineImage image : KnownWindowsVirtualMachineImage.values()) { | ||
Flux<Indexable> flux = computeManager.virtualMachines() | ||
.define(generateRandomResourceName("vm", 10)) | ||
.withRegion(Region.US_SOUTH_CENTRAL) | ||
.withNewResourceGroup(rgName) | ||
.withNewPrimaryNetwork("10.0.0.0/24") | ||
.withPrimaryPrivateIPAddressDynamic() | ||
.withoutPrimaryPublicIPAddress() | ||
.withPopularWindowsImage(image) | ||
.withAdminUsername("testUser") | ||
.withAdminPassword(password()) | ||
.withSize(VirtualMachineSizeTypes.STANDARD_B1S) | ||
.createAsync(); | ||
vmFluxes.add(flux); | ||
} | ||
|
||
for (KnownLinuxVirtualMachineImage image : KnownLinuxVirtualMachineImage.values()) { | ||
Flux<Indexable> flux = computeManager.virtualMachines() | ||
.define(generateRandomResourceName("vm", 10)) | ||
.withRegion(Region.US_SOUTH_CENTRAL) | ||
.withNewResourceGroup(rgName) | ||
.withNewPrimaryNetwork("10.0.0.0/24") | ||
.withPrimaryPrivateIPAddressDynamic() | ||
.withoutPrimaryPublicIPAddress() | ||
.withPopularLinuxImage(image) | ||
.withRootUsername("testUser") | ||
.withRootPassword(password()) | ||
.withSize(VirtualMachineSizeTypes.STANDARD_B1S) | ||
.createAsync(); | ||
vmFluxes.add(flux); | ||
} | ||
|
||
Flux.merge(vmFluxes).blockLast(); | ||
} | ||
|
||
@Override | ||
protected void cleanUpResources() { | ||
resourceManager.resourceGroups().beginDeleteByName(rgName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters