From 5bd48cd4ac0f0ed4fb18f3ada53eddbb7acfca4c Mon Sep 17 00:00:00 2001 From: "bilal.naeem" Date: Fri, 22 Sep 2017 12:36:41 +0500 Subject: [PATCH 1/4] Fixed unit tests --- .../traffic_manager_profile.rb | 2 +- lib/fog/azurerm/utilities/general.rb | 2 +- test/models/key_vault/test_vault.rb | 2 +- .../compute/test_attach_data_disk_to_vm.rb | 12 +++++------ test/requests/compute/test_check_vm_exists.rb | 6 +++--- .../compute/test_detach_data_disk_from_vm.rb | 4 ++-- .../compute/test_get_virtual_machine.rb | 4 ++-- test/requests/compute/test_get_vm_status.rb | 4 ++-- test/test_helper.rb | 21 +++++++++++++++++++ 9 files changed, 39 insertions(+), 18 deletions(-) diff --git a/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb b/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb index 92c0db87e..77ee241ac 100644 --- a/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +++ b/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb @@ -55,7 +55,7 @@ def destroy def update(profile_params) validate_input(profile_params) - profile_params[:endpoints] = endpoints.map { |endpoint| get_hash_from_object(endpoint)['attributes'] } + profile_params[:endpoints] = endpoints.map { |endpoint| get_hash_from_object(endpoint)['attributes'] } unless profile_params[:endpoints].nil? merge_attributes(profile_params) profile = service.create_or_update_traffic_manager_profile(traffic_manager_profile_hash) merge_attributes(Fog::TrafficManager::AzureRM::TrafficManagerProfile.parse(profile)) diff --git a/lib/fog/azurerm/utilities/general.rb b/lib/fog/azurerm/utilities/general.rb index 4eab00aa0..b5434e5a7 100755 --- a/lib/fog/azurerm/utilities/general.rb +++ b/lib/fog/azurerm/utilities/general.rb @@ -55,7 +55,7 @@ def raise_azure_exception(exception, msg) end exception_message = "Exception in #{msg} #{message} Type: #{exception.class}\n#{exception.backtrace.join("\n")}" else - "#{exception.inspect}\n#{exception.backtrace.join("\n")}" + exception_message = "#{exception.inspect}\n#{exception.backtrace.join("\n")}" end Fog::Logger.debug exception.backtrace diff --git a/test/models/key_vault/test_vault.rb b/test/models/key_vault/test_vault.rb index 90ab34981..f1d830612 100644 --- a/test/models/key_vault/test_vault.rb +++ b/test/models/key_vault/test_vault.rb @@ -4,7 +4,7 @@ class TestVault < Minitest::Test def setup @service = Fog::KeyVault::AzureRM.new(credentials) - @vault = Fog::KeyVault::AzureRM::Vault.new + @vault = key_vault(@service) end def test_model_attributes diff --git a/test/requests/compute/test_attach_data_disk_to_vm.rb b/test/requests/compute/test_attach_data_disk_to_vm.rb index 3692f6b56..a4293d842 100644 --- a/test/requests/compute/test_attach_data_disk_to_vm.rb +++ b/test/requests/compute/test_attach_data_disk_to_vm.rb @@ -20,7 +20,7 @@ def test_attach_data_disk_to_vm_success @virtual_machines.stub :get, @get_vm_response do @storage_accounts.stub :list_keys, @storage_access_keys_response do @virtual_machines.stub :create_or_update, @update_vm_response do - assert_equal @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1'), @update_vm_response + assert_equal @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false), @update_vm_response blob_service.verify end end @@ -35,7 +35,7 @@ def test_attach_data_disk_to_vm_failure @storage_accounts.stub :list_keys, @storage_access_keys_response do @virtual_machines.stub :create_or_update, @update_vm_response do assert_raises RuntimeError do - @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1') + @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false) end end end @@ -48,7 +48,7 @@ def test_update_vm_failure @storage_accounts.stub :list_keys, @storage_access_keys_response do @virtual_machines.stub :create_or_update, update_vm_response do assert_raises RuntimeError do - @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1') + @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false) end end end @@ -61,7 +61,7 @@ def test_update_vm_blob_not_exist_failure @storage_accounts.stub :list_keys, @storage_access_keys_response do @virtual_machines.stub :create_or_update, update_vm_response do assert_raises RuntimeError do - @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1') + @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false) end end end @@ -72,7 +72,7 @@ def test_get_vm_failure get_vm_response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) } @virtual_machines.stub :get, get_vm_response do assert_raises RuntimeError do - @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1') + @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false) end end end @@ -82,7 +82,7 @@ def test_get_storage_key_failure @virtual_machines.stub :get, @get_vm_response do @storage_accounts.stub :list_keys, storage_access_keys_response do assert_raises RuntimeError do - @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1') + @service.attach_data_disk_to_vm('fog-test-rg', 'fog-test-vm', 'disk1', 1, 'mystorage1', false) end end end diff --git a/test/requests/compute/test_check_vm_exists.rb b/test/requests/compute/test_check_vm_exists.rb index 577d2127c..7c9b2669b 100644 --- a/test/requests/compute/test_check_vm_exists.rb +++ b/test/requests/compute/test_check_vm_exists.rb @@ -11,21 +11,21 @@ def setup def test_check_vm_exists_success response = ApiStub::Requests::Compute::VirtualMachine.create_virtual_machine_response(@compute_client) @virtual_machines.stub :get, response do - assert @service.check_vm_exists('fog-test-rg', 'fog-test-server') + assert @service.check_vm_exists('fog-test-rg', 'fog-test-server', false) end end def test_check_vm_exists_failure response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) } @virtual_machines.stub :get, response do - assert !@service.check_vm_exists('fog-test-rg', 'fog-test-server') + assert !@service.check_vm_exists('fog-test-rg', 'fog-test-server', false) end end def test_check_vm_exists_exception response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) } @virtual_machines.stub :get, response do - assert_raises(RuntimeError) { @service.check_vm_exists('fog-test-rg', 'fog-test-server') } + assert_raises(RuntimeError) { @service.check_vm_exists('fog-test-rg', 'fog-test-server', false) } end end end diff --git a/test/requests/compute/test_detach_data_disk_from_vm.rb b/test/requests/compute/test_detach_data_disk_from_vm.rb index 1a1f2faaa..b5b36a4b0 100644 --- a/test/requests/compute/test_detach_data_disk_from_vm.rb +++ b/test/requests/compute/test_detach_data_disk_from_vm.rb @@ -13,7 +13,7 @@ def test_detach_data_disk_from_vm_success update_vm_response = ApiStub::Requests::Compute::VirtualMachine.detach_data_disk_from_vm_response(@compute_client) @virtual_machines.stub :get, get_vm_response do @virtual_machines.stub :create_or_update, update_vm_response do - assert_equal @service.detach_data_disk_from_vm('fog-test-rg', 'fog-test-vm', 'mydatadisk1'), update_vm_response + assert_equal @service.detach_data_disk_from_vm('fog-test-rg', 'fog-test-vm', 'mydatadisk1', false), update_vm_response end end end @@ -24,7 +24,7 @@ def test_detach_data_disk_from_vm_failure @virtual_machines.stub :get, get_vm_response do @virtual_machines.stub :create_or_update, update_vm_response do assert_raises RuntimeError do - @service.detach_data_disk_from_vm('fog-test-rg', 'fog-test-vm', 'mydatadisk1') + @service.detach_data_disk_from_vm('fog-test-rg', 'fog-test-vm', 'mydatadisk1', false) end end end diff --git a/test/requests/compute/test_get_virtual_machine.rb b/test/requests/compute/test_get_virtual_machine.rb index b0328193b..0726191c6 100644 --- a/test/requests/compute/test_get_virtual_machine.rb +++ b/test/requests/compute/test_get_virtual_machine.rb @@ -11,14 +11,14 @@ def setup def test_get_virtual_machine_success response = ApiStub::Requests::Compute::VirtualMachine.create_virtual_machine_response(@compute_client) @virtual_machines.stub :get, response do - assert_equal @service.get_virtual_machine('fog-test-rg', 'fog-test-server'), response + assert_equal @service.get_virtual_machine('fog-test-rg', 'fog-test-server', false), response end end def test_get_virtual_machine_failure response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) } @virtual_machines.stub :get, response do - assert_raises(RuntimeError) { @service.get_virtual_machine('fog-test-rg', 'fog-test-server') } + assert_raises(RuntimeError) { @service.get_virtual_machine('fog-test-rg', 'fog-test-server', false) } end end end diff --git a/test/requests/compute/test_get_vm_status.rb b/test/requests/compute/test_get_vm_status.rb index 069c569ba..9eca4a2a3 100644 --- a/test/requests/compute/test_get_vm_status.rb +++ b/test/requests/compute/test_get_vm_status.rb @@ -12,14 +12,14 @@ def test_vm_status_success response = ApiStub::Requests::Compute::VirtualMachine.virtual_machine_instance_view_response(@compute_client) compare_result = ApiStub::Requests::Compute::VirtualMachine.vm_status_response @virtual_machines.stub :get, response do - assert_equal @service.check_vm_status('fog-test-rg', 'fog-test-server'), compare_result + assert_equal @service.check_vm_status('fog-test-rg', 'fog-test-server', false), compare_result end end def test_vm_status_failure response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) } @virtual_machines.stub :get, response do - assert_raises(RuntimeError) { @service.check_vm_status('fog-test-rg', 'fog-test-server') } + assert_raises(RuntimeError) { @service.check_vm_status('fog-test-rg', 'fog-test-server', false) } end end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 39d2d6764..6039d4b8b 100755 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -817,3 +817,24 @@ def managed_disk(service) service: service ) end + +def key_vault(service) + Fog::KeyVault::AzureRM::Vault.new( + name: 'key-vault', + location: 'East US', + resource_group_name: 'fog-test-rg', + sku_family: 'A', + sku_name: 'Standard', + access_policies: [ + { + tenant_id: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', + object_id: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', + permissions: { + keys: ['all'], + secrets: ['all'] + } + } + ], + service: service + ) +end From 4ec4651e2c83d44c44d772281523d2944be54abd Mon Sep 17 00:00:00 2001 From: "bilal.naeem" Date: Fri, 22 Sep 2017 17:23:32 +0500 Subject: [PATCH 2/4] Updated gemspec --- fog-azure-rm.gemspec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fog-azure-rm.gemspec b/fog-azure-rm.gemspec index b80ccae96..2e6e8f7c7 100755 --- a/fog-azure-rm.gemspec +++ b/fog-azure-rm.gemspec @@ -5,7 +5,7 @@ require 'fog/azurerm/version' Gem::Specification.new do |spec| spec.name = 'fog-azure-rm' spec.version = Fog::AzureRM::VERSION - spec.authors = ['Shaffan Chaudhry', 'Samawia Moin', 'Adnan Khalil', 'Zeeshan Arshad', 'Haider Ali', 'Waqar Haider', 'Bilal Naeem', 'Muhammad Asad', 'Azeem Sajid', 'Maham Nazir'] + spec.authors = ['Shaffan Chaudhry', 'Samawia Moin', 'Adnan Khalil', 'Zeeshan Arshad', 'Haider Ali', 'Waqar Haider', 'Bilal Naeem', 'Muhammad Asad', 'Azeem Sajid', 'Maham Nazir', 'Abbas Sheikh'] spec.summary = "Module for the 'fog' gem to support Azure Resource Manager cloud services." spec.description = "This library can be used as a module for 'fog' or as standalone provider to use the Azure Resource Manager cloud services in applications.." @@ -24,7 +24,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'codeclimate-test-reporter' , '~> 1.0.0' spec.add_dependency 'fog-core', '~> 1.43.0' spec.add_dependency 'fog-json', '~> 1.0' - spec.add_dependency 'rest-client', '~> 2.0.0' spec.add_dependency 'azure_mgmt_compute', '~> 0.9.0' spec.add_dependency 'azure_mgmt_resources', '~> 0.9.0' spec.add_dependency 'azure_mgmt_storage', '~> 0.9.0' @@ -33,6 +32,6 @@ Gem::Specification.new do |spec| spec.add_dependency 'azure_mgmt_traffic_manager', '~> 0.9.0' spec.add_dependency 'azure_mgmt_sql', '~> 0.9.0' spec.add_dependency 'azure_mgmt_key_vault', '~> 0.9.0' - spec.add_dependency 'azure-storage', '>= 0.11.5.preview', '< 1.0' + spec.add_dependency 'azure-storage', '>= 0.11.5.preview' spec.add_dependency 'vhd', '0.0.4' end From da1b6a52e0c436ca458bf25f6f1355e6c621f848 Mon Sep 17 00:00:00 2001 From: "bilal.naeem" Date: Fri, 22 Sep 2017 17:24:31 +0500 Subject: [PATCH 3/4] Fixed dependency on azure-storage --- fog-azure-rm.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fog-azure-rm.gemspec b/fog-azure-rm.gemspec index 2e6e8f7c7..04f319367 100755 --- a/fog-azure-rm.gemspec +++ b/fog-azure-rm.gemspec @@ -32,6 +32,6 @@ Gem::Specification.new do |spec| spec.add_dependency 'azure_mgmt_traffic_manager', '~> 0.9.0' spec.add_dependency 'azure_mgmt_sql', '~> 0.9.0' spec.add_dependency 'azure_mgmt_key_vault', '~> 0.9.0' - spec.add_dependency 'azure-storage', '>= 0.11.5.preview' + spec.add_dependency 'azure-storage', '= 0.11.5.preview' spec.add_dependency 'vhd', '0.0.4' end From 9a503f6a4e8b8931e021a6e8f69b7a4dbe95fed0 Mon Sep 17 00:00:00 2001 From: "bilal.naeem" Date: Fri, 22 Sep 2017 17:37:04 +0500 Subject: [PATCH 4/4] Updated credentials path in integration tests --- .../azurerm/models/traffic_manager/traffic_manager_profile.rb | 2 +- test/integration/application_gateway.rb | 2 +- test/integration/availability_set.rb | 2 +- test/integration/blob.rb | 2 +- test/integration/container.rb | 2 +- test/integration/data_disk.rb | 2 +- test/integration/deployment.rb | 2 +- test/integration/express_route_circuit.rb | 2 +- test/integration/external_load_balancer.rb | 2 +- test/integration/internal_load_balancer.rb | 2 +- test/integration/key_vault.rb | 2 +- test/integration/local_network_gateway.rb | 2 +- test/integration/managed_disk.rb | 2 +- test/integration/network_interface.rb | 2 +- test/integration/network_security_group.rb | 2 +- test/integration/network_security_rule.rb | 2 +- test/integration/public_ip.rb | 2 +- test/integration/record_set.rb | 2 +- test/integration/resource_group.rb | 2 +- test/integration/resource_tag.rb | 2 +- test/integration/server.rb | 2 +- test/integration/server_custom_image.rb | 2 +- test/integration/sql_server.rb | 2 +- test/integration/storage_account.rb | 2 +- test/integration/subnet.rb | 2 +- test/integration/traffic_manager.rb | 2 +- test/integration/virtual_machine_extension.rb | 2 +- test/integration/virtual_network.rb | 2 +- test/integration/virtual_network_gateway.rb | 2 +- test/integration/virtual_network_gateway_connection.rb | 2 +- .../virtual_network_gateway_connection_to_express_route.rb | 2 +- test/integration/zone.rb | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb b/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb index 77ee241ac..679670290 100644 --- a/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +++ b/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb @@ -55,7 +55,7 @@ def destroy def update(profile_params) validate_input(profile_params) - profile_params[:endpoints] = endpoints.map { |endpoint| get_hash_from_object(endpoint)['attributes'] } unless profile_params[:endpoints].nil? + profile_params[:endpoints] = endpoints.map { |endpoint| get_hash_from_object(endpoint)['attributes'] } unless endpoints.nil? merge_attributes(profile_params) profile = service.create_or_update_traffic_manager_profile(traffic_manager_profile_hash) merge_attributes(Fog::TrafficManager::AzureRM::TrafficManagerProfile.parse(profile)) diff --git a/test/integration/application_gateway.rb b/test/integration/application_gateway.rb index 8299d889b..16ce3cc37 100644 --- a/test/integration/application_gateway.rb +++ b/test/integration/application_gateway.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resource = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/availability_set.rb b/test/integration/availability_set.rb index 970696232..507ca60eb 100644 --- a/test/integration/availability_set.rb +++ b/test/integration/availability_set.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/blob.rb b/test/integration/blob.rb index 1d5cf2bdf..66626b38e 100644 --- a/test/integration/blob.rb +++ b/test/integration/blob.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/container.rb b/test/integration/container.rb index 191d404f9..f22cfac76 100644 --- a/test/integration/container.rb +++ b/test/integration/container.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/data_disk.rb b/test/integration/data_disk.rb index 768f14269..66320759c 100644 --- a/test/integration/data_disk.rb +++ b/test/integration/data_disk.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/deployment.rb b/test/integration/deployment.rb index bae8eb61d..16e08b1ed 100644 --- a/test/integration/deployment.rb +++ b/test/integration/deployment.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resources = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/express_route_circuit.rb b/test/integration/express_route_circuit.rb index 87f1bd472..c259dd7a0 100644 --- a/test/integration/express_route_circuit.rb +++ b/test/integration/express_route_circuit.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resources = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/external_load_balancer.rb b/test/integration/external_load_balancer.rb index b1f19c3af..3aaaab397 100644 --- a/test/integration/external_load_balancer.rb +++ b/test/integration/external_load_balancer.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/internal_load_balancer.rb b/test/integration/internal_load_balancer.rb index 6bdb9f17f..6ade93d81 100644 --- a/test/integration/internal_load_balancer.rb +++ b/test/integration/internal_load_balancer.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/key_vault.rb b/test/integration/key_vault.rb index aa4dc969e..ff4cc8fe1 100644 --- a/test/integration/key_vault.rb +++ b/test/integration/key_vault.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resources = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/local_network_gateway.rb b/test/integration/local_network_gateway.rb index 037f97f91..2887681e0 100644 --- a/test/integration/local_network_gateway.rb +++ b/test/integration/local_network_gateway.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resource = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/managed_disk.rb b/test/integration/managed_disk.rb index 8000d7edb..ef9bccab7 100644 --- a/test/integration/managed_disk.rb +++ b/test/integration/managed_disk.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/network_interface.rb b/test/integration/network_interface.rb index 7f9e537b7..213c84669 100644 --- a/test/integration/network_interface.rb +++ b/test/integration/network_interface.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/network_security_group.rb b/test/integration/network_security_group.rb index 564f54010..35358a498 100644 --- a/test/integration/network_security_group.rb +++ b/test/integration/network_security_group.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/network_security_rule.rb b/test/integration/network_security_rule.rb index ba50ca7f0..4d06f0356 100644 --- a/test/integration/network_security_rule.rb +++ b/test/integration/network_security_rule.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/public_ip.rb b/test/integration/public_ip.rb index 889ef862f..d11e72949 100644 --- a/test/integration/public_ip.rb +++ b/test/integration/public_ip.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/record_set.rb b/test/integration/record_set.rb index 1982fd8dd..fa5c3331f 100644 --- a/test/integration/record_set.rb +++ b/test/integration/record_set.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resource = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/resource_group.rb b/test/integration/resource_group.rb index a0e3725dd..f6d43b182 100644 --- a/test/integration/resource_group.rb +++ b/test/integration/resource_group.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resource = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/resource_tag.rb b/test/integration/resource_tag.rb index 571e745e9..a271be37e 100644 --- a/test/integration/resource_tag.rb +++ b/test/integration/resource_tag.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resources = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/server.rb b/test/integration/server.rb index 0cf08575e..e267e61bb 100644 --- a/test/integration/server.rb +++ b/test/integration/server.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/server_custom_image.rb b/test/integration/server_custom_image.rb index 6de62969d..ad8ce7e29 100644 --- a/test/integration/server_custom_image.rb +++ b/test/integration/server_custom_image.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/sql_server.rb b/test/integration/sql_server.rb index dcf4e40df..ccf989298 100755 --- a/test/integration/sql_server.rb +++ b/test/integration/sql_server.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resources = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/storage_account.rb b/test/integration/storage_account.rb index 1cd0cbfd4..b94b0f2a5 100644 --- a/test/integration/storage_account.rb +++ b/test/integration/storage_account.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/subnet.rb b/test/integration/subnet.rb index c99424052..3e0c9a920 100644 --- a/test/integration/subnet.rb +++ b/test/integration/subnet.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/traffic_manager.rb b/test/integration/traffic_manager.rb index 872651d25..6ae33782d 100644 --- a/test/integration/traffic_manager.rb +++ b/test/integration/traffic_manager.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resources = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/virtual_machine_extension.rb b/test/integration/virtual_machine_extension.rb index 2bac2032b..a6067d2ea 100644 --- a/test/integration/virtual_machine_extension.rb +++ b/test/integration/virtual_machine_extension.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/virtual_network.rb b/test/integration/virtual_network.rb index c11a8df7b..08ea1438e 100644 --- a/test/integration/virtual_network.rb +++ b/test/integration/virtual_network.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/virtual_network_gateway.rb b/test/integration/virtual_network_gateway.rb index a7455426a..508a54aab 100644 --- a/test/integration/virtual_network_gateway.rb +++ b/test/integration/virtual_network_gateway.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resource = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/virtual_network_gateway_connection.rb b/test/integration/virtual_network_gateway_connection.rb index 0f27a421c..4398f2a08 100644 --- a/test/integration/virtual_network_gateway_connection.rb +++ b/test/integration/virtual_network_gateway_connection.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resource = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/virtual_network_gateway_connection_to_express_route.rb b/test/integration/virtual_network_gateway_connection_to_express_route.rb index 22d610d3b..edf64c849 100644 --- a/test/integration/virtual_network_gateway_connection_to_express_route.rb +++ b/test/integration/virtual_network_gateway_connection_to_express_route.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) resource = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'], diff --git a/test/integration/zone.rb b/test/integration/zone.rb index 33557b003..8936a5fe8 100644 --- a/test/integration/zone.rb +++ b/test/integration/zone.rb @@ -6,7 +6,7 @@ ###################### Keep it Uncommented! ###################### ######################################################################################################################## -azure_credentials = YAML.load_file('credentials/azure.yml') +azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__)) rs = Fog::Resources::AzureRM.new( tenant_id: azure_credentials['tenant_id'],