fog-azure-rm-temp 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.arclint +8 -0
- data/CHANGELOG.md +12 -3
- data/fog-azure-rm.gemspec +1 -1
- data/lib/fog/azurerm.rb +0 -1
- data/lib/fog/azurerm/docs/compute.md +3 -3
- data/lib/fog/azurerm/docs/storage.md +0 -66
- data/lib/fog/azurerm/models/compute/availability_set.rb +5 -5
- data/lib/fog/azurerm/requests/compute/create_availability_set.rb +6 -6
- data/lib/fog/azurerm/storage.rb +0 -18
- data/lib/fog/azurerm/version.rb +1 -1
- data/test/api_stub.rb +0 -2
- data/test/api_stub/requests/compute/availability_set.rb +4 -4
- data/test/integration/availability_set.rb +2 -2
- data/test/models/compute/test_availability_set.rb +1 -1
- data/test/requests/compute/test_create_availability_set.rb +4 -4
- data/test/test_helper.rb +1 -15
- metadata +11 -36
- data/lib/fog/azurerm/models/storage/recovery_vault.rb +0 -50
- data/lib/fog/azurerm/models/storage/recovery_vaults.rb +0 -27
- data/lib/fog/azurerm/requests/storage/create_or_update_recovery_vault.rb +0 -54
- data/lib/fog/azurerm/requests/storage/delete_recovery_vault.rb +0 -35
- data/lib/fog/azurerm/requests/storage/disable_backup_protection.rb +0 -60
- data/lib/fog/azurerm/requests/storage/enable_backup_protection.rb +0 -61
- data/lib/fog/azurerm/requests/storage/get_all_backup_jobs.rb +0 -56
- data/lib/fog/azurerm/requests/storage/get_backup_container.rb +0 -53
- data/lib/fog/azurerm/requests/storage/get_backup_item.rb +0 -58
- data/lib/fog/azurerm/requests/storage/get_backup_job_for_vm.rb +0 -53
- data/lib/fog/azurerm/requests/storage/get_backup_protection_policy.rb +0 -64
- data/lib/fog/azurerm/requests/storage/get_recovery_vault.rb +0 -49
- data/lib/fog/azurerm/requests/storage/list_recovery_vaults.rb +0 -48
- data/lib/fog/azurerm/requests/storage/set_recovery_vault_context.rb +0 -36
- data/lib/fog/azurerm/requests/storage/start_backup.rb +0 -54
- data/test/api_stub/models/storage/recovery_vault.rb +0 -23
- data/test/api_stub/requests/storage/recovery_vault.rb +0 -189
- data/test/models/storage/test_recovery_vault.rb +0 -61
- data/test/models/storage/test_recovery_vaults.rb +0 -47
- data/test/requests/storage/test_create_recovery_vault.rb +0 -35
- data/test/requests/storage/test_delete_recovery_vault.rb +0 -34
- data/test/requests/storage/test_disable_backup_protection.rb +0 -52
- data/test/requests/storage/test_enable_backup_protection.rb +0 -66
- data/test/requests/storage/test_get_all_backup_jobs.rb +0 -35
- data/test/requests/storage/test_get_backup_container.rb +0 -35
- data/test/requests/storage/test_get_backup_item.rb +0 -35
- data/test/requests/storage/test_get_backup_job_for_vm.rb +0 -26
- data/test/requests/storage/test_get_backup_protection_policy.rb +0 -35
- data/test/requests/storage/test_get_recovery_vault.rb +0 -35
- data/test/requests/storage/test_list_recovery_vault.rb +0 -35
- data/test/requests/storage/test_set_recovery_vault_context.rb +0 -34
- data/test/requests/storage/test_start_backup.rb +0 -55
@@ -1,35 +0,0 @@
|
|
1
|
-
require File.expand_path '../../test_helper', __dir__
|
2
|
-
|
3
|
-
# Test class for Get Recovery Vault request
|
4
|
-
class TestGetRecoveryVault < Minitest::Test
|
5
|
-
def setup
|
6
|
-
@service = Fog::Storage::AzureRM.new(credentials)
|
7
|
-
@token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_get_recovery_vault_success
|
11
|
-
response = ApiStub::Requests::Storage::RecoveryVault.get_recovery_vault_response
|
12
|
-
@token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
13
|
-
RestClient.stub :get, response do
|
14
|
-
assert_equal @service.get_recovery_vault('fog-test-rg', 'fog-test-vault'), JSON.parse(response)['value'][0]
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_get_recovery_vault_argument_error
|
20
|
-
@token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
21
|
-
assert_raises ArgumentError do
|
22
|
-
@service.get_recovery_vault('fog-test-rg')
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_get_recovery_vault_exception
|
28
|
-
response = -> { fail Exception.new('mocked exception') }
|
29
|
-
@token_provider.stub :get_authentication_header, response do
|
30
|
-
assert_raises Exception do
|
31
|
-
@service.get_recovery_vault('fog-test-rg', 'fog-test-vault')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require File.expand_path '../../test_helper', __dir__
|
2
|
-
|
3
|
-
# Test class for List Recovery Vault request
|
4
|
-
class TestListRecoveryVault < Minitest::Test
|
5
|
-
def setup
|
6
|
-
@service = Fog::Storage::AzureRM.new(credentials)
|
7
|
-
@token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_list_recovery_vault_success
|
11
|
-
response = ApiStub::Requests::Storage::RecoveryVault.get_recovery_vault_response
|
12
|
-
@token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
13
|
-
RestClient.stub :get, response do
|
14
|
-
assert_equal @service.list_recovery_vaults('fog-test-rg'), JSON.parse(response)['value']
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_list_recovery_vault_argument_error
|
20
|
-
@token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
21
|
-
assert_raises ArgumentError do
|
22
|
-
@service.list_recovery_vaults
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_list_recovery_vault_exception
|
28
|
-
response = -> { fail Exception.new('mocked exception') }
|
29
|
-
@token_provider.stub :get_authentication_header, response do
|
30
|
-
assert_raises Exception do
|
31
|
-
@service.list_recovery_vaults('fog-test-rg')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require File.expand_path '../../test_helper', __dir__
|
2
|
-
|
3
|
-
# Test class for Set Recovery Vault Context
|
4
|
-
class TestSetRecoveryVaultContext < Minitest::Test
|
5
|
-
def setup
|
6
|
-
@service = Fog::Storage::AzureRM.new(credentials)
|
7
|
-
@token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_set_recovery_vault_context_success
|
11
|
-
@token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
12
|
-
RestClient.stub :get, true do
|
13
|
-
assert_equal @service.set_recovery_vault_context('fog-test-rg', 'fog-test-vault'), true
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_set_recovery_vault_context_argument_error
|
19
|
-
@token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
20
|
-
assert_raises ArgumentError do
|
21
|
-
@service.set_recovery_vault_context('fog-test-rg')
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_set_recovery_vault_context_exception
|
27
|
-
response = -> { fail Exception.new('mocked exception') }
|
28
|
-
@token_provider.stub :get_authentication_header, response do
|
29
|
-
assert_raises Exception do
|
30
|
-
@service.set_recovery_vault_context('fog-test-rg', 'fog-test-vault')
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require File.expand_path '../../test_helper', __dir__
|
2
|
-
|
3
|
-
class TestStartBackup < Minitest::Test
|
4
|
-
def setup
|
5
|
-
@service = Fog::Storage::AzureRM.new(credentials)
|
6
|
-
@token_provider = Fog::Credentials::AzureRM.instance_variable_get(:@token_provider)
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_start_backup_success
|
10
|
-
backup_item_response = ApiStub::Requests::Storage::RecoveryVault.get_backup_item_response
|
11
|
-
@service.stub :get_backup_job_for_vm, nil do
|
12
|
-
@service.stub :get_backup_item, JSON.parse(backup_item_response)['value'] do
|
13
|
-
@token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
14
|
-
RestClient.stub :post, true do
|
15
|
-
assert_equal @service.start_backup('fog-test-rg', 'fog-test-vault', 'fog-test-vm', 'fog-test-vm-rg'), true
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_start_backup_job_running
|
23
|
-
backup_job_response = ApiStub::Requests::Storage::RecoveryVault.get_backup_job_for_vm_response
|
24
|
-
@service.stub :get_backup_job_for_vm, JSON.parse(backup_job_response) do
|
25
|
-
assert_equal @service.start_backup('fog-test-rg', 'fog-test-vault', 'fog-test-vm', 'fog-test-vm-rg'), false
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_start_backup_argument_error
|
30
|
-
backup_item_response = ApiStub::Requests::Storage::RecoveryVault.get_backup_item_response
|
31
|
-
@service.stub :get_backup_job_for_vm, nil do
|
32
|
-
@service.stub :get_backup_item, JSON.parse(backup_item_response)['value'] do
|
33
|
-
@token_provider.stub :get_authentication_header, 'Bearer <some-token>' do
|
34
|
-
assert_raises ArgumentError do
|
35
|
-
@service.start_backup('fog-test-rg', 'fog-test-vault')
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_start_backup_exception
|
43
|
-
backup_item_response = ApiStub::Requests::Storage::RecoveryVault.get_backup_item_response
|
44
|
-
rest_client_response = -> { fail Exception.new('mocked exception') }
|
45
|
-
@service.stub :get_backup_job_for_vm, nil do
|
46
|
-
@service.stub :get_backup_item, JSON.parse(backup_item_response)['value'] do
|
47
|
-
@token_provider.stub :get_authentication_header, rest_client_response do
|
48
|
-
assert_raises Exception do
|
49
|
-
assert_equal @service.start_backup('fog-test-rg', 'fog-test-vault', 'fog-test-vm', 'fog-test-vm-rg'), true
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|