ops_manager_ui_drivers 0.6.0 → 0.6.1
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/version.rb +1 -1
- data/lib/ops_manager_ui_drivers/version15/iaas_configuration.rb +8 -85
- data/lib/ops_manager_ui_drivers/version15/ops_manager_director.rb +17 -107
- data/lib/ops_manager_ui_drivers/version15/settings.rb +116 -0
- data/ops_manager_ui_drivers.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cc64665096fb55bf4c4097208fa246b4eea5e95
|
4
|
+
data.tar.gz: 9e28d0e3a64b55978fb94c5f60ceff93b88b7016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63c1d9dd73f0765a31b53b9010b819d093bed9d2e512c6e339338786ce9cb9f66c768294028d8fe3a7def36b8cecfe875bfd66257a3b62c514ac026395f8c157
|
7
|
+
data.tar.gz: 6d0be672fea9b6d1230095ef036e9ed247a6a0ed5cffd05828a0fd1afd195913e391b2d4fec42a7c591fa3c0284f7147861354dbd682b91a6ebfe19ad5e2a569
|
@@ -5,101 +5,24 @@ module OpsManagerUiDrivers
|
|
5
5
|
@browser = browser
|
6
6
|
end
|
7
7
|
|
8
|
-
def
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
save_form
|
14
|
-
end
|
15
|
-
|
16
|
-
def set_vsphere_credentials(vcenter_ip:, username:, password:)
|
17
|
-
set_field('vcenter_ip', vcenter_ip)
|
18
|
-
set_field('vcenter_username', username)
|
19
|
-
set_field('vcenter_password', password)
|
20
|
-
end
|
21
|
-
|
22
|
-
def set_vcloud_credentials(vcd_url:, organization:, user:, password:)
|
23
|
-
set_field('vcd_url', vcd_url)
|
24
|
-
set_field('organization', organization)
|
25
|
-
set_field('vcd_username', user)
|
26
|
-
set_field('vcd_password', password)
|
27
|
-
end
|
28
|
-
|
29
|
-
def set_aws_credentials(access_key_id:, secret_access_key:, vpc_id:, security_group:, key_pair_name:, ssh_private_key:)
|
30
|
-
set_field('access_key_id', access_key_id)
|
31
|
-
set_field('secret_access_key', secret_access_key)
|
32
|
-
set_field('vpc_id', vpc_id)
|
33
|
-
set_field('security_group', security_group)
|
34
|
-
set_field('key_pair_name', key_pair_name)
|
35
|
-
set_field('ssh_private_key', ssh_private_key)
|
36
|
-
end
|
37
|
-
|
38
|
-
def set_openstack_credentials(
|
39
|
-
identity_endpoint:,
|
40
|
-
username:,
|
41
|
-
password:,
|
42
|
-
tenant:,
|
43
|
-
security_group_name:,
|
44
|
-
key_pair_name:,
|
45
|
-
ssh_private_key:
|
46
|
-
)
|
47
|
-
set_field('identity_endpoint', identity_endpoint)
|
48
|
-
set_field('username', username)
|
49
|
-
set_field('password', password)
|
50
|
-
set_field('tenant', tenant)
|
51
|
-
set_field('security_group', security_group_name)
|
52
|
-
set_field('key_pair_name', key_pair_name)
|
53
|
-
set_field('ssh_private_key', ssh_private_key)
|
54
|
-
end
|
55
|
-
|
56
|
-
|
57
|
-
def set_datacenter(datacenter)
|
58
|
-
set_field('datacenter', datacenter)
|
59
|
-
end
|
60
|
-
|
61
|
-
def set_datastores(datastores)
|
62
|
-
set_field('datastores_string', datastores)
|
63
|
-
end
|
64
|
-
|
65
|
-
def set_microbosh_vm_folder(microbosh_vm_folder)
|
66
|
-
set_field('microbosh_vm_folder', microbosh_vm_folder)
|
67
|
-
end
|
68
|
-
|
69
|
-
def set_microbosh_template_folder(microbosh_template_folder)
|
70
|
-
set_field('microbosh_template_folder', microbosh_template_folder)
|
71
|
-
end
|
72
|
-
|
73
|
-
def set_microbosh_disk_path(microbosh_disk_path)
|
74
|
-
set_field('microbosh_disk_path', microbosh_disk_path)
|
75
|
-
end
|
76
|
-
|
77
|
-
def set_storage_profile(storage_profile)
|
78
|
-
set_field('storage_profile', storage_profile)
|
79
|
-
end
|
80
|
-
|
81
|
-
def set_catalog_name(catalog_name)
|
82
|
-
set_field('catalog_name', catalog_name)
|
8
|
+
def open_form
|
9
|
+
browser.visit '/'
|
10
|
+
browser.click_on 'show-microbosh-configure-action'
|
11
|
+
browser.click_on 'show-iaas_configuration-action'
|
83
12
|
end
|
84
13
|
|
85
|
-
private
|
86
|
-
|
87
|
-
attr_reader :browser
|
88
|
-
|
89
14
|
def save_form
|
90
15
|
browser.click_on 'Save'
|
91
16
|
browser.expect(browser.page).to browser.have_css('.flash-message.success')
|
92
17
|
end
|
93
18
|
|
94
|
-
def open_form(form)
|
95
|
-
browser.visit '/'
|
96
|
-
browser.click_on 'show-microbosh-configure-action'
|
97
|
-
browser.click_on "show-#{form}-action"
|
98
|
-
end
|
99
|
-
|
100
19
|
def set_field(field, value)
|
101
20
|
browser.find_field("iaas_configuration[#{field}]").set(value)
|
102
21
|
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
attr_reader :browser
|
103
26
|
end
|
104
27
|
end
|
105
28
|
end
|
@@ -1,8 +1,11 @@
|
|
1
|
+
require 'ops_manager_ui_drivers/version15/settings'
|
2
|
+
|
1
3
|
module OpsManagerUiDrivers
|
2
4
|
module Version15
|
3
5
|
class OpsManagerDirector
|
4
|
-
def initialize(browser:)
|
5
|
-
@browser
|
6
|
+
def initialize(browser:, iaas_configuration: Version15::IaasConfiguration.new(browser: browser))
|
7
|
+
@browser = browser
|
8
|
+
@iaas_configuration = iaas_configuration
|
6
9
|
end
|
7
10
|
|
8
11
|
def configure_microbosh(test_settings)
|
@@ -20,48 +23,12 @@ module OpsManagerUiDrivers
|
|
20
23
|
end
|
21
24
|
|
22
25
|
def configure_iaas(test_settings)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
organization: test_settings.ops_manager.vcloud.creds.organization,
|
28
|
-
user: test_settings.ops_manager.vcloud.creds.user,
|
29
|
-
password: test_settings.ops_manager.vcloud.creds.password,
|
30
|
-
datacenter: test_settings.ops_manager.vcloud.vdc.name,
|
31
|
-
storage_profile: test_settings.ops_manager.vcloud.vdc.storage_profile,
|
32
|
-
catalog_name: test_settings.ops_manager.vcloud.vdc.catalog_name,
|
33
|
-
)
|
34
|
-
when OpsManagerUiDrivers::VSPHERE_IAAS_TYPE then
|
35
|
-
configure_vcenter(
|
36
|
-
ip: test_settings.ops_manager.vcenter.creds.ip,
|
37
|
-
username: test_settings.ops_manager.vcenter.creds.username,
|
38
|
-
password: test_settings.ops_manager.vcenter.creds.password,
|
39
|
-
datacenter: test_settings.ops_manager.vcenter.datacenter,
|
40
|
-
datastores: test_settings.ops_manager.vcenter.datastore,
|
41
|
-
microbosh_vm_folder: test_settings.ops_manager.vcenter.microbosh_vm_folder,
|
42
|
-
microbosh_template_folder: test_settings.ops_manager.vcenter.microbosh_template_folder,
|
43
|
-
microbosh_disk_path: test_settings.ops_manager.vcenter.microbosh_disk_path,
|
44
|
-
)
|
45
|
-
when OpsManagerUiDrivers::AWS_IAAS_TYPE then
|
46
|
-
configure_aws(
|
47
|
-
aws_access_key: test_settings.ops_manager.aws.aws_access_key,
|
48
|
-
aws_secret_key: test_settings.ops_manager.aws.aws_secret_key,
|
49
|
-
vpc_id: test_settings.ops_manager.aws.vpc_id,
|
50
|
-
security_group: test_settings.ops_manager.aws.security_group,
|
51
|
-
key_pair_name: test_settings.ops_manager.aws.key_pair_name,
|
52
|
-
ssh_private_key: test_settings.ops_manager.aws.ssh_key
|
53
|
-
)
|
54
|
-
when OpsManagerUiDrivers::OPENSTACK_IAAS_TYPE then
|
55
|
-
configure_openstack(
|
56
|
-
identity_endpoint: test_settings.ops_manager.openstack.identity_endpoint,
|
57
|
-
username: test_settings.ops_manager.openstack.username,
|
58
|
-
password: test_settings.ops_manager.openstack.password,
|
59
|
-
tenant: test_settings.ops_manager.openstack.tenant,
|
60
|
-
security_group_name: test_settings.ops_manager.openstack.security_group_name,
|
61
|
-
key_pair_name: test_settings.ops_manager.openstack.key_pair_name,
|
62
|
-
ssh_private_key: test_settings.ops_manager.openstack.ssh_private_key
|
63
|
-
)
|
26
|
+
iaas_configuration.open_form
|
27
|
+
iaas_settings = Settings.for(test_settings)
|
28
|
+
iaas_settings.fields.each do |name, value|
|
29
|
+
iaas_configuration.set_field(name, value)
|
64
30
|
end
|
31
|
+
iaas_configuration.save_form
|
65
32
|
end
|
66
33
|
|
67
34
|
def add_azs(iaas_type, iaas_availability_zones)
|
@@ -99,12 +66,12 @@ module OpsManagerUiDrivers
|
|
99
66
|
else
|
100
67
|
iaas_networks && iaas_networks.each do |network|
|
101
68
|
networks.add_network(
|
102
|
-
name:
|
69
|
+
name: network['name'],
|
103
70
|
iaas_network_identifier: network['identifier'],
|
104
|
-
subnet:
|
105
|
-
reserved_ip_ranges:
|
106
|
-
dns:
|
107
|
-
gateway:
|
71
|
+
subnet: network['subnet'],
|
72
|
+
reserved_ip_ranges: network['reserved_ips'],
|
73
|
+
dns: network['dns'],
|
74
|
+
gateway: network['gateway'],
|
108
75
|
)
|
109
76
|
end
|
110
77
|
end
|
@@ -161,7 +128,7 @@ module OpsManagerUiDrivers
|
|
161
128
|
|
162
129
|
assign_networks_vsphere(
|
163
130
|
infrastructure_network: infrastructure_network['name'],
|
164
|
-
deployment_network:
|
131
|
+
deployment_network: deployment_network['name'],
|
165
132
|
)
|
166
133
|
else
|
167
134
|
assign_network(deployment_network: ops_manager.networks[0]['name'])
|
@@ -189,66 +156,9 @@ module OpsManagerUiDrivers
|
|
189
156
|
end
|
190
157
|
|
191
158
|
private
|
192
|
-
attr_reader :browser
|
193
159
|
|
194
|
-
|
195
|
-
iaas_configuration.configure_iaas do
|
196
|
-
iaas_configuration.set_vsphere_credentials(vcenter_ip: ip, username: username, password: password)
|
197
|
-
iaas_configuration.set_datacenter(datacenter)
|
198
|
-
iaas_configuration.set_datastores(datastores)
|
199
|
-
iaas_configuration.set_microbosh_vm_folder(microbosh_vm_folder)
|
200
|
-
iaas_configuration.set_microbosh_template_folder(microbosh_template_folder)
|
201
|
-
iaas_configuration.set_microbosh_disk_path(microbosh_disk_path)
|
202
|
-
end
|
203
|
-
end
|
160
|
+
attr_reader :browser, :iaas_configuration
|
204
161
|
|
205
|
-
def configure_vcloud(vcd_url:, organization:, user:, password:, datacenter:, storage_profile:, catalog_name:)
|
206
|
-
iaas_configuration.configure_iaas do
|
207
|
-
iaas_configuration.set_vcloud_credentials(vcd_url: vcd_url, organization: organization, user: user, password: password)
|
208
|
-
iaas_configuration.set_datacenter(datacenter)
|
209
|
-
iaas_configuration.set_storage_profile(storage_profile)
|
210
|
-
iaas_configuration.set_catalog_name(catalog_name)
|
211
|
-
end
|
212
|
-
end
|
213
|
-
|
214
|
-
def configure_aws(aws_access_key:, aws_secret_key:, vpc_id:, security_group:, key_pair_name:, ssh_private_key:)
|
215
|
-
iaas_configuration.configure_iaas do
|
216
|
-
iaas_configuration.set_aws_credentials(
|
217
|
-
access_key_id: aws_access_key,
|
218
|
-
secret_access_key: aws_secret_key,
|
219
|
-
vpc_id: vpc_id,
|
220
|
-
security_group: security_group,
|
221
|
-
key_pair_name: key_pair_name,
|
222
|
-
ssh_private_key: ssh_private_key
|
223
|
-
)
|
224
|
-
end
|
225
|
-
end
|
226
|
-
|
227
|
-
def configure_openstack(
|
228
|
-
identity_endpoint:,
|
229
|
-
username:,
|
230
|
-
password:,
|
231
|
-
tenant:,
|
232
|
-
security_group_name:,
|
233
|
-
key_pair_name:,
|
234
|
-
ssh_private_key:
|
235
|
-
)
|
236
|
-
iaas_configuration.configure_iaas do
|
237
|
-
iaas_configuration.set_openstack_credentials(
|
238
|
-
identity_endpoint: identity_endpoint,
|
239
|
-
username: username,
|
240
|
-
password: password,
|
241
|
-
tenant: tenant,
|
242
|
-
security_group_name: security_group_name,
|
243
|
-
key_pair_name: key_pair_name,
|
244
|
-
ssh_private_key: ssh_private_key
|
245
|
-
)
|
246
|
-
end
|
247
|
-
end
|
248
|
-
|
249
|
-
def iaas_configuration
|
250
|
-
@iaas_configuration ||= Version15::IaasConfiguration.new(browser: browser)
|
251
|
-
end
|
252
162
|
|
253
163
|
def availability_zones
|
254
164
|
@availability_zones ||= Version15::AvailabilityZones.new(browser: browser)
|
@@ -0,0 +1,116 @@
|
|
1
|
+
module OpsManagerUiDrivers
|
2
|
+
module Version15
|
3
|
+
module Settings
|
4
|
+
def self.for(test_settings)
|
5
|
+
settings_class = [Vcloud, Vsphere, AWS, OpenStack].find do |klass|
|
6
|
+
klass.works_with?(test_settings.iaas_type)
|
7
|
+
end or raise("Unsupported IaaS: #{test_settings.iaas_type.inspect}")
|
8
|
+
settings_class.new(test_settings)
|
9
|
+
end
|
10
|
+
|
11
|
+
class Vcloud
|
12
|
+
def self.works_with?(iaas_type)
|
13
|
+
iaas_type == 'vcloud'
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(test_settings)
|
17
|
+
@test_settings = test_settings
|
18
|
+
end
|
19
|
+
|
20
|
+
def fields
|
21
|
+
{
|
22
|
+
'vcd_url' => test_settings.ops_manager.vcloud.creds.url,
|
23
|
+
'organization' => test_settings.ops_manager.vcloud.creds.organization,
|
24
|
+
'vcd_username' => test_settings.ops_manager.vcloud.creds.user,
|
25
|
+
'vcd_password' => test_settings.ops_manager.vcloud.creds.password,
|
26
|
+
'datacenter' => test_settings.ops_manager.vcloud.vdc.name,
|
27
|
+
'storage_profile' => test_settings.ops_manager.vcloud.vdc.storage_profile,
|
28
|
+
'catalog_name' => test_settings.ops_manager.vcloud.vdc.catalog_name,
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
attr_reader :test_settings
|
35
|
+
end
|
36
|
+
|
37
|
+
class Vsphere
|
38
|
+
def self.works_with?(iaas_type)
|
39
|
+
iaas_type == 'vsphere'
|
40
|
+
end
|
41
|
+
|
42
|
+
def initialize(test_settings)
|
43
|
+
@test_settings = test_settings
|
44
|
+
end
|
45
|
+
|
46
|
+
def fields
|
47
|
+
{
|
48
|
+
'vcenter_ip' => test_settings.ops_manager.vcenter.creds.ip,
|
49
|
+
'vcenter_username' => test_settings.ops_manager.vcenter.creds.username,
|
50
|
+
'vcenter_password' => test_settings.ops_manager.vcenter.creds.password,
|
51
|
+
'datacenter' => test_settings.ops_manager.vcenter.datacenter,
|
52
|
+
'datastores_string' => test_settings.ops_manager.vcenter.datastore,
|
53
|
+
'microbosh_vm_folder' => test_settings.ops_manager.vcenter.microbosh_vm_folder,
|
54
|
+
'microbosh_template_folder' => test_settings.ops_manager.vcenter.microbosh_template_folder,
|
55
|
+
'microbosh_disk_path' => test_settings.ops_manager.vcenter.microbosh_disk_path,
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
attr_reader :test_settings
|
62
|
+
end
|
63
|
+
|
64
|
+
class AWS
|
65
|
+
def self.works_with?(iaas_type)
|
66
|
+
iaas_type == 'aws'
|
67
|
+
end
|
68
|
+
|
69
|
+
def initialize(test_settings)
|
70
|
+
@test_settings = test_settings
|
71
|
+
end
|
72
|
+
|
73
|
+
def fields
|
74
|
+
{
|
75
|
+
'access_key_id' => test_settings.ops_manager.aws.aws_access_key,
|
76
|
+
'secret_access_key' => test_settings.ops_manager.aws.aws_secret_key,
|
77
|
+
'vpc_id' => test_settings.ops_manager.aws.vpc_id,
|
78
|
+
'security_group' => test_settings.ops_manager.aws.security_group,
|
79
|
+
'key_pair_name' => test_settings.ops_manager.aws.key_pair_name,
|
80
|
+
'ssh_private_key' => test_settings.ops_manager.aws.ssh_key,
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
private
|
85
|
+
|
86
|
+
attr_reader :test_settings
|
87
|
+
end
|
88
|
+
|
89
|
+
class OpenStack
|
90
|
+
def self.works_with?(iaas_type)
|
91
|
+
iaas_type == 'openstack'
|
92
|
+
end
|
93
|
+
|
94
|
+
def initialize(test_settings)
|
95
|
+
@test_settings = test_settings
|
96
|
+
end
|
97
|
+
|
98
|
+
def fields
|
99
|
+
{
|
100
|
+
'identity_endpoint' => test_settings.ops_manager.openstack.identity_endpoint,
|
101
|
+
'username' => test_settings.ops_manager.openstack.username,
|
102
|
+
'password' => test_settings.ops_manager.openstack.password,
|
103
|
+
'tenant' => test_settings.ops_manager.openstack.tenant,
|
104
|
+
'security_group' => test_settings.ops_manager.openstack.security_group_name,
|
105
|
+
'key_pair_name' => test_settings.ops_manager.openstack.key_pair_name,
|
106
|
+
'ssh_private_key' => test_settings.ops_manager.openstack.ssh_private_key,
|
107
|
+
}
|
108
|
+
end
|
109
|
+
|
110
|
+
private
|
111
|
+
|
112
|
+
attr_reader :test_settings
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ops_manager_ui_drivers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pivotal, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: recursive-open-struct
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
description:
|
112
126
|
email:
|
113
127
|
- cf-tempest-eng+ops_manager_ui_drivers@pivotal.io
|
@@ -179,6 +193,7 @@ files:
|
|
179
193
|
- lib/ops_manager_ui_drivers/version15/product_logs.rb
|
180
194
|
- lib/ops_manager_ui_drivers/version15/product_resource_configuration.rb
|
181
195
|
- lib/ops_manager_ui_drivers/version15/product_status_helper.rb
|
196
|
+
- lib/ops_manager_ui_drivers/version15/settings.rb
|
182
197
|
- lib/ops_manager_ui_drivers/version15/setup.rb
|
183
198
|
- lib/ops_manager_ui_drivers/version15/state_change_progress.rb
|
184
199
|
- lib/ops_manager_ui_drivers/version15/web_ui.rb
|