gitlab-fog-azure-rm 1.7.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +12 -0
- data/.rubocop_todo.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/gitlab-fog-azure-rm.gemspec +3 -3
- data/lib/fog/azurerm/constants.rb +0 -6
- data/lib/fog/azurerm/custom_fog_errors.rb +0 -41
- data/lib/fog/azurerm/docs/storage.md +1 -1
- data/lib/fog/azurerm/identity_encoding_filter.rb +12 -0
- data/lib/fog/azurerm/models/storage/directories.rb +6 -6
- data/lib/fog/azurerm/models/storage/directory.rb +4 -4
- data/lib/fog/azurerm/models/storage/file.rb +6 -3
- data/lib/fog/azurerm/models/storage/files.rb +8 -8
- data/lib/fog/azurerm/models/storage/storage_account.rb +4 -4
- data/lib/fog/azurerm/models/storage/storage_accounts.rb +6 -6
- data/lib/fog/azurerm/requests/storage/acquire_blob_lease.rb +2 -2
- data/lib/fog/azurerm/requests/storage/acquire_container_lease.rb +2 -2
- data/lib/fog/azurerm/requests/storage/check_container_exists.rb +2 -2
- data/lib/fog/azurerm/requests/storage/commit_blob_blocks.rb +2 -2
- data/lib/fog/azurerm/requests/storage/compare_container_blobs.rb +2 -2
- data/lib/fog/azurerm/requests/storage/copy_blob.rb +2 -2
- data/lib/fog/azurerm/requests/storage/copy_blob_from_uri.rb +2 -2
- data/lib/fog/azurerm/requests/storage/copy_object.rb +2 -2
- data/lib/fog/azurerm/requests/storage/create_block_blob.rb +2 -2
- data/lib/fog/azurerm/requests/storage/create_container.rb +2 -2
- data/lib/fog/azurerm/requests/storage/create_page_blob.rb +2 -2
- data/lib/fog/azurerm/requests/storage/delete_blob.rb +2 -2
- data/lib/fog/azurerm/requests/storage/delete_blob_https_url.rb +4 -4
- data/lib/fog/azurerm/requests/storage/delete_container.rb +2 -2
- data/lib/fog/azurerm/requests/storage/delete_object.rb +2 -2
- data/lib/fog/azurerm/requests/storage/delete_object_url.rb +2 -2
- data/lib/fog/azurerm/requests/storage/get_blob.rb +2 -2
- data/lib/fog/azurerm/requests/storage/get_blob_http_url.rb +5 -5
- data/lib/fog/azurerm/requests/storage/get_blob_https_url.rb +6 -5
- data/lib/fog/azurerm/requests/storage/get_blob_properties.rb +2 -2
- data/lib/fog/azurerm/requests/storage/get_blob_url.rb +4 -4
- data/lib/fog/azurerm/requests/storage/get_container_acl.rb +2 -2
- data/lib/fog/azurerm/requests/storage/get_container_properties.rb +2 -2
- data/lib/fog/azurerm/requests/storage/get_container_url.rb +4 -4
- data/lib/fog/azurerm/requests/storage/get_object.rb +2 -2
- data/lib/fog/azurerm/requests/storage/get_object_url.rb +2 -2
- data/lib/fog/azurerm/requests/storage/list_blobs.rb +2 -2
- data/lib/fog/azurerm/requests/storage/list_containers.rb +2 -2
- data/lib/fog/azurerm/requests/storage/put_blob_block.rb +2 -2
- data/lib/fog/azurerm/requests/storage/put_blob_http_url.rb +39 -0
- data/lib/fog/azurerm/requests/storage/put_blob_https_url.rb +4 -4
- data/lib/fog/azurerm/requests/storage/put_blob_metadata.rb +2 -2
- data/lib/fog/azurerm/requests/storage/put_blob_pages.rb +2 -2
- data/lib/fog/azurerm/requests/storage/put_blob_properties.rb +2 -2
- data/lib/fog/azurerm/requests/storage/put_container_acl.rb +2 -2
- data/lib/fog/azurerm/requests/storage/put_container_metadata.rb +2 -2
- data/lib/fog/azurerm/requests/storage/put_object_url.rb +2 -2
- data/lib/fog/azurerm/requests/storage/release_blob_lease.rb +2 -2
- data/lib/fog/azurerm/requests/storage/release_container_lease.rb +2 -2
- data/lib/fog/azurerm/requests/storage/save_page_blob.rb +2 -2
- data/lib/fog/azurerm/requests/storage/wait_blob_copy_operation_to_finish.rb +2 -2
- data/lib/fog/azurerm/storage.rb +62 -27
- data/lib/fog/azurerm/utilities/general.rb +2 -58
- data/lib/fog/azurerm/version.rb +1 -1
- data/lib/fog/azurerm.rb +4 -11
- data/rakefile +4 -5
- data/test/api_stub/models/storage/directory.rb +1 -1
- data/test/api_stub/models/storage/file.rb +1 -1
- data/test/api_stub/requests/storage/directory.rb +1 -1
- data/test/api_stub/requests/storage/file.rb +4 -4
- data/test/integration/README.md +5 -7
- data/test/integration/blob.rb +28 -36
- data/test/integration/container.rb +8 -39
- data/test/integration/credentials/azure.yml +4 -5
- data/test/models/storage/test_directories.rb +5 -5
- data/test/models/storage/test_directory.rb +2 -2
- data/test/models/storage/test_file.rb +16 -4
- data/test/models/storage/test_files.rb +8 -8
- data/test/requests/storage/test_acquire_blob_lease.rb +2 -2
- data/test/requests/storage/test_acquire_container_lease.rb +2 -2
- data/test/requests/storage/test_check_container_exists.rb +1 -1
- data/test/requests/storage/test_commit_blob_blocks.rb +2 -2
- data/test/requests/storage/test_compare_container_blobs.rb +2 -2
- data/test/requests/storage/test_copy_blob.rb +2 -2
- data/test/requests/storage/test_copy_blob_from_uri.rb +2 -2
- data/test/requests/storage/test_create_block_blob.rb +2 -2
- data/test/requests/storage/test_create_container.rb +2 -2
- data/test/requests/storage/test_create_page_blob.rb +2 -2
- data/test/requests/storage/test_delete_blob.rb +2 -2
- data/test/requests/storage/test_delete_blob_https_url.rb +7 -10
- data/test/requests/storage/test_delete_container.rb +2 -2
- data/test/requests/storage/test_delete_object.rb +2 -2
- data/test/requests/storage/test_get_blob.rb +2 -2
- data/test/requests/storage/test_get_blob_encoding.rb +45 -0
- data/test/requests/storage/test_get_blob_http_url.rb +13 -9
- data/test/requests/storage/test_get_blob_https_url.rb +95 -13
- data/test/requests/storage/test_get_blob_properties.rb +2 -2
- data/test/requests/storage/test_get_blob_url.rb +15 -24
- data/test/requests/storage/test_get_container_acl.rb +2 -2
- data/test/requests/storage/test_get_container_properties.rb +2 -2
- data/test/requests/storage/test_get_container_url.rb +5 -8
- data/test/requests/storage/test_get_object.rb +2 -2
- data/test/requests/storage/test_list_blobs.rb +2 -2
- data/test/requests/storage/test_list_containers.rb +2 -2
- data/test/requests/storage/test_put_blob_block.rb +2 -2
- data/test/requests/storage/test_put_blob_http_url.rb +33 -0
- data/test/requests/storage/test_put_blob_https_url.rb +8 -11
- data/test/requests/storage/test_put_blob_metadata.rb +2 -2
- data/test/requests/storage/test_put_blob_pages.rb +2 -2
- data/test/requests/storage/test_put_blob_properties.rb +2 -2
- data/test/requests/storage/test_put_container_acl.rb +2 -2
- data/test/requests/storage/test_put_container_metadata.rb +2 -2
- data/test/requests/storage/test_release_blob_lease.rb +2 -2
- data/test/requests/storage/test_release_container_lease.rb +2 -2
- data/test/requests/storage/test_save_page_blob.rb +2 -2
- data/test/requests/storage/test_wait_blob_copy_operation_to_finish.rb +15 -6
- data/test/test_helper.rb +38 -698
- metadata +27 -36
- data/lib/fog/azurerm/credentials.rb +0 -44
- data/lib/fog/azurerm/models/resources/azure_resource.rb +0 -25
- data/lib/fog/azurerm/models/resources/azure_resources.rb +0 -40
- data/lib/fog/azurerm/models/resources/dependency.rb +0 -27
- data/lib/fog/azurerm/models/resources/deployment.rb +0 -65
- data/lib/fog/azurerm/models/resources/deployments.rb +0 -30
- data/lib/fog/azurerm/models/resources/provider.rb +0 -27
- data/lib/fog/azurerm/models/resources/provider_resource_type.rb +0 -22
- data/lib/fog/azurerm/models/resources/resource_group.rb +0 -34
- data/lib/fog/azurerm/models/resources/resource_groups.rb +0 -29
- data/test/integration/storage_account.rb +0 -135
- data/test/smoke_tests/compute/test_resource_group_smoke.rb +0 -37
- data/test/test_credentials.rb +0 -63
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'fog/azurerm'
|
2
|
-
require 'minitest/autorun'
|
3
|
-
# Integration smoke test class to test resource group
|
4
|
-
class TestResourceGroupSmoke < MiniTest::Test
|
5
|
-
def setup
|
6
|
-
if !ENV['TENANT_ID'].nil? && !ENV['CLIENT_ID'].nil? && !ENV['CLIENT_SECRET'].nil? && !ENV['SUBSCRIPTION_ID'].nil?
|
7
|
-
@resource = Fog::Resources::AzureRM.new(
|
8
|
-
tenant_id: ENV['TENANT_ID'],
|
9
|
-
client_id: ENV['CLIENT_ID'],
|
10
|
-
client_secret: ENV['CLIENT_SECRET'],
|
11
|
-
subscription_id: ENV['SUBSCRIPTION_ID']
|
12
|
-
)
|
13
|
-
else
|
14
|
-
azure_credentials = YAML.load_file('../../integration/credentials/azure.yml')
|
15
|
-
@resource = Fog::Resources::AzureRM.new(
|
16
|
-
tenant_id: azure_credentials['tenant_id'],
|
17
|
-
client_id: azure_credentials['client_id'],
|
18
|
-
client_secret: azure_credentials['client_secret'],
|
19
|
-
subscription_id: azure_credentials['subscription_id']
|
20
|
-
)
|
21
|
-
end
|
22
|
-
time = Time.now.to_f.to_s
|
23
|
-
new_time = time.split(/\W+/).join
|
24
|
-
@resource_group_name = "fog-smoke-test-rg-#{new_time}"
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_resource_group
|
28
|
-
puts 'In Smoke tests'
|
29
|
-
resource_group = @resource.resource_groups.create(name: @resource_group_name, location: 'eastus')
|
30
|
-
assert_instance_of Fog::Resources::AzureRM::ResourceGroup, resource_group
|
31
|
-
|
32
|
-
resource_group = @resource.resource_groups.get(@resource_group_name)
|
33
|
-
assert_instance_of Fog::Resources::AzureRM::ResourceGroup, resource_group
|
34
|
-
|
35
|
-
resource_group.destroy
|
36
|
-
end
|
37
|
-
end
|
data/test/test_credentials.rb
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
require File.expand_path 'test_helper', __dir__
|
2
|
-
|
3
|
-
# Test class for Credentials Helper Class
|
4
|
-
class TestCredentials < Minitest::Test
|
5
|
-
def setup
|
6
|
-
@creds = credentials
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_methods
|
10
|
-
methods = [
|
11
|
-
:get_credentials,
|
12
|
-
:get_token
|
13
|
-
]
|
14
|
-
methods.each do |method|
|
15
|
-
assert Fog::Credentials::AzureRM.respond_to? method
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_get_credentials_method_with_same_client
|
20
|
-
cred_obj_one = Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret])
|
21
|
-
cred_obj_two = Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret])
|
22
|
-
assert_equal cred_obj_one.object_id, cred_obj_two.object_id
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_get_credentials_method_with_different_client
|
26
|
-
cred_obj_one = Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret])
|
27
|
-
@creds[:client_id] = '<NEW-CLIENT-ID>'
|
28
|
-
cred_obj_two = Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret])
|
29
|
-
refute_equal cred_obj_one.object_id, cred_obj_two.object_id
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_get_token_method_with_default_environment
|
33
|
-
Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret])
|
34
|
-
token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
|
35
|
-
token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
36
|
-
assert_equal Fog::Credentials::AzureRM.get_token(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret]), 'Bearer <some-token>'
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_get_token_method_with_china_environment
|
41
|
-
Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret], Fog::AzureRM::ENVIRONMENT_AZURE_CHINA_CLOUD)
|
42
|
-
token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
|
43
|
-
token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
44
|
-
assert_equal Fog::Credentials::AzureRM.get_token(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret]), 'Bearer <some-token>'
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_get_token_method_with_us_government_environment
|
49
|
-
Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret], Fog::AzureRM::ENVIRONMENT_AZURE_US_GOVERNMENT)
|
50
|
-
token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
|
51
|
-
token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
52
|
-
assert_equal Fog::Credentials::AzureRM.get_token(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret]), 'Bearer <some-token>'
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_get_token_method_with_german_environment
|
57
|
-
Fog::Credentials::AzureRM.get_credentials(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret], Fog::AzureRM::ENVIRONMENT_AZURE_GERMAN_CLOUD)
|
58
|
-
token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
|
59
|
-
token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
60
|
-
assert_equal Fog::Credentials::AzureRM.get_token(@creds[:tenant_id], @creds[:client_id], @creds[:client_secret]), 'Bearer <some-token>'
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|