From 53221c4bb2823dadb78661814b625f051e352dcf Mon Sep 17 00:00:00 2001 From: anuchan Date: Mon, 27 Jun 2016 19:08:09 -0700 Subject: [PATCH 1/2] Updating ssh unit test to really check for SSH in the payload --- .../test/java/com/microsoft/azure/TestVirtualMachineSsh.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure/src/test/java/com/microsoft/azure/TestVirtualMachineSsh.java b/azure/src/test/java/com/microsoft/azure/TestVirtualMachineSsh.java index c9a2b7597c4f6..14731557eb2e9 100644 --- a/azure/src/test/java/com/microsoft/azure/TestVirtualMachineSsh.java +++ b/azure/src/test/java/com/microsoft/azure/TestVirtualMachineSsh.java @@ -51,6 +51,9 @@ public VirtualMachine createResource(VirtualMachines virtualMachines) throws Exc }finally { if(session != null) {session.disconnect();} } + + Assert.assertNotNull(vm.inner().osProfile().linuxConfiguration().ssh()); + Assert.assertTrue(vm.inner().osProfile().linuxConfiguration().ssh().publicKeys().size() > 0); return vm; } From b00521a5c348c4ff79c232a68cebe853f6bce67c Mon Sep 17 00:00:00 2001 From: anuchan Date: Tue, 28 Jun 2016 12:14:14 -0700 Subject: [PATCH 2/2] Use env var AZURE_AUTH_LOCATION for auth file location in samples --- .../management/compute/samples/ListVirtualMachineImages.java | 2 +- .../azure/management/compute/samples/ManageAvailabilitySet.java | 2 +- .../azure/management/compute/samples/ManageVirtualMachine.java | 2 +- .../azure/management/network/samples/ManageIPAddress.java | 2 +- .../management/network/samples/ManageNetworkInterface.java | 2 +- .../management/network/samples/ManageNetworkSecurityGroup.java | 2 +- .../azure/management/network/samples/ManageVirtualNetwork.java | 2 +- .../azure/management/storage/samples/ManageStorageAccount.java | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ListVirtualMachineImages.java b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ListVirtualMachineImages.java index 5c5996f57cad2..8c6c9c90214f8 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ListVirtualMachineImages.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ListVirtualMachineImages.java @@ -35,7 +35,7 @@ public static void main(String[] args) { //================================================================= // Authenticate - final File credFile = new File("my.azureauth"); + final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION")); Azure azure = Azure .configure() diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageAvailabilitySet.java b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageAvailabilitySet.java index c8d08408e45dc..dc4f59849f8dc 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageAvailabilitySet.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageAvailabilitySet.java @@ -54,7 +54,7 @@ public static void main(String[] args) { //============================================================= // Authenticate - final File credFile = new File("my.azureauth"); + final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION")); Azure azure = Azure .configure() diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachine.java b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachine.java index 1c79bfb7cacb4..ad5baef5d4614 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachine.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachine.java @@ -56,7 +56,7 @@ public static void main(String[] args) { //============================================================= // Authenticate - final File credFile = new File("my.azureauth"); + final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION")); Azure azure = Azure .configure() diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageIPAddress.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageIPAddress.java index f2dc9ae825404..4446df945cacc 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageIPAddress.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageIPAddress.java @@ -50,7 +50,7 @@ public static void main(String[] args) { //============================================================= // Authenticate - final File credFile = new File("my.azureauth"); + final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION")); Azure azure = Azure .configure() diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkInterface.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkInterface.java index f28adbe939b4d..111ad6857e40f 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkInterface.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkInterface.java @@ -56,7 +56,7 @@ public static void main(String[] args) { //============================================================= // Authenticate - final File credFile = new File("my.azureauth"); + final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION")); Azure azure = Azure .configure() diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkSecurityGroup.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkSecurityGroup.java index 46e6410b95dda..da4499f9c46a4 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkSecurityGroup.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageNetworkSecurityGroup.java @@ -61,7 +61,7 @@ public static void main(String[] args) { //============================================================= // Authenticate - final File credFile = new File("my.azureauth"); + final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION")); Azure azure = Azure .configure() diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualNetwork.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualNetwork.java index 3e6bd36b765e2..b036ee2a0523a 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualNetwork.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageVirtualNetwork.java @@ -58,7 +58,7 @@ public static void main(String[] args) { //============================================================= // Authenticate - final File credFile = new File("my.azureauth"); + final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION")); Azure azure = Azure .configure() diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/storage/samples/ManageStorageAccount.java b/azure-samples/src/main/java/com/microsoft/azure/management/storage/samples/ManageStorageAccount.java index 71b87d4599228..dadfa5b75b1aa 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/storage/samples/ManageStorageAccount.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/storage/samples/ManageStorageAccount.java @@ -41,7 +41,7 @@ public static void main(String[] args) { try { - final File credFile = new File("my.azureauth"); + final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION")); Azure azure = Azure .configure()