test/integration/application_gateway.rb in fog-azure-rm-0.3.3 vs test/integration/application_gateway.rb in fog-azure-rm-0.3.4
- old
+ new
@@ -26,16 +26,17 @@
tenant_id: azure_credentials['tenant_id'],
client_id: azure_credentials['client_id'],
client_secret: azure_credentials['client_secret'],
subscription_id: azure_credentials['subscription_id']
)
+
########################################################################################################################
###################### Resource names #####################
########################################################################################################################
time = current_time
-resource_group_name = "AG-RG-#{time}"
+resource_group_name = "TestRG-AG-#{time}"
virtual_network_name = "Vnet#{time}"
subnet_name = "Sub#{time}"
public_ip_name = "Pip#{time}"
app_gateway_name = "AG#{time}"
@@ -80,14 +81,17 @@
#######################################################################################################################
##################### Create Application Gateway ######################
#######################################################################################################################
+ tags = { key1: 'value1', key2: 'value2' }
+
app_gateway = application_gateway.gateways.create(
name: app_gateway_name,
location: LOCATION,
resource_group: resource_group_name,
+ tags: tags,
sku_name: 'Standard_Medium',
sku_tier: 'Standard',
sku_capacity: '2',
gateway_ip_configurations: [
{
@@ -149,10 +153,11 @@
url_path_map: ''
}
]
)
puts "Created application gateway #{app_gateway.name}"
+
########################################################################################################################
###################### Get Application Gateway ######################
########################################################################################################################
app_gateway = application_gateway.gateways.get(resource_group_name, app_gateway_name)
@@ -215,10 +220,11 @@
interval: 60,
timeout: 300,
unhealthy_threshold: 5
)
puts 'Added probe in application gateway'
+
app_gateway.remove_probe(
name: 'Probe1',
protocol: 'http',
host: 'localhost',
path: '/fog-test',
@@ -244,9 +250,10 @@
vnet = network.virtual_networks.get(resource_group_name, virtual_network_name)
vnet.destroy
resource_group = resource.resource_groups.get(resource_group_name)
resource_group.destroy
+
puts 'Integration Test for application gateway ran successfully'
rescue
puts 'Integration Test for application gateway is failing'
resource_group.destroy unless resource_group.nil?
end