ops_manager_ui_drivers 1.6.3 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ops_manager_ui_drivers/page_helpers.rb +9 -1
- data/lib/ops_manager_ui_drivers/version.rb +1 -1
- data/lib/ops_manager_ui_drivers/version16/api_1_6.rb +42 -0
- data/lib/ops_manager_ui_drivers/version17/available_products.rb +25 -0
- data/lib/ops_manager_ui_drivers/version17/bosh_product_sections/advanced_infrastructure_config.rb +18 -0
- data/lib/ops_manager_ui_drivers/version17/bosh_product_sections/availability_zones.rb +29 -0
- data/lib/ops_manager_ui_drivers/version17/bosh_product_sections/bosh_product_form_section.rb +39 -0
- data/lib/ops_manager_ui_drivers/version17/bosh_product_sections/iaas_configuration.rb +17 -0
- data/lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb +51 -0
- data/lib/ops_manager_ui_drivers/version17/job_availability_zone_mapping_helper.rb +70 -0
- data/lib/ops_manager_ui_drivers/version17/job_network_mapping_helper.rb +47 -0
- data/lib/ops_manager_ui_drivers/version17/job_status_helper.rb +17 -0
- data/lib/ops_manager_ui_drivers/version17/ops_manager_director.rb +188 -0
- data/lib/ops_manager_ui_drivers/version17/product_availability_zones.rb +38 -0
- data/lib/ops_manager_ui_drivers/version17/product_configuration.rb +38 -0
- data/lib/ops_manager_ui_drivers/version17/product_dashboard.rb +191 -0
- data/lib/ops_manager_ui_drivers/version17/product_errands.rb +42 -0
- data/lib/ops_manager_ui_drivers/version17/product_form.rb +61 -0
- data/lib/ops_manager_ui_drivers/version17/product_logs.rb +38 -0
- data/lib/ops_manager_ui_drivers/version17/product_resource_configuration.rb +69 -0
- data/lib/ops_manager_ui_drivers/version17/product_status_helper.rb +64 -0
- data/lib/ops_manager_ui_drivers/version17/settings.rb +136 -0
- data/lib/ops_manager_ui_drivers/version17/setup.rb +44 -0
- data/lib/ops_manager_ui_drivers/version17/state_change_progress.rb +43 -0
- data/lib/ops_manager_ui_drivers/version17/web_ui.rb +110 -0
- metadata +25 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7307813db2fc2143053f5ac3d555958b7b6f2e55
|
4
|
+
data.tar.gz: d59a42cb98fe60a70229ed3c710a0d75f8cb2680
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e45b366266a54d41b64e5f5ac92fc021a485cbcc9d03998f322c5a39dd9d2bd89038c4814309c9f0e64fb0cfd31a5a59e37daad14972a5af1805e8beb776b8ae
|
7
|
+
data.tar.gz: 49d3cf915e247e998f04209d23c7569505b9f82a7487a72615dacbfc2f0fb30c7df345807e5eb86855fa1272b83717618de0ef8abba04579fa99a3c41d9482f7
|
@@ -12,10 +12,14 @@ module OpsManagerUiDrivers
|
|
12
12
|
@om_1_5 ||= create_web_ui(ops_manager_url, Version15)
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def om_1_6(ops_manager_url)
|
16
16
|
@om_1_6 ||= create_web_ui(ops_manager_url, Version16)
|
17
17
|
end
|
18
18
|
|
19
|
+
def om_rc(ops_manager_url)
|
20
|
+
@om_1_7 ||= create_web_ui(ops_manager_url, Version17)
|
21
|
+
end
|
22
|
+
|
19
23
|
def api_1_4(host:, username:, password:)
|
20
24
|
Version14::Api.new(host: host, user: username, password: password)
|
21
25
|
end
|
@@ -24,6 +28,10 @@ module OpsManagerUiDrivers
|
|
24
28
|
Version15::Api.new(host: host, user: username, password: password)
|
25
29
|
end
|
26
30
|
|
31
|
+
def api_1_6(host:, username:, password:)
|
32
|
+
Version16::Api.new(host: host, user: username, password: password)
|
33
|
+
end
|
34
|
+
|
27
35
|
private
|
28
36
|
|
29
37
|
def create_web_ui(ops_manager_url, version_module)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'net/https'
|
2
|
+
|
3
|
+
module OpsManagerUiDrivers
|
4
|
+
module Version16
|
5
|
+
class Api
|
6
|
+
def initialize(host: nil, user: nil, password: nil)
|
7
|
+
@host = host
|
8
|
+
@user = user
|
9
|
+
@password = password
|
10
|
+
end
|
11
|
+
|
12
|
+
def export_installation
|
13
|
+
tmpfile = Tempfile.new('installation.zip')
|
14
|
+
http.request(get('installation_asset_collection')) do |response|
|
15
|
+
response.read_body do |chunk|
|
16
|
+
tmpfile.write(chunk)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
tmpfile.close
|
20
|
+
tmpfile
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def http
|
26
|
+
uri = URI(@host)
|
27
|
+
Net::HTTP.new(uri.host, uri.port).tap do |http|
|
28
|
+
http.use_ssl = true
|
29
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
30
|
+
http.read_timeout = 1800
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def get(endpoint)
|
35
|
+
uri = URI("#{@host}/api/#{endpoint}")
|
36
|
+
Net::HTTP::Get.new(uri.request_uri).tap do |get|
|
37
|
+
get.basic_auth(@user, @password)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
class AvailableProducts
|
4
|
+
def initialize(browser:)
|
5
|
+
@browser = browser
|
6
|
+
end
|
7
|
+
|
8
|
+
def add_product_to_install(product_name)
|
9
|
+
browser.visit '/'
|
10
|
+
browser.click_on "add-#{product_name}"
|
11
|
+
browser.find("#show-#{product_name}-configure-action", wait: 10)
|
12
|
+
end
|
13
|
+
|
14
|
+
def product_added?(product_name)
|
15
|
+
browser.visit '/'
|
16
|
+
browser.all("#show-#{product_name}-configure-action").any?
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
attr_reader :browser
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/ops_manager_ui_drivers/version17/bosh_product_sections/advanced_infrastructure_config.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
module BoshProductSections
|
4
|
+
class AdvancedInfrastructureConfig
|
5
|
+
def initialize(browser:)
|
6
|
+
@bosh_product_form_section = BoshProductFormSection.new(browser, 'advanced_infrastructure_config')
|
7
|
+
end
|
8
|
+
|
9
|
+
def fill_advanced_infrastructure_config_settings(fields)
|
10
|
+
return if fields.empty?
|
11
|
+
@bosh_product_form_section.open_form('advanced_infrastructure_config')
|
12
|
+
@bosh_product_form_section.set_fields(fields)
|
13
|
+
@bosh_product_form_section.save_form
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
module BoshProductSections
|
4
|
+
class AvailabilityZones
|
5
|
+
def initialize(browser:)
|
6
|
+
@browser = browser
|
7
|
+
@bosh_product_form_section = BoshProductFormSection.new(browser, 'availability_zones[availability_zones][]')
|
8
|
+
end
|
9
|
+
|
10
|
+
def add_single_az(iaas_identifier)
|
11
|
+
@bosh_product_form_section.open_form('availability_zones')
|
12
|
+
@bosh_product_form_section.set_fields('iaas_identifier' => iaas_identifier)
|
13
|
+
@bosh_product_form_section.save_form
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_az(fields)
|
17
|
+
@bosh_product_form_section.open_form('availability_zones')
|
18
|
+
browser.click_on 'Add'
|
19
|
+
@bosh_product_form_section.set_fields(fields)
|
20
|
+
@bosh_product_form_section.save_form
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
attr_reader :browser
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
module BoshProductSections
|
4
|
+
class BoshProductFormSection
|
5
|
+
def initialize(browser, field_prefix)
|
6
|
+
@browser = browser
|
7
|
+
@field_prefix = field_prefix
|
8
|
+
end
|
9
|
+
|
10
|
+
def open_form(form_name)
|
11
|
+
@browser.visit '/'
|
12
|
+
@browser.click_on 'show-p-bosh-configure-action'
|
13
|
+
@browser.click_on "show-#{form_name}-action"
|
14
|
+
end
|
15
|
+
|
16
|
+
def save_form
|
17
|
+
@browser.click_on 'Save'
|
18
|
+
@browser.expect(@browser.page).to @browser.have_css('.flash-message.success')
|
19
|
+
end
|
20
|
+
|
21
|
+
def set_fields(fields)
|
22
|
+
fields.each do |field, value|
|
23
|
+
set_field(field, value)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def set_field(field, value)
|
30
|
+
last_field(field).set(value)
|
31
|
+
end
|
32
|
+
|
33
|
+
def last_field(field)
|
34
|
+
@browser.all(:field, "#{@field_prefix}[#{field}]").last
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
module BoshProductSections
|
4
|
+
class IaasConfiguration
|
5
|
+
def initialize(browser:)
|
6
|
+
@bosh_product_form_section = BoshProductFormSection.new(browser, 'iaas_configuration')
|
7
|
+
end
|
8
|
+
|
9
|
+
def fill_iaas_settings(fields)
|
10
|
+
@bosh_product_form_section.open_form('iaas_configuration')
|
11
|
+
@bosh_product_form_section.set_fields(fields)
|
12
|
+
@bosh_product_form_section.save_form
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
module BoshProductSections
|
4
|
+
class Networks
|
5
|
+
def initialize(browser:)
|
6
|
+
@browser = browser
|
7
|
+
@bosh_product_form_section = BoshProductFormSection.new(browser, 'network[networks][]')
|
8
|
+
end
|
9
|
+
|
10
|
+
def add_single_network(name:, iaas_network_identifier:, subnet:, dns:, gateway:, reserved_ip_ranges:)
|
11
|
+
@bosh_product_form_section.open_form('network')
|
12
|
+
|
13
|
+
@bosh_product_form_section.set_fields(
|
14
|
+
'name' => name,
|
15
|
+
'iaas_network_identifier' => iaas_network_identifier,
|
16
|
+
'subnet' => subnet,
|
17
|
+
'dns' => dns,
|
18
|
+
'gateway' => gateway,
|
19
|
+
'reserved_ip_ranges' => reserved_ip_ranges,
|
20
|
+
)
|
21
|
+
browser.click_on 'Save'
|
22
|
+
flash_errors = browser.all('.flash-message.error ul.message li').to_a
|
23
|
+
flash_errors.reject! { |node| node.text =~ /cannot reach gateway/i }
|
24
|
+
|
25
|
+
if (flash_errors.length > 0)
|
26
|
+
fail flash_errors.collect(&:text).inspect
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def add_network(name:, iaas_network_identifier:, subnet:, dns:, gateway:, reserved_ip_ranges:)
|
31
|
+
@bosh_product_form_section.open_form('network')
|
32
|
+
|
33
|
+
browser.click_on 'Add'
|
34
|
+
@bosh_product_form_section.set_fields(
|
35
|
+
'name' => name,
|
36
|
+
'iaas_network_identifier' => iaas_network_identifier,
|
37
|
+
'subnet' => subnet,
|
38
|
+
'dns' => dns,
|
39
|
+
'gateway' => gateway,
|
40
|
+
'reserved_ip_ranges' => reserved_ip_ranges,
|
41
|
+
)
|
42
|
+
@bosh_product_form_section.save_form
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
attr_reader :browser
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
class JobAvailabilityZoneMappingHelper
|
4
|
+
def initialize(product_name: nil, browser: nil)
|
5
|
+
@product_name = product_name
|
6
|
+
@browser = browser
|
7
|
+
end
|
8
|
+
|
9
|
+
SINGLETON_AVAILABILITY_ZONE_INPUT_SELECTOR = "input[name='product[singleton_availability_zone_reference]']"
|
10
|
+
AVAILABILITY_ZONE_INPUT_SELECTOR = "input[name='product[availability_zone_references][]']"
|
11
|
+
|
12
|
+
def assign_availability_zones!(singleton_availability_zone:, availability_zones:)
|
13
|
+
open_form
|
14
|
+
|
15
|
+
browser.all(AVAILABILITY_ZONE_INPUT_SELECTOR).each do |checkbox|
|
16
|
+
checkbox.set(false)
|
17
|
+
end
|
18
|
+
|
19
|
+
availability_zones.each do |az_name|
|
20
|
+
browser.check("#{az_name}")
|
21
|
+
end
|
22
|
+
|
23
|
+
browser.choose("#{singleton_availability_zone}")
|
24
|
+
|
25
|
+
save_form
|
26
|
+
end
|
27
|
+
|
28
|
+
def singleton_availability_zone
|
29
|
+
open_form
|
30
|
+
|
31
|
+
selected_options = browser.all("#{SINGLETON_AVAILABILITY_ZONE_INPUT_SELECTOR}[selected='selected']").map do |radio|
|
32
|
+
browser.find("label[for='#{radio[:id]}']").text
|
33
|
+
end
|
34
|
+
|
35
|
+
raise ArgumentError, 'availability_zone not selected' if selected_options.empty?
|
36
|
+
selected_options.first
|
37
|
+
end
|
38
|
+
|
39
|
+
def availability_zones
|
40
|
+
open_form
|
41
|
+
|
42
|
+
browser.all("#{AVAILABILITY_ZONE_INPUT_SELECTOR}[checked='checked']").map do |checkbox|
|
43
|
+
browser.find("label[for='#{checkbox[:id]}']").text
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
attr_reader :browser, :product_name
|
50
|
+
|
51
|
+
def open_form
|
52
|
+
browser.visit '/'
|
53
|
+
browser.click_on "show-#{product_name}-configure-action"
|
54
|
+
browser.click_on "show-#{product_name}-availability-zone-assignment-action"
|
55
|
+
end
|
56
|
+
|
57
|
+
def save_form
|
58
|
+
browser.click_on 'Save'
|
59
|
+
|
60
|
+
unless browser.has_css?('.flash-message.success')
|
61
|
+
if browser.has_css?('.flash-message.error')
|
62
|
+
raise browser.find('.flash-message.error').text
|
63
|
+
else
|
64
|
+
raise 'unexpected failure'
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
class JobNetworkMappingHelper
|
4
|
+
PRODUCT_NETWORK_FIELD_NAME = 'product_network_assignment'
|
5
|
+
|
6
|
+
def initialize(product_name:, browser:)
|
7
|
+
@product_name = product_name
|
8
|
+
@browser = browser
|
9
|
+
end
|
10
|
+
|
11
|
+
def assign_product_to_network(network)
|
12
|
+
open_form
|
13
|
+
browser.find_field(PRODUCT_NETWORK_FIELD_NAME).find(:option, text: network).select_option
|
14
|
+
save_form
|
15
|
+
end
|
16
|
+
|
17
|
+
def product_network
|
18
|
+
open_form
|
19
|
+
selected_options = browser.find_field(PRODUCT_NETWORK_FIELD_NAME).all('option[selected]')
|
20
|
+
raise ArgumentError, "#{PRODUCT_NETWORK_FIELD_NAME} not selected" if selected_options.empty?
|
21
|
+
selected_options.first.text
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
attr_reader :product_name, :browser
|
27
|
+
|
28
|
+
def open_form
|
29
|
+
browser.visit '/'
|
30
|
+
browser.click_on "show-#{product_name}-configure-action"
|
31
|
+
browser.click_on "show-#{product_name}-network-assignment-action"
|
32
|
+
end
|
33
|
+
|
34
|
+
def save_form
|
35
|
+
browser.click_on 'Save'
|
36
|
+
|
37
|
+
unless browser.has_css?('.flash-message.success')
|
38
|
+
if browser.has_css?('.flash-message.error')
|
39
|
+
raise browser.find('.flash-message.error').text
|
40
|
+
else
|
41
|
+
raise 'unexpected failure'
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
class JobStatusHelper
|
4
|
+
def self.from_job_row(job_row)
|
5
|
+
ips_string = job_row.find('.actual-ips').text
|
6
|
+
ips = ips_string.split(', ')
|
7
|
+
new(ips: ips)
|
8
|
+
end
|
9
|
+
|
10
|
+
def initialize(ips:)
|
11
|
+
@ips = ips
|
12
|
+
end
|
13
|
+
|
14
|
+
attr_reader :ips
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,188 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
class OpsManagerDirector
|
4
|
+
def initialize(browser:, iaas_configuration: Version17::BoshProductSections::IaasConfiguration.new(browser: browser))
|
5
|
+
@browser = browser
|
6
|
+
@iaas_configuration = iaas_configuration
|
7
|
+
end
|
8
|
+
|
9
|
+
def configure_bosh_product(test_settings)
|
10
|
+
configure_iaas(test_settings)
|
11
|
+
|
12
|
+
config_director(test_settings.ops_manager)
|
13
|
+
|
14
|
+
add_availability_zones(test_settings.iaas_type, test_settings.ops_manager.availability_zones)
|
15
|
+
|
16
|
+
assign_availability_zone(test_settings.iaas_type, test_settings.ops_manager.availability_zones)
|
17
|
+
|
18
|
+
add_networks(test_settings)
|
19
|
+
|
20
|
+
assign_networks(test_settings.ops_manager)
|
21
|
+
|
22
|
+
customize_resource_config(test_settings.ops_manager.resource_config)
|
23
|
+
end
|
24
|
+
|
25
|
+
def configure_iaas(test_settings)
|
26
|
+
iaas_settings = Settings.for(test_settings)
|
27
|
+
iaas_specific_fields = iaas_settings.iaas_configuration_fields
|
28
|
+
advanced_infrastructure_config_fields = iaas_settings.advanced_infrastructure_config_fields
|
29
|
+
iaas_configuration.fill_iaas_settings(iaas_specific_fields)
|
30
|
+
advanced_infrastructure_config.fill_advanced_infrastructure_config_settings(advanced_infrastructure_config_fields)
|
31
|
+
end
|
32
|
+
|
33
|
+
def add_availability_zones(iaas_type, iaas_availability_zones)
|
34
|
+
case iaas_type
|
35
|
+
when OpsManagerUiDrivers::AWS_IAAS_TYPE, OpsManagerUiDrivers::OPENSTACK_IAAS_TYPE
|
36
|
+
return unless iaas_availability_zones
|
37
|
+
availability_zones.add_single_az(iaas_availability_zones.first['iaas_identifier'])
|
38
|
+
when OpsManagerUiDrivers::VSPHERE_IAAS_TYPE
|
39
|
+
iaas_availability_zones && iaas_availability_zones.each do |az|
|
40
|
+
availability_zones.add_az('name' => az['name'], 'cluster' => az['cluster'], 'resource_pool' => az['resource_pool'])
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def add_networks(test_settings)
|
46
|
+
iaas_networks = test_settings.ops_manager.networks
|
47
|
+
|
48
|
+
case test_settings.iaas_type
|
49
|
+
when OpsManagerUiDrivers::AWS_IAAS_TYPE, OpsManagerUiDrivers::OPENSTACK_IAAS_TYPE
|
50
|
+
first_network = iaas_networks.first
|
51
|
+
|
52
|
+
networks.add_single_network(
|
53
|
+
name: first_network['name'],
|
54
|
+
iaas_network_identifier: first_network['identifier'],
|
55
|
+
subnet: first_network['subnet'],
|
56
|
+
reserved_ip_ranges: first_network['reserved_ips'],
|
57
|
+
dns: first_network['dns'],
|
58
|
+
gateway: first_network['gateway'],
|
59
|
+
)
|
60
|
+
else
|
61
|
+
iaas_networks && iaas_networks.each do |network|
|
62
|
+
networks.add_network(
|
63
|
+
name: network['name'],
|
64
|
+
iaas_network_identifier: network['identifier'],
|
65
|
+
subnet: network['subnet'],
|
66
|
+
reserved_ip_ranges: network['reserved_ips'],
|
67
|
+
dns: network['dns'],
|
68
|
+
gateway: network['gateway'],
|
69
|
+
)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def config_director(ops_manager)
|
75
|
+
browser.click_on 'Director Config'
|
76
|
+
browser.fill_in('director_configuration[ntp_servers_string]', with: ops_manager.ntp_servers)
|
77
|
+
browser.check('Enable VM Resurrector Plugin') if ops_manager.resurrector_enabled
|
78
|
+
|
79
|
+
s3_blobstore = ops_manager.s3_blobstore
|
80
|
+
if s3_blobstore
|
81
|
+
browser.choose('S3 Compatible Blobstore')
|
82
|
+
browser.fill_in('director_configuration[s3_blobstore_options][endpoint]', with: s3_blobstore.endpoint)
|
83
|
+
browser.fill_in('director_configuration[s3_blobstore_options][bucket_name]', with: s3_blobstore.bucket_name)
|
84
|
+
browser.fill_in('director_configuration[s3_blobstore_options][access_key]', with: s3_blobstore.access_key_id)
|
85
|
+
browser.fill_in('director_configuration[s3_blobstore_options][secret_key]', with: s3_blobstore.secret_access_key)
|
86
|
+
end
|
87
|
+
|
88
|
+
mysql = ops_manager.mysql
|
89
|
+
if mysql
|
90
|
+
browser.choose('External MySQL Database')
|
91
|
+
browser.fill_in('director_configuration[external_database_options][host]', with: mysql.host)
|
92
|
+
browser.fill_in('director_configuration[external_database_options][port]', with: mysql.port)
|
93
|
+
browser.fill_in('director_configuration[external_database_options][user]', with: mysql.user)
|
94
|
+
browser.fill_in('director_configuration[external_database_options][password]', with: mysql.password)
|
95
|
+
browser.fill_in('director_configuration[external_database_options][database]', with: mysql.dbname)
|
96
|
+
end
|
97
|
+
|
98
|
+
browser.click_on 'Save'
|
99
|
+
end
|
100
|
+
|
101
|
+
def assign_availability_zone(iaas_type, iaas_availability_zones)
|
102
|
+
return unless iaas_availability_zones
|
103
|
+
case iaas_type
|
104
|
+
when OpsManagerUiDrivers::AWS_IAAS_TYPE, OpsManagerUiDrivers::OPENSTACK_IAAS_TYPE
|
105
|
+
browser.click_on 'Assign Availability Zones'
|
106
|
+
browser.select(iaas_availability_zones.first['iaas_identifier'])
|
107
|
+
browser.click_on 'Save'
|
108
|
+
when OpsManagerUiDrivers::VSPHERE_IAAS_TYPE
|
109
|
+
browser.click_on 'Assign Availability Zones'
|
110
|
+
browser.select(iaas_availability_zones.first['name'])
|
111
|
+
browser.click_on 'Save'
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
def assign_networks(ops_manager)
|
116
|
+
if ops_manager.vcenter
|
117
|
+
deployment_network = ops_manager.networks[0]
|
118
|
+
|
119
|
+
infrastructure_network =
|
120
|
+
ops_manager.networks[1] ? ops_manager.networks[1] : ops_manager.networks[0]
|
121
|
+
|
122
|
+
assign_networks_vsphere(
|
123
|
+
infrastructure_network: infrastructure_network['name'],
|
124
|
+
deployment_network: deployment_network['name'],
|
125
|
+
)
|
126
|
+
else
|
127
|
+
assign_network(deployment_network: ops_manager.networks[0]['name'])
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def customize_resource_config(resource_config)
|
132
|
+
browser.click_on 'Resource Config'
|
133
|
+
if resource_config
|
134
|
+
browser.fill_in('product_resources_form[director][persistent_disk][value]', with: resource_config.persistent_disk)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
def assign_networks_vsphere(infrastructure_network:, deployment_network:)
|
139
|
+
browser.click_on 'Assign Networks'
|
140
|
+
|
141
|
+
browser.within browser.find '#director_network_assignments_infrastructure_network' do
|
142
|
+
browser.select infrastructure_network
|
143
|
+
end
|
144
|
+
|
145
|
+
browser.within browser.find '#director_network_assignments_deployment_network' do
|
146
|
+
browser.select deployment_network
|
147
|
+
end
|
148
|
+
browser.click_on 'Save'
|
149
|
+
browser.wait { browser.assert_text('Successfully assigned infrastructure network') }
|
150
|
+
end
|
151
|
+
|
152
|
+
def assign_network(deployment_network:)
|
153
|
+
browser.click_on 'Assign Networks'
|
154
|
+
|
155
|
+
browser.select(deployment_network, from: 'Network')
|
156
|
+
browser.click_on 'Save'
|
157
|
+
end
|
158
|
+
|
159
|
+
def configure_vm_passwords(use_generated_passwords: true)
|
160
|
+
browser.click_on 'Security'
|
161
|
+
if use_generated_passwords
|
162
|
+
browser.choose('Generate passwords')
|
163
|
+
else
|
164
|
+
browser.choose('Use default BOSH password')
|
165
|
+
end
|
166
|
+
browser.click_on 'Save'
|
167
|
+
browser.wait { browser.assert_text('Settings updated') }
|
168
|
+
end
|
169
|
+
|
170
|
+
private
|
171
|
+
|
172
|
+
attr_reader :browser, :iaas_configuration
|
173
|
+
|
174
|
+
|
175
|
+
def availability_zones
|
176
|
+
@availability_zones ||= Version17::BoshProductSections::AvailabilityZones.new(browser: browser)
|
177
|
+
end
|
178
|
+
|
179
|
+
def networks
|
180
|
+
@networks ||= Version17::BoshProductSections::Networks.new(browser: browser)
|
181
|
+
end
|
182
|
+
|
183
|
+
def advanced_infrastructure_config
|
184
|
+
@advanced_infrastructure_config ||= Version17::BoshProductSections::AdvancedInfrastructureConfig.new(browser: browser)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
class WebUi
|
4
|
+
class ProductAvailabilityZones
|
5
|
+
def initialize(browser:, product_name:)
|
6
|
+
@browser = browser
|
7
|
+
@product_name = product_name
|
8
|
+
end
|
9
|
+
|
10
|
+
def assign_availability_zones(singleton_availability_zone:, availability_zones:)
|
11
|
+
open_form
|
12
|
+
browser.choose(singleton_availability_zone)
|
13
|
+
# we don't change the assignments in clean install yet,
|
14
|
+
# otherwise we'd want to clear them out first
|
15
|
+
availability_zones.each do |az_name|
|
16
|
+
browser.check(az_name)
|
17
|
+
end
|
18
|
+
save_form
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
attr_reader :browser, :product_name
|
23
|
+
|
24
|
+
def open_form
|
25
|
+
browser.visit '/'
|
26
|
+
browser.click_on "show-#{product_name}-configure-action"
|
27
|
+
browser.click_on "show-#{product_name}-availability-zone-assignment-action"
|
28
|
+
end
|
29
|
+
|
30
|
+
def save_form
|
31
|
+
browser.click_on 'Save'
|
32
|
+
|
33
|
+
browser.expect(browser.page).to browser.have_css('.flash-message.success')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version17
|
3
|
+
class ProductConfiguration
|
4
|
+
attr_reader :product_name
|
5
|
+
|
6
|
+
def initialize(browser:, product_name:)
|
7
|
+
@browser = browser
|
8
|
+
@product_name = product_name
|
9
|
+
end
|
10
|
+
|
11
|
+
def upload_stemcell(stemcell_file_path)
|
12
|
+
visit_product_page
|
13
|
+
browser.click_on "show-#{product_name}-stemcell-assignment-action"
|
14
|
+
browser.attach_file('product_stemcell[file]', stemcell_file_path, {visible: false})
|
15
|
+
browser.wait {
|
16
|
+
browser.assert_text("Stemcell '#{File.basename(stemcell_file_path)}' has been uploaded successfully.")
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def product_form(form_name)
|
21
|
+
Version17::ProductForm.new(browser: browser, product_name: product_name, form_name: form_name)
|
22
|
+
end
|
23
|
+
|
24
|
+
def product_errands
|
25
|
+
Version17::ProductErrands.new(browser: browser, product_name: product_name)
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
attr_reader :browser, :product_name
|
31
|
+
|
32
|
+
def visit_product_page
|
33
|
+
browser.visit '/'
|
34
|
+
browser.click_on "show-#{product_name}-configure-action"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|