fog-azure-rm-temp 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/fog-azure-rm.gemspec +2 -2
- data/lib/fog/azurerm/constants.rb +3 -1
- data/lib/fog/azurerm/docs/compute.md +10 -4
- data/lib/fog/azurerm/models/compute/availability_set.rb +22 -1
- data/lib/fog/azurerm/models/key_vault/access_policy_entry.rb +0 -4
- data/lib/fog/azurerm/models/network/network_interface.rb +0 -2
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +1 -1
- data/lib/fog/azurerm/requests/compute/create_availability_set.rb +25 -11
- data/lib/fog/azurerm/utilities/general.rb +1 -1
- data/lib/fog/azurerm/version.rb +1 -1
- data/test/api_stub/models/compute/availability_set.rb +24 -5
- data/test/api_stub/requests/compute/availability_set.rb +60 -3
- data/test/integration/application_gateway.rb +1 -1
- data/test/integration/availability_set.rb +103 -16
- data/test/integration/blob.rb +1 -1
- data/test/integration/container.rb +1 -1
- data/test/integration/data_disk.rb +1 -1
- data/test/integration/deployment.rb +1 -1
- data/test/integration/express_route_circuit.rb +1 -1
- data/test/integration/external_load_balancer.rb +1 -1
- data/test/integration/internal_load_balancer.rb +1 -1
- data/test/integration/key_vault.rb +1 -1
- data/test/integration/local_network_gateway.rb +1 -1
- data/test/integration/managed_disk.rb +1 -1
- data/test/integration/network_interface.rb +1 -1
- data/test/integration/network_security_group.rb +1 -1
- data/test/integration/network_security_rule.rb +1 -1
- data/test/integration/public_ip.rb +1 -1
- data/test/integration/record_set.rb +1 -1
- data/test/integration/resource_group.rb +1 -1
- data/test/integration/resource_tag.rb +1 -1
- data/test/integration/server.rb +1 -1
- data/test/integration/server_custom_image.rb +2 -2
- data/test/integration/sql_server.rb +1 -1
- data/test/integration/storage_account.rb +1 -1
- data/test/integration/subnet.rb +1 -1
- data/test/integration/traffic_manager.rb +1 -1
- data/test/integration/virtual_machine_extension.rb +2 -2
- data/test/integration/virtual_network.rb +1 -1
- data/test/integration/virtual_network_gateway.rb +3 -9
- data/test/integration/{Virtual_network_gateway_connection.rb → virtual_network_gateway_connection.rb} +3 -2
- data/test/integration/virtual_network_gateway_connection_to_express_route.rb +3 -3
- data/test/integration/zone.rb +1 -1
- data/test/models/compute/test_availability_set.rb +4 -2
- data/test/models/key_vault/test_vault.rb +1 -1
- data/test/requests/compute/test_attach_data_disk_to_vm.rb +6 -6
- data/test/requests/compute/test_check_vm_exists.rb +3 -3
- data/test/requests/compute/test_create_availability_set.rb +87 -3
- data/test/requests/compute/test_detach_data_disk_from_vm.rb +2 -2
- data/test/requests/compute/test_get_virtual_machine.rb +2 -2
- data/test/requests/compute/test_get_vm_status.rb +2 -2
- data/test/test_helper.rb +23 -0
- metadata +10 -12
data/test/integration/blob.rb
CHANGED
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resources = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resources = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resources = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resource = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resource = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resource = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resources = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
data/test/integration/server.rb
CHANGED
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -92,7 +92,7 @@ begin
|
|
92
92
|
username: 'testuser',
|
93
93
|
password: 'Confiz=123',
|
94
94
|
disable_password_authentication: false,
|
95
|
-
|
95
|
+
network_interface_card_ids: ["/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-CustomVM/providers/Microsoft.Network/networkInterfaces/NetInt"],
|
96
96
|
platform: 'linux',
|
97
97
|
vhd_path: 'https://custimagestorage.blob.core.windows.net/newcustomvhd/trusty-server-cloudimg-amd64-disk1-zeeshan.vhd'
|
98
98
|
)
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resources = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
data/test/integration/subnet.rb
CHANGED
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resources = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -87,7 +87,7 @@ begin
|
|
87
87
|
username: 'testuser',
|
88
88
|
password: 'Confiz=123',
|
89
89
|
disable_password_authentication: false,
|
90
|
-
|
90
|
+
network_interface_card_ids: ["/subscriptions/#{azure_credentials['subscription_id']}/resourceGroups/TestRG-VME/providers/Microsoft.Network/networkInterfaces/NetInt"],
|
91
91
|
publisher: 'MicrosoftWindowsServer',
|
92
92
|
offer: 'WindowsServer',
|
93
93
|
sku: '2008-R2-SP1',
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resource = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -81,8 +81,8 @@ begin
|
|
81
81
|
}
|
82
82
|
],
|
83
83
|
resource_group: 'TestRG-VNG',
|
84
|
-
sku_name: '
|
85
|
-
sku_tier: '
|
84
|
+
sku_name: 'Standard',
|
85
|
+
sku_tier: 'Standard',
|
86
86
|
sku_capacity: 2,
|
87
87
|
gateway_type: 'ExpressRoute',
|
88
88
|
enable_bgp: false,
|
@@ -111,12 +111,6 @@ begin
|
|
111
111
|
|
112
112
|
puts "Deleted virtual network gateway: #{network_gateway.destroy}"
|
113
113
|
|
114
|
-
pubip = network.public_ips.get('TestRG-VNG', 'mypubip')
|
115
|
-
pubip.destroy
|
116
|
-
|
117
|
-
vnet = network.virtual_networks.get('TestRG-VNG', 'testVnet')
|
118
|
-
vnet.destroy
|
119
|
-
|
120
114
|
rg = resource.resource_groups.get('TestRG-VNG')
|
121
115
|
rg.destroy
|
122
116
|
rescue
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resource = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -214,7 +214,8 @@ begin
|
|
214
214
|
|
215
215
|
resource_group = resource.resource_groups.get('TestRG-GC')
|
216
216
|
resource_group.destroy
|
217
|
-
rescue
|
217
|
+
rescue Exception => e
|
218
|
+
raise e
|
218
219
|
puts 'Integration Test for virtual network gateway connection is failing'
|
219
220
|
resource_group.destroy unless resource_group.nil?
|
220
221
|
end
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
resource = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -70,8 +70,8 @@ begin
|
|
70
70
|
}
|
71
71
|
],
|
72
72
|
resource_group: 'TestRG-GCE',
|
73
|
-
sku_name: '
|
74
|
-
sku_tier: '
|
73
|
+
sku_name: 'Standard',
|
74
|
+
sku_tier: 'Standard',
|
75
75
|
sku_capacity: 2,
|
76
76
|
gateway_type: 'ExpressRoute',
|
77
77
|
enable_bgp: false,
|
data/test/integration/zone.rb
CHANGED
@@ -6,7 +6,7 @@ require 'yaml'
|
|
6
6
|
###################### Keep it Uncommented! ######################
|
7
7
|
########################################################################################################################
|
8
8
|
|
9
|
-
azure_credentials = YAML.load_file('credentials/azure.yml')
|
9
|
+
azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))
|
10
10
|
|
11
11
|
rs = Fog::Resources::AzureRM.new(
|
12
12
|
tenant_id: azure_credentials['tenant_id'],
|
@@ -6,7 +6,7 @@ class TestAvailabilitySet < Minitest::Test
|
|
6
6
|
@service = Fog::Compute::AzureRM.new(credentials)
|
7
7
|
@availability_set = availability_set(@service)
|
8
8
|
compute_client = @service.instance_variable_get(:@compute_mgmt_client)
|
9
|
-
@response = ApiStub::Models::Compute::AvailabilitySet.
|
9
|
+
@response = ApiStub::Models::Compute::AvailabilitySet.create_unmanaged_availability_set_response(compute_client)
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_model_methods
|
@@ -27,7 +27,9 @@ class TestAvailabilitySet < Minitest::Test
|
|
27
27
|
:location,
|
28
28
|
:resource_group,
|
29
29
|
:platform_update_domain_count,
|
30
|
-
:platform_fault_domain_count
|
30
|
+
:platform_fault_domain_count,
|
31
|
+
:is_managed,
|
32
|
+
:sku_name
|
31
33
|
]
|
32
34
|
attributes.each do |attribute|
|
33
35
|
assert_respond_to @availability_set, attribute
|
@@ -20,7 +20,7 @@ class TestAttachDataDiskToVM < Minitest::Test
|
|
20
20
|
@virtual_machines.stub :get, @get_vm_response do
|
21
21
|
@storage_accounts.stub :list_keys, @storage_access_keys_response do
|
22
22
|
@virtual_machines.stub :create_or_update, @update_vm_response do
|
23
|
-
assert_equal @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1'), @update_vm_response
|
23
|
+
assert_equal @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false), @update_vm_response
|
24
24
|
blob_service.verify
|
25
25
|
end
|
26
26
|
end
|
@@ -35,7 +35,7 @@ class TestAttachDataDiskToVM < Minitest::Test
|
|
35
35
|
@storage_accounts.stub :list_keys, @storage_access_keys_response do
|
36
36
|
@virtual_machines.stub :create_or_update, @update_vm_response do
|
37
37
|
assert_raises RuntimeError do
|
38
|
-
@service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1')
|
38
|
+
@service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -48,7 +48,7 @@ class TestAttachDataDiskToVM < Minitest::Test
|
|
48
48
|
@storage_accounts.stub :list_keys, @storage_access_keys_response do
|
49
49
|
@virtual_machines.stub :create_or_update, update_vm_response do
|
50
50
|
assert_raises RuntimeError do
|
51
|
-
@service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1')
|
51
|
+
@service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -61,7 +61,7 @@ class TestAttachDataDiskToVM < Minitest::Test
|
|
61
61
|
@storage_accounts.stub :list_keys, @storage_access_keys_response do
|
62
62
|
@virtual_machines.stub :create_or_update, update_vm_response do
|
63
63
|
assert_raises RuntimeError do
|
64
|
-
@service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1')
|
64
|
+
@service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
@@ -72,7 +72,7 @@ class TestAttachDataDiskToVM < Minitest::Test
|
|
72
72
|
get_vm_response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
|
73
73
|
@virtual_machines.stub :get, get_vm_response do
|
74
74
|
assert_raises RuntimeError do
|
75
|
-
@service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1')
|
75
|
+
@service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false)
|
76
76
|
end
|
77
77
|
end
|
78
78
|
end
|
@@ -82,7 +82,7 @@ class TestAttachDataDiskToVM < Minitest::Test
|
|
82
82
|
@virtual_machines.stub :get, @get_vm_response do
|
83
83
|
@storage_accounts.stub :list_keys, storage_access_keys_response do
|
84
84
|
assert_raises RuntimeError do
|
85
|
-
@service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1')
|
85
|
+
@service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false)
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
@@ -11,21 +11,21 @@ class TestCheckVirtualMachineExists < Minitest::Test
|
|
11
11
|
def test_check_vm_exists_success
|
12
12
|
response = ApiStub::Requests::Compute::VirtualMachine.create_virtual_machine_response(@compute_client)
|
13
13
|
@virtual_machines.stub :get, response do
|
14
|
-
assert @service.check_vm_exists('fog-test-rg', 'fog-test-server')
|
14
|
+
assert @service.check_vm_exists('fog-test-rg', 'fog-test-server', false)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_check_vm_exists_failure
|
19
19
|
response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
|
20
20
|
@virtual_machines.stub :get, response do
|
21
|
-
assert !@service.check_vm_exists('fog-test-rg', 'fog-test-server')
|
21
|
+
assert !@service.check_vm_exists('fog-test-rg', 'fog-test-server', false)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_check_vm_exists_exception
|
26
26
|
response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
|
27
27
|
@virtual_machines.stub :get, response do
|
28
|
-
assert_raises(RuntimeError) { @service.check_vm_exists('fog-test-rg', 'fog-test-server') }
|
28
|
+
assert_raises(RuntimeError) { @service.check_vm_exists('fog-test-rg', 'fog-test-server', false) }
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|