fog-azure-rm-temp 0.0.4 → 0.0.5
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/.travis.yml +28 -14
- data/CHANGELOG.md +77 -0
- data/CONTRIBUTORS.md +4 -0
- data/fog-azure-rm.gemspec +3 -2
- data/lib/fog/azurerm.rb +1 -0
- data/lib/fog/azurerm/async_response.rb +9 -1
- data/lib/fog/azurerm/compute.rb +3 -1
- data/lib/fog/azurerm/constants.rb +11 -3
- data/lib/fog/azurerm/dns.rb +3 -1
- data/lib/fog/azurerm/docs/application_gateway.md +119 -117
- data/lib/fog/azurerm/docs/compute.md +299 -202
- data/lib/fog/azurerm/docs/dns.md +44 -43
- data/lib/fog/azurerm/docs/key_vault.md +31 -28
- data/lib/fog/azurerm/docs/network.md +407 -404
- data/lib/fog/azurerm/docs/resources.md +52 -49
- data/lib/fog/azurerm/docs/sql.md +56 -54
- data/lib/fog/azurerm/docs/storage.md +92 -157
- data/lib/fog/azurerm/docs/traffic_manager.md +55 -53
- data/lib/fog/azurerm/models/application_gateway/gateway.rb +5 -1
- data/lib/fog/azurerm/models/compute/availability_set.rb +4 -1
- data/lib/fog/azurerm/models/compute/managed_disk.rb +0 -1
- data/lib/fog/azurerm/models/compute/server.rb +61 -11
- data/lib/fog/azurerm/models/compute/servers.rb +2 -2
- data/lib/fog/azurerm/models/dns/a_record.rb +15 -0
- data/lib/fog/azurerm/models/dns/cname_record.rb +15 -0
- data/lib/fog/azurerm/models/dns/record_set.rb +20 -8
- data/lib/fog/azurerm/models/key_vault/vault.rb +3 -1
- data/lib/fog/azurerm/models/network/load_balancer.rb +3 -1
- data/lib/fog/azurerm/models/network/local_network_gateway.rb +3 -1
- data/lib/fog/azurerm/models/network/network_interface.rb +3 -1
- data/lib/fog/azurerm/models/network/network_security_group.rb +4 -2
- data/lib/fog/azurerm/models/network/public_ip.rb +4 -2
- data/lib/fog/azurerm/models/network/virtual_network.rb +4 -2
- data/lib/fog/azurerm/models/resources/resource_group.rb +3 -1
- data/lib/fog/azurerm/models/sql/sql_database.rb +3 -3
- data/lib/fog/azurerm/models/sql/sql_server.rb +3 -2
- data/lib/fog/azurerm/models/storage/directories.rb +6 -1
- data/lib/fog/azurerm/models/storage/file.rb +2 -0
- data/lib/fog/azurerm/models/storage/storage_account.rb +4 -1
- data/lib/fog/azurerm/models/storage/storage_accounts.rb +7 -0
- data/lib/fog/azurerm/models/traffic_manager/traffic_manager_profile.rb +3 -1
- data/lib/fog/azurerm/requests/application_gateway/check_ag_exists.rb +1 -1
- data/lib/fog/azurerm/requests/application_gateway/create_or_update_application_gateway.rb +1 -0
- data/lib/fog/azurerm/requests/compute/attach_data_disk_to_vm.rb +2 -2
- data/lib/fog/azurerm/requests/compute/check_availability_set_exists.rb +1 -1
- data/lib/fog/azurerm/requests/compute/check_managed_disk_exists.rb +1 -1
- data/lib/fog/azurerm/requests/compute/check_vm_exists.rb +1 -1
- data/lib/fog/azurerm/requests/compute/check_vm_extension_exists.rb +2 -2
- data/lib/fog/azurerm/requests/compute/create_availability_set.rb +4 -2
- data/lib/fog/azurerm/requests/compute/create_image.rb +68 -0
- data/lib/fog/azurerm/requests/compute/create_virtual_machine.rb +302 -135
- data/lib/fog/azurerm/requests/compute/delete_image.rb +29 -0
- data/lib/fog/azurerm/requests/compute/get_image.rb +45 -0
- data/lib/fog/azurerm/requests/compute/get_virtual_machine.rb +4 -2
- data/lib/fog/azurerm/requests/dns/check_record_set_exists.rb +1 -1
- data/lib/fog/azurerm/requests/dns/check_zone_exists.rb +3 -2
- data/lib/fog/azurerm/requests/dns/create_or_update_record_set.rb +3 -2
- data/lib/fog/azurerm/requests/dns/create_or_update_zone.rb +1 -2
- data/lib/fog/azurerm/requests/key_vault/check_vault_exists.rb +1 -1
- data/lib/fog/azurerm/requests/key_vault/create_or_update_vault.rb +1 -0
- data/lib/fog/azurerm/requests/network/check_express_route_cir_auth_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_express_route_circuit_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_load_balancer_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_local_net_gateway_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_net_sec_group_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_net_sec_rule_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_network_interface_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_public_ip_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_subnet_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_virtual_network_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_vnet_gateway_connection_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/check_vnet_gateway_exists.rb +1 -1
- data/lib/fog/azurerm/requests/network/create_load_balancer.rb +4 -4
- data/lib/fog/azurerm/requests/network/create_or_update_express_route_circuit.rb +1 -1
- data/lib/fog/azurerm/requests/network/create_or_update_local_network_gateway.rb +1 -2
- data/lib/fog/azurerm/requests/network/create_or_update_network_interface.rb +4 -3
- data/lib/fog/azurerm/requests/network/create_or_update_network_security_group.rb +4 -3
- data/lib/fog/azurerm/requests/network/create_or_update_public_ip.rb +5 -3
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb +4 -3
- data/lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway_connection.rb +1 -1
- data/lib/fog/azurerm/requests/resources/check_azure_resource_exists.rb +4 -4
- data/lib/fog/azurerm/requests/resources/create_resource_group.rb +2 -1
- data/lib/fog/azurerm/requests/resources/delete_resource_tag.rb +4 -4
- data/lib/fog/azurerm/requests/resources/tag_resource.rb +4 -4
- data/lib/fog/azurerm/requests/sql/create_or_update_database.rb +13 -10
- data/lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb +8 -5
- data/lib/fog/azurerm/requests/storage/check_storage_account_exists.rb +1 -1
- data/lib/fog/azurerm/requests/storage/create_storage_account.rb +4 -2
- data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_endpoint_exists.rb +1 -1
- data/lib/fog/azurerm/requests/traffic_manager/check_traffic_manager_profile_exists.rb +1 -1
- data/lib/fog/azurerm/requests/traffic_manager/create_or_update_traffic_manager_profile.rb +13 -3
- data/lib/fog/azurerm/storage.rb +0 -18
- data/lib/fog/azurerm/utilities/general.rb +21 -10
- data/lib/fog/azurerm/version.rb +1 -1
- data/rake-script.sh +7 -1
- data/rakefile +1 -1
- data/test/api_stub.rb +19 -2
- data/test/api_stub/models/compute/server.rb +21 -5
- data/test/api_stub/requests/compute/image.rb +41 -0
- data/test/api_stub/requests/compute/virtual_machine.rb +60 -62
- data/test/api_stub/requests/resources/resource_group.rb +1 -1
- data/test/integration/application_gateway.rb +8 -1
- data/test/integration/availability_set.rb +9 -2
- data/test/integration/external_load_balancer.rb +2 -1
- data/test/integration/internal_load_balancer.rb +2 -1
- data/test/integration/key_vault.rb +2 -1
- data/test/integration/managed_disk.rb +10 -5
- data/test/integration/network_interface.rb +2 -1
- data/test/integration/network_security_group.rb +2 -1
- data/test/integration/public_ip.rb +2 -1
- data/test/integration/record_set.rb +5 -5
- data/test/integration/resource_group.rb +5 -2
- data/test/integration/resource_tag.rb +4 -2
- data/test/integration/server.rb +113 -23
- data/test/integration/server_custom_image.rb +120 -20
- data/test/integration/sql_server.rb +10 -2
- data/test/integration/storage_account.rb +32 -20
- data/test/integration/traffic_manager.rb +6 -1
- data/test/integration/virtual_network.rb +2 -1
- data/test/integration/virtual_network_gateway_connection.rb +3 -3
- data/test/models/application_gateway/test_gateway.rb +2 -1
- data/test/models/compute/test_availability_set.rb +2 -1
- data/test/models/compute/test_managed_disk.rb +2 -1
- data/test/models/compute/test_server.rb +13 -4
- data/test/models/dns/test_zone.rb +2 -1
- data/test/models/key_vault/test_vault.rb +2 -1
- data/test/models/network/test_load_balancer.rb +2 -1
- data/test/models/network/test_network_interface.rb +2 -1
- data/test/models/network/test_network_security_group.rb +2 -1
- data/test/models/network/test_public_ip.rb +2 -1
- data/test/models/network/test_virtual_network.rb +2 -1
- data/test/models/resources/test_resource_group.rb +2 -1
- data/test/models/sql/test_database.rb +2 -1
- data/test/models/sql/test_sql_server.rb +2 -1
- data/test/models/storage/test_storage_account.rb +2 -1
- data/test/models/traffic_manager/test_traffic_manager_profile.rb +2 -1
- data/test/requests/application_gateway/test_check_ag_exists.rb +11 -4
- data/test/requests/compute/test_attach_data_disk_to_vm.rb +2 -2
- data/test/requests/compute/test_check_availability_set_exists.rb +9 -2
- data/test/requests/compute/test_check_managed_disk_exists.rb +9 -2
- data/test/requests/compute/test_check_vm_exists.rb +9 -2
- data/test/requests/compute/test_check_vm_extension_exists.rb +9 -2
- data/test/requests/compute/test_create_image.rb +27 -0
- data/test/requests/compute/test_create_virtual_machine.rb +41 -17
- data/test/requests/compute/test_delete_image.rb +23 -0
- data/test/requests/compute/test_get_image.rb +23 -0
- data/test/requests/dns/test_check_record_set_exists.rb +9 -2
- data/test/requests/dns/test_check_zone_exists.rb +16 -2
- data/test/requests/key_vault/test_check_vault_exists.rb +9 -2
- data/test/requests/network/test_check_express_route_cir_auth_exists.rb +9 -2
- data/test/requests/network/test_check_express_route_circuit_exists.rb +9 -2
- data/test/requests/network/test_check_load_balancer_exists.rb +9 -2
- data/test/requests/network/test_check_local_net_gateway_exists.rb +11 -4
- data/test/requests/network/test_check_net_sec_group_exists.rb +9 -2
- data/test/requests/network/test_check_net_sec_rule_exists.rb +9 -2
- data/test/requests/network/test_check_network_interface_exists.rb +9 -2
- data/test/requests/network/test_check_public_ip_exists.rb +9 -2
- data/test/requests/network/test_check_subnet_exists.rb +9 -2
- data/test/requests/network/test_check_virtual_network_exists.rb +10 -4
- data/test/requests/network/test_check_vnet_gateway_connection_exists.rb +9 -2
- data/test/requests/network/test_check_vnet_gateway_exists.rb +9 -2
- data/test/requests/network/test_create_load_balancer.rb +3 -2
- data/test/requests/network/test_create_network_interface.rb +4 -3
- data/test/requests/network/test_create_or_update_network_security_group.rb +3 -2
- data/test/requests/network/test_create_or_update_virtual_network.rb +5 -3
- data/test/requests/network/test_create_public_ip.rb +3 -2
- data/test/requests/network/test_update_public_ip.rb +3 -2
- data/test/requests/resources/test_create_resource_group.rb +3 -2
- data/test/requests/resources/test_delete_resource_tag.rb +3 -3
- data/test/requests/resources/test_tag_resource.rb +3 -3
- data/test/requests/storage/test_check_storage_account_exists.rb +8 -1
- data/test/requests/traffic_manager/test_check_traffic_manager_endpoint_exists.rb +9 -2
- data/test/requests/traffic_manager/test_check_traffic_manager_profile_exists.rb +9 -2
- data/test/test_helper.rb +5 -14
- metadata +67 -75
- 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
@@ -44,10 +44,13 @@ begin
|
|
44
44
|
###################### Create Sql Server ######################
|
45
45
|
########################################################################################################################
|
46
46
|
|
47
|
+
tags = { key1: 'value1', key2: 'value2' }
|
48
|
+
|
47
49
|
sql_server = azure_sql_service.sql_servers.create(
|
48
50
|
name: server_name,
|
49
51
|
resource_group: 'TestRG-SQL',
|
50
52
|
location: LOCATION,
|
53
|
+
tags: tags,
|
51
54
|
version: '2.0',
|
52
55
|
administrator_login: 'testserveradmin',
|
53
56
|
administrator_login_password: 'db@admin=123'
|
@@ -67,10 +70,11 @@ begin
|
|
67
70
|
########################################################################################################################
|
68
71
|
|
69
72
|
sql_database = azure_sql_service.sql_databases.create(
|
73
|
+
name: database_name,
|
70
74
|
resource_group: 'TestRG-SQL',
|
71
75
|
location: LOCATION,
|
72
|
-
|
73
|
-
|
76
|
+
tags: tags,
|
77
|
+
server_name: server_name
|
74
78
|
)
|
75
79
|
puts "Created sql database: #{sql_database.name}"
|
76
80
|
|
@@ -112,6 +116,7 @@ begin
|
|
112
116
|
firewall_rule = azure_sql_service.firewall_rules.create(
|
113
117
|
resource_group: 'TestRG-SQL',
|
114
118
|
server_name: server_name,
|
119
|
+
tags: tags,
|
115
120
|
name: 'test-rule-name',
|
116
121
|
start_ip: '10.10.10.10',
|
117
122
|
end_ip: '10.10.10.11'
|
@@ -167,8 +172,11 @@ begin
|
|
167
172
|
########################################################################################################################
|
168
173
|
###################### CleanUp ######################
|
169
174
|
########################################################################################################################
|
175
|
+
|
170
176
|
resource_group = resources.resource_groups.get('TestRG-SQL')
|
171
177
|
resource_group.destroy
|
178
|
+
|
179
|
+
puts 'Integration test for SQL ran successfully!'
|
172
180
|
rescue
|
173
181
|
puts 'Integration Test for sql server is failing'
|
174
182
|
resource_group.destroy unless resource_group.nil?
|
@@ -23,13 +23,24 @@ storage = Fog::Storage::AzureRM.new(
|
|
23
23
|
environment: azure_credentials['environment']
|
24
24
|
)
|
25
25
|
|
26
|
+
########################################################################################################################
|
27
|
+
###################### Resource names #####################
|
28
|
+
########################################################################################################################
|
29
|
+
|
30
|
+
time = current_time
|
31
|
+
resource_group_name = "TestRG-SA-#{time}"
|
32
|
+
storage_account_name = "teststorage#{time}"
|
33
|
+
lrs_storage_account = "lrs#{time}"
|
34
|
+
grs_storage_account = "grs#{time}"
|
35
|
+
premium_storage_acc = "premsa#{time}"
|
36
|
+
|
26
37
|
########################################################################################################################
|
27
38
|
###################### Prerequisites ######################
|
28
39
|
########################################################################################################################
|
29
40
|
|
30
41
|
begin
|
31
42
|
resource_group = rs.resource_groups.create(
|
32
|
-
name:
|
43
|
+
name: resource_group_name,
|
33
44
|
location: LOCATION
|
34
45
|
)
|
35
46
|
|
@@ -37,26 +48,27 @@ begin
|
|
37
48
|
###################### Check Storage Account name Availability ######################
|
38
49
|
########################################################################################################################
|
39
50
|
|
40
|
-
storage_account_avail = storage.storage_accounts.check_name_availability(
|
51
|
+
storage_account_avail = storage.storage_accounts.check_name_availability(storage_account_name)
|
41
52
|
puts storage_account_avail ? 'Storage Account name available' : 'Storage Account name unavailable'
|
42
53
|
|
43
54
|
########################################################################################################################
|
44
55
|
###################### Check Subnet Exists? ######################
|
45
56
|
########################################################################################################################
|
46
57
|
|
47
|
-
|
48
|
-
|
49
|
-
flag = storage.storage_accounts.check_storage_account_exists('TestRG-SA', lrs_storage_account)
|
58
|
+
flag = storage.storage_accounts.check_storage_account_exists(resource_group_name, lrs_storage_account)
|
50
59
|
puts "Storage Account doesn't exist." unless flag
|
51
60
|
|
52
61
|
########################################################################################################################
|
53
62
|
############### Create A Standard Storage Account of Replication: LRS (Locally-redundant storage) ###############
|
54
63
|
########################################################################################################################
|
55
64
|
|
65
|
+
tags = { key1: 'value1', key2: 'value2' }
|
66
|
+
|
56
67
|
storage_account = storage.storage_accounts.create(
|
57
68
|
name: lrs_storage_account,
|
58
69
|
location: LOCATION,
|
59
|
-
resource_group:
|
70
|
+
resource_group: resource_group_name,
|
71
|
+
tags: tags
|
60
72
|
)
|
61
73
|
puts "Created storage account for standard lrs replication: #{storage_account.name}"
|
62
74
|
|
@@ -64,15 +76,14 @@ begin
|
|
64
76
|
############### Create A Standard Storage Account of Replication: GRS (Geo-redundant storage) #################
|
65
77
|
########################################################################################################################
|
66
78
|
|
67
|
-
grs_storage_account = "grs#{current_time}"
|
68
|
-
|
69
79
|
storage_account = storage.storage_accounts.create(
|
70
80
|
name: grs_storage_account,
|
71
81
|
location: LOCATION,
|
72
|
-
resource_group:
|
82
|
+
resource_group: resource_group_name,
|
73
83
|
sku_name: Fog::ARM::Storage::Models::SkuTier::Standard,
|
74
84
|
replication: 'GRS',
|
75
|
-
encryption: true
|
85
|
+
encryption: true,
|
86
|
+
tags: tags
|
76
87
|
)
|
77
88
|
puts "Created storage account for standard grs replication: #{storage_account.name}"
|
78
89
|
|
@@ -80,14 +91,13 @@ begin
|
|
80
91
|
########### Create A Premium(SSD) Storage Account of its only Replication: LRS (Locally-redundant storage) ##########
|
81
92
|
########################################################################################################################
|
82
93
|
|
83
|
-
premium_storage_acc = "premsa#{current_time}"
|
84
|
-
|
85
94
|
storage_account = storage.storage_accounts.create(
|
86
95
|
name: premium_storage_acc,
|
87
96
|
location: LOCATION,
|
88
|
-
resource_group:
|
97
|
+
resource_group: resource_group_name,
|
89
98
|
sku_name: Fog::ARM::Storage::Models::SkuTier::Premium,
|
90
|
-
replication: 'LRS'
|
99
|
+
replication: 'LRS',
|
100
|
+
tags: tags
|
91
101
|
)
|
92
102
|
puts "Created storage account for premium lrs replication: #{storage_account.name}"
|
93
103
|
|
@@ -95,28 +105,30 @@ begin
|
|
95
105
|
###################### Get and Update Storage Account ######################
|
96
106
|
########################################################################################################################
|
97
107
|
|
98
|
-
premium_storage_account = storage.storage_accounts.get(
|
108
|
+
premium_storage_account = storage.storage_accounts.get(resource_group_name, premium_storage_acc)
|
99
109
|
puts "Get storage account: #{premium_storage_account.name}"
|
100
110
|
premium_storage_account.update(encryption: true)
|
101
|
-
puts 'Updated
|
111
|
+
puts 'Updated encryption of storage account'
|
102
112
|
|
103
113
|
########################################################################################################################
|
104
114
|
###################### Get and Delete Storage Account ######################
|
105
115
|
########################################################################################################################
|
106
116
|
|
107
|
-
standard_storage_account = storage.storage_accounts.get(
|
117
|
+
standard_storage_account = storage.storage_accounts.get(resource_group_name, lrs_storage_account)
|
108
118
|
puts "Deleted storage account for standard lrs replication: #{standard_storage_account.destroy}"
|
109
|
-
standard_storage_account = storage.storage_accounts.get(
|
119
|
+
standard_storage_account = storage.storage_accounts.get(resource_group_name, grs_storage_account)
|
110
120
|
puts "Deleted storage account for standard grs replication: #{standard_storage_account.destroy}"
|
111
|
-
premium_storage_account = storage.storage_accounts.get(
|
121
|
+
premium_storage_account = storage.storage_accounts.get(resource_group_name, premium_storage_acc)
|
112
122
|
puts "Deleted storage account for premium lrs replication: #{premium_storage_account.destroy}"
|
113
123
|
|
114
124
|
########################################################################################################################
|
115
125
|
###################### CleanUp ######################
|
116
126
|
########################################################################################################################
|
117
127
|
|
118
|
-
resource_group = rs.resource_groups.get(
|
128
|
+
resource_group = rs.resource_groups.get(resource_group_name)
|
119
129
|
resource_group.destroy
|
130
|
+
|
131
|
+
puts 'Integration test for storage account ran successfully!'
|
120
132
|
rescue
|
121
133
|
puts 'Integration Test for storage account is failing'
|
122
134
|
resource_group.destroy unless resource_group.nil?
|
@@ -43,9 +43,12 @@ begin
|
|
43
43
|
###################### Create Traffic Manager Profile ######################
|
44
44
|
########################################################################################################################
|
45
45
|
|
46
|
+
tags = { key1: 'value1', key2: 'value2' }
|
47
|
+
|
46
48
|
traffic_manager_profile = traffic_manager.traffic_manager_profiles.create(
|
47
49
|
name: 'test-tmp',
|
48
50
|
resource_group: 'TestRG-TM',
|
51
|
+
tags: tags,
|
49
52
|
traffic_routing_method: 'Performance',
|
50
53
|
relative_name: 'testapplication',
|
51
54
|
ttl: '30',
|
@@ -77,8 +80,8 @@ begin
|
|
77
80
|
|
78
81
|
traffic_manager_end_point = traffic_manager.traffic_manager_end_points.create(
|
79
82
|
name: 'myendpoint',
|
80
|
-
traffic_manager_profile_name: 'test-tmp',
|
81
83
|
resource_group: 'TestRG-TM',
|
84
|
+
traffic_manager_profile_name: 'test-tmp',
|
82
85
|
type: 'externalEndpoints',
|
83
86
|
target: 'test-app1.com',
|
84
87
|
endpoint_location: 'eastus'
|
@@ -131,6 +134,8 @@ begin
|
|
131
134
|
|
132
135
|
resource_group = resources.resource_groups.get('TestRG-TM')
|
133
136
|
resource_group.destroy
|
137
|
+
|
138
|
+
puts 'Integration test for Traffic Manager ran successfully!'
|
134
139
|
rescue
|
135
140
|
puts 'Integration Test for traffic manager is failing'
|
136
141
|
resource_group.destroy unless resource_group.nil?
|
@@ -52,7 +52,8 @@ begin
|
|
52
52
|
address_prefix: '10.1.0.0/24'
|
53
53
|
}],
|
54
54
|
dns_servers: %w(10.1.0.0 10.2.0.0),
|
55
|
-
address_prefixes: %w(10.1.0.0/16 10.2.0.0/16)
|
55
|
+
address_prefixes: %w(10.1.0.0/16 10.2.0.0/16),
|
56
|
+
tags: { key: 'value' }
|
56
57
|
)
|
57
58
|
puts "Created virtual network: #{virtual_network.name}"
|
58
59
|
|
@@ -174,7 +174,8 @@ begin
|
|
174
174
|
name: 'testnetworkgateway',
|
175
175
|
resource_group: 'TestRG-GC'
|
176
176
|
},
|
177
|
-
connection_type: 'Vnet2Vnet'
|
177
|
+
connection_type: 'Vnet2Vnet',
|
178
|
+
tags: { key: 'value' }
|
178
179
|
)
|
179
180
|
puts "Created virtual network gateway connection: #{virtual_network_gateway_connection.name}"
|
180
181
|
|
@@ -214,8 +215,7 @@ begin
|
|
214
215
|
|
215
216
|
resource_group = resource.resource_groups.get('TestRG-GC')
|
216
217
|
resource_group.destroy
|
217
|
-
rescue
|
218
|
-
raise e
|
218
|
+
rescue
|
219
219
|
puts 'Integration Test for virtual network gateway connection is failing'
|
220
220
|
resource_group.destroy unless resource_group.nil?
|
221
221
|
end
|
@@ -54,7 +54,12 @@ class TestServer < Minitest::Test
|
|
54
54
|
:provision_vm_agent,
|
55
55
|
:enable_automatic_updates,
|
56
56
|
:network_interface_card_ids,
|
57
|
-
:availability_set_id
|
57
|
+
:availability_set_id,
|
58
|
+
:managed_disk_storage_type,
|
59
|
+
:os_disk_size,
|
60
|
+
:tags,
|
61
|
+
:platform_update_domain,
|
62
|
+
:platform_fault_domain
|
58
63
|
]
|
59
64
|
attributes.each do |attribute|
|
60
65
|
assert_respond_to @server, attribute
|
@@ -64,7 +69,9 @@ class TestServer < Minitest::Test
|
|
64
69
|
def test_save_method_response_for_linux_vm
|
65
70
|
response = ApiStub::Models::Compute::Server.create_linux_virtual_machine_response(@compute_client)
|
66
71
|
@service.stub :create_virtual_machine, response do
|
67
|
-
|
72
|
+
@service.stub :get_virtual_machine, response do
|
73
|
+
assert_instance_of Fog::Compute::AzureRM::Server, @server.save
|
74
|
+
end
|
68
75
|
end
|
69
76
|
|
70
77
|
# Async
|
@@ -77,8 +84,10 @@ class TestServer < Minitest::Test
|
|
77
84
|
def test_save_method_response_for_windows_vm
|
78
85
|
response = ApiStub::Models::Compute::Server.create_windows_virtual_machine_response(@compute_client)
|
79
86
|
@service.stub :create_virtual_machine, response do
|
80
|
-
|
81
|
-
|
87
|
+
@service.stub :get_virtual_machine, response do
|
88
|
+
assert_instance_of Fog::Compute::AzureRM::Server, @server.save
|
89
|
+
refute @server.save.disable_password_authentication
|
90
|
+
end
|
82
91
|
end
|
83
92
|
end
|
84
93
|
|
@@ -20,7 +20,8 @@ class TestVault < Minitest::Test
|
|
20
20
|
:access_policies,
|
21
21
|
:enabled_for_deployment,
|
22
22
|
:enabled_for_disk_encryption,
|
23
|
-
:enabled_for_template_deployment
|
23
|
+
:enabled_for_template_deployment,
|
24
|
+
:tags
|
24
25
|
]
|
25
26
|
attributes.each do |attribute|
|
26
27
|
assert_respond_to @vault, attribute
|
@@ -31,7 +31,8 @@ class TestNetworkSecurityGroup < Minitest::Test
|
|
31
31
|
:network_interfaces_ids,
|
32
32
|
:subnets_ids,
|
33
33
|
:security_rules,
|
34
|
-
:default_security_rules
|
34
|
+
:default_security_rules,
|
35
|
+
:tags
|
35
36
|
]
|
36
37
|
attributes.each do |attribute|
|
37
38
|
assert_respond_to @network_security_group, attribute
|
@@ -39,7 +39,8 @@ class TestDatabase < Minitest::Test
|
|
39
39
|
:requested_service_objective_id,
|
40
40
|
:requested_service_objective_name,
|
41
41
|
:service_level_objective,
|
42
|
-
:source_database_id
|
42
|
+
:source_database_id,
|
43
|
+
:tags
|
43
44
|
]
|
44
45
|
attributes.each do |attribute|
|
45
46
|
assert_respond_to @database, attribute
|
@@ -29,7 +29,8 @@ class TestSqlServer < Minitest::Test
|
|
29
29
|
:state,
|
30
30
|
:administrator_login,
|
31
31
|
:administrator_login_password,
|
32
|
-
:fully_qualified_domain_name
|
32
|
+
:fully_qualified_domain_name,
|
33
|
+
:tags
|
33
34
|
]
|
34
35
|
attributes.each do |attribute|
|
35
36
|
assert_respond_to @sql_server, attribute
|
@@ -15,15 +15,22 @@ class TestCheckAGExists < Minitest::Test
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
19
|
-
response = proc { raise MsRestAzure::AzureOperationError.new(nil,
|
18
|
+
def test_check_app_gateway_exists_failure
|
19
|
+
response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceNotFound' }) }
|
20
20
|
@gateways.stub :get, response do
|
21
21
|
assert !@service.check_ag_exists('fog-test-rg', 'fogRM-rg')
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
26
|
-
response = proc { raise MsRestAzure::AzureOperationError.new(nil,
|
25
|
+
def test_check_app_gateway_resource_group_exists_failure
|
26
|
+
response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'ResourceGroupNotFound' }) }
|
27
|
+
@gateways.stub :get, response do
|
28
|
+
assert !@service.check_ag_exists('fog-test-rg', 'fogRM-rg')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_check_app_gateway_exists_exception
|
33
|
+
response = proc { raise MsRestAzure::AzureOperationError.new(nil, create_mock_response, 'error' => { 'message' => 'mocked exception', 'code' => 'Exception' }) }
|
27
34
|
@gateways.stub :get, response do
|
28
35
|
assert_raises(RuntimeError) { @service.check_ag_exists('fog-test-rg', 'fogRM-rg') }
|
29
36
|
end
|