opsmgr 0.26.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/LEGAL.txt +13 -0
  3. data/README.md +21 -0
  4. data/lib/opsmgr.rb +12 -0
  5. data/lib/opsmgr/api/client.rb +85 -0
  6. data/lib/opsmgr/api/endpoints_factory.rb +39 -0
  7. data/lib/opsmgr/api/http_client.rb +204 -0
  8. data/lib/opsmgr/api/results.rb +257 -0
  9. data/lib/opsmgr/api/version20/endpoints.rb +93 -0
  10. data/lib/opsmgr/cmd/bosh_command.rb +213 -0
  11. data/lib/opsmgr/cmd/ops_manager.rb +100 -0
  12. data/lib/opsmgr/environments.rb +77 -0
  13. data/lib/opsmgr/errand_runner.rb +75 -0
  14. data/lib/opsmgr/log.rb +70 -0
  15. data/lib/opsmgr/product_upload_wrapper.rb +69 -0
  16. data/lib/opsmgr/renderer.rb +23 -0
  17. data/lib/opsmgr/renderer/aws.rb +147 -0
  18. data/lib/opsmgr/renderer/noop.rb +21 -0
  19. data/lib/opsmgr/settings/microbosh/installation_settings.rb +84 -0
  20. data/lib/opsmgr/settings/microbosh/job.rb +54 -0
  21. data/lib/opsmgr/settings/microbosh/job_list.rb +27 -0
  22. data/lib/opsmgr/settings/microbosh/network.rb +21 -0
  23. data/lib/opsmgr/settings/microbosh/product.rb +88 -0
  24. data/lib/opsmgr/settings/microbosh/product_list.rb +27 -0
  25. data/lib/opsmgr/settings/microbosh/property.rb +31 -0
  26. data/lib/opsmgr/settings/microbosh/property_list.rb +27 -0
  27. data/lib/opsmgr/tasks.rb +16 -0
  28. data/lib/opsmgr/tasks/bosh.rake +70 -0
  29. data/lib/opsmgr/tasks/destroy.rake +42 -0
  30. data/lib/opsmgr/tasks/info.rake +19 -0
  31. data/lib/opsmgr/tasks/opsmgr.rake +179 -0
  32. data/lib/opsmgr/tasks/product.rake +53 -0
  33. data/lib/opsmgr/teapot.rb +51 -0
  34. data/lib/opsmgr/teapot/app.rb +50 -0
  35. data/lib/opsmgr/teapot/spec_helper.rb +33 -0
  36. data/lib/opsmgr/ui_helpers/add_first_user_spec.rb +25 -0
  37. data/lib/opsmgr/ui_helpers/config_helper.rb +151 -0
  38. data/lib/opsmgr/ui_helpers/delete_installation_spec.rb +41 -0
  39. data/lib/opsmgr/ui_helpers/delete_product_if_present_spec.rb +43 -0
  40. data/lib/opsmgr/ui_helpers/delete_product_spec.rb +39 -0
  41. data/lib/opsmgr/ui_helpers/export_installation_spec.rb +31 -0
  42. data/lib/opsmgr/ui_helpers/get_latest_install_log_spec.rb +29 -0
  43. data/lib/opsmgr/ui_helpers/import_installation_spec.rb +29 -0
  44. data/lib/opsmgr/ui_helpers/import_stemcell_spec.rb +30 -0
  45. data/lib/opsmgr/ui_helpers/microbosh/configure_microbosh_spec.rb +31 -0
  46. data/lib/opsmgr/ui_helpers/trigger_install_spec.rb +35 -0
  47. data/lib/opsmgr/ui_helpers/ui_spec_runner.rb +117 -0
  48. data/lib/opsmgr/ui_helpers/uncheck_errands_spec.rb +29 -0
  49. data/lib/opsmgr/ui_helpers/upload_and_add_product_spec.rb +27 -0
  50. data/lib/opsmgr/ui_helpers/upload_and_upgrade_product_spec.rb +36 -0
  51. data/lib/opsmgr/version.rb +11 -0
  52. metadata +360 -0
@@ -0,0 +1,39 @@
1
+ require_relative 'config_helper'
2
+
3
+ RSpec.describe 'Deleting a product', order: :defined do
4
+ let!(:current_ops_manager) { ops_manager_driver }
5
+ let!(:env_settings) { fetch_environment_settings }
6
+
7
+ it 'creates the admin user and logs in' do
8
+ poll_up_to_mins(10) do
9
+ current_ops_manager.setup_page.setup_or_login(
10
+ user: env_settings.ops_manager.username,
11
+ password: env_settings.ops_manager.password,
12
+ )
13
+
14
+ expect(page).to have_content('Installation Dashboard')
15
+ end
16
+ end
17
+
18
+ it 'removes the product from the dashboard' do
19
+ current_ops_manager.product_dashboard.delete_product(product_name)
20
+ end
21
+
22
+ it 'deletes' do
23
+ current_ops_manager.product_dashboard.apply_updates
24
+ end
25
+
26
+ it 'waits for a successful installation' do
27
+ poll_up_to_mins(delete_timeout) do
28
+ expect(current_ops_manager.state_change_progress).to be_state_change_success
29
+ end
30
+ end
31
+ end
32
+ # Copyright (c) 2014-2015 Pivotal Software, Inc.
33
+ # All rights reserved.
34
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
35
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
36
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
37
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
38
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
39
+ # USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,31 @@
1
+ require_relative 'config_helper'
2
+
3
+ RSpec.describe 'Exporting the installation', order: :defined do
4
+ let!(:current_ops_manager) { ops_manager_driver }
5
+ let!(:current_ops_manager_api_driver) { ops_manager_api_driver }
6
+ let!(:env_settings) { fetch_environment_settings }
7
+
8
+ it 'creates the admin user and logs in' do
9
+ poll_up_to_mins(10) do
10
+ current_ops_manager.setup_page.setup_or_login(
11
+ user: env_settings.ops_manager.username,
12
+ password: env_settings.ops_manager.password,
13
+ )
14
+
15
+ expect(page).to have_content('Installation Dashboard')
16
+ end
17
+ end
18
+
19
+ it 'exports the installation' do
20
+ exported_installation_path = current_ops_manager_api_driver.export_installation.path
21
+ FileUtils.mv(exported_installation_path, export_destination_path)
22
+ end
23
+ end
24
+ # Copyright (c) 2014-2015 Pivotal Software, Inc.
25
+ # All rights reserved.
26
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
27
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
28
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
30
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
31
+ # USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ require_relative 'config_helper'
2
+
3
+ RSpec.describe 'Getting latest install log', order: :defined do
4
+ let!(:current_ops_manager) { ops_manager_driver }
5
+ let!(:env_settings) { fetch_environment_settings }
6
+
7
+ it 'creates the admin user and logs in' do
8
+ poll_up_to_mins(10) do
9
+ current_ops_manager.setup_page.setup_or_login(
10
+ user: env_settings.ops_manager.username,
11
+ password: env_settings.ops_manager.password,
12
+ )
13
+
14
+ expect(page).to have_content('Installation Dashboard')
15
+ end
16
+ end
17
+
18
+ it 'prints the most recent install log' do
19
+ puts current_ops_manager.product_dashboard.most_recent_install_log
20
+ end
21
+ end
22
+ # Copyright (c) 2014-2015 Pivotal Software, Inc.
23
+ # All rights reserved.
24
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
25
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
26
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
29
+ # USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ require_relative 'config_helper'
2
+
3
+ RSpec.describe 'Importing the installation', order: :defined do
4
+ let!(:current_ops_manager) { ops_manager_driver }
5
+ let!(:env_settings) { fetch_environment_settings }
6
+
7
+ it 'creates the admin user and logs in' do
8
+ poll_up_to_mins(10) do
9
+ current_ops_manager.setup_page.setup_or_login(
10
+ user: env_settings.ops_manager.username,
11
+ password: env_settings.ops_manager.password,
12
+ )
13
+
14
+ expect(page).to have_content('Installation Dashboard')
15
+ end
16
+ end
17
+
18
+ it 'imports the installation' do
19
+ current_ops_manager.product_dashboard.import_installation_file(import_file_path)
20
+ end
21
+ end
22
+ # Copyright (c) 2014-2015 Pivotal Software, Inc.
23
+ # All rights reserved.
24
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
25
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
26
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
29
+ # USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,30 @@
1
+ require_relative 'config_helper'
2
+
3
+ RSpec.describe 'Importing the stemcell', order: :defined do
4
+ let!(:current_ops_manager) { ops_manager_driver }
5
+ let!(:env_settings) { fetch_environment_settings }
6
+
7
+ it 'creates the admin user and logs in' do
8
+ poll_up_to_mins(10) do
9
+ current_ops_manager.setup_page.setup_or_login(
10
+ user: env_settings.ops_manager.username,
11
+ password: env_settings.ops_manager.password,
12
+ )
13
+
14
+ expect(page).to have_content('Installation Dashboard')
15
+ end
16
+ end
17
+
18
+ it 'imports the stemcell' do
19
+ current_ops_manager.product(product_name).upload_stemcell(stemcell_file_path)
20
+ current_ops_manager.product_dashboard.version_for_product(product_name)
21
+ end
22
+ end
23
+ # Copyright (c) 2014-2015 Pivotal Software, Inc.
24
+ # All rights reserved.
25
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
26
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
27
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
29
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
30
+ # USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,31 @@
1
+ require_relative '../config_helper'
2
+
3
+ RSpec.describe 'Configuring µBosh', order: :defined do
4
+ let(:current_ops_manager) { ops_manager_driver }
5
+ let!(:env_settings) { fetch_environment_settings }
6
+
7
+ it 'creates the admin user and logs in' do
8
+ poll_up_to_mins(10) do
9
+ current_ops_manager.setup_page.setup_or_login(
10
+ user: env_settings.ops_manager.username,
11
+ password: env_settings.ops_manager.password,
12
+ )
13
+
14
+ expect(page).to have_content('Installation Dashboard')
15
+ end
16
+ end
17
+
18
+ it 'configures µBosh' do
19
+ product_dashboard = current_ops_manager.product_dashboard
20
+ product_dashboard.revert_pending_changes if product_dashboard.revert_available?
21
+ current_ops_manager.ops_manager_director.configure_bosh_product(env_settings)
22
+ end
23
+ end
24
+ # Copyright (c) 2014-2015 Pivotal Software, Inc.
25
+ # All rights reserved.
26
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
27
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
28
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
30
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
31
+ # USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,35 @@
1
+ require_relative 'config_helper'
2
+
3
+ RSpec.describe 'Triggering Install', order: :defined do
4
+ let!(:current_ops_manager) { ops_manager_driver }
5
+ let!(:env_settings) { fetch_environment_settings }
6
+
7
+ it 'creates the admin user and logs in' do
8
+ poll_up_to_mins(10) do
9
+ current_ops_manager.setup_page.setup_or_login(
10
+ user: env_settings.ops_manager.username,
11
+ password: env_settings.ops_manager.password,
12
+ )
13
+
14
+ expect(page).to have_content('Installation Dashboard')
15
+ end
16
+ end
17
+
18
+ it 'installs' do
19
+ current_ops_manager.product_dashboard.apply_updates
20
+ end
21
+
22
+ it 'waits for a successful installation' do
23
+ poll_up_to_mins(install_timeout) do
24
+ expect(current_ops_manager.state_change_progress).to be_state_change_success
25
+ end
26
+ end
27
+ end
28
+ # Copyright (c) 2014-2015 Pivotal Software, Inc.
29
+ # All rights reserved.
30
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
31
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
32
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
33
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
34
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
35
+ # USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,117 @@
1
+ require 'rspec'
2
+
3
+ class UiSpecRunner
4
+ def initialize(environment:, om_version:)
5
+ raise 'No Environment Name provided' if environment.nil? || environment.empty?
6
+ raise 'No Ops Manager Version provided' if om_version.nil? || om_version.empty?
7
+
8
+ ENV['ENVIRONMENT_NAME'] = environment
9
+ ENV['OM_VERSION'] = om_version
10
+ end
11
+
12
+ def add_first_user
13
+ run_spec([spec_path + '/add_first_user_spec.rb'])
14
+ end
15
+
16
+ def configure_microbosh
17
+ run_spec([microbosh_spec_path + '/configure_microbosh_spec.rb'])
18
+ end
19
+
20
+ def trigger_install(install_timeout)
21
+ ENV['INSTALL_TIMEOUT'] = install_timeout
22
+
23
+ run_spec([spec_path + '/trigger_install_spec.rb'])
24
+ end
25
+
26
+ def get_latest_install_log
27
+ run_spec([spec_path + '/get_latest_install_log_spec.rb'])
28
+ end
29
+
30
+ def upload_and_add_product(product_path, product_name)
31
+ ENV['PRODUCT_PATH'] = product_path
32
+ ENV['PRODUCT_NAME'] = product_name
33
+
34
+ run_spec([spec_path + '/upload_and_add_product_spec.rb'])
35
+ end
36
+
37
+ def upload_and_upgrade_product(product_path, product_name)
38
+ ENV['PRODUCT_PATH'] = product_path
39
+ ENV['PRODUCT_NAME'] = product_name
40
+
41
+ run_spec([spec_path + '/upload_and_upgrade_product_spec.rb'])
42
+ end
43
+
44
+ def export_installation(export_destination)
45
+ ENV['EXPORT_DESTINATION'] = export_destination
46
+
47
+ run_spec([spec_path + '/export_installation_spec.rb'])
48
+ end
49
+
50
+ def import_installation(import_file)
51
+ ENV['IMPORT_FILE'] = import_file
52
+
53
+ run_spec([spec_path + '/import_installation_spec.rb'])
54
+ end
55
+
56
+ def delete_installation
57
+ run_spec([spec_path + '/delete_installation_spec.rb'])
58
+ end
59
+
60
+ def delete_product(product_name, timeout)
61
+ ENV['PRODUCT_NAME'] = product_name
62
+ ENV['DELETE_TIMEOUT'] = timeout
63
+
64
+ run_spec([spec_path + '/delete_product_spec.rb'])
65
+ end
66
+
67
+ def delete_product_if_present(product_name, timeout)
68
+ ENV['PRODUCT_NAME'] = product_name
69
+ ENV['DELETE_TIMEOUT'] = timeout
70
+
71
+ run_spec([spec_path + '/delete_product_if_present_spec.rb'])
72
+ end
73
+
74
+ def import_stemcell(stemcell_file, product_name)
75
+ ENV['STEMCELL_FILE'] = stemcell_file
76
+ ENV['PRODUCT_NAME'] = product_name
77
+
78
+ run_spec([spec_path + '/import_stemcell_spec.rb'])
79
+ end
80
+
81
+ def uncheck_errands(product_name, errand_names)
82
+ require 'json'
83
+
84
+ ENV['PRODUCT_NAME'] = product_name
85
+ ENV['ERRAND_NAMES'] = JSON.generate(errand_names)
86
+
87
+ run_spec([spec_path + '/uncheck_errands_spec.rb'])
88
+ end
89
+
90
+ private
91
+
92
+ def spec_path
93
+ File.dirname(__FILE__)
94
+ end
95
+
96
+ def microbosh_spec_path
97
+ File.join(spec_path, 'microbosh')
98
+ end
99
+
100
+ def run_spec(spec_to_run)
101
+ RSpecExiter.exit_rspec(RSpec::Core::Runner.run(spec_to_run))
102
+ end
103
+ end
104
+
105
+ module RSpecExiter
106
+ def self.exit_rspec(exit_code)
107
+ exit exit_code
108
+ end
109
+ end
110
+ # Copyright (c) 2014-2015 Pivotal Software, Inc.
111
+ # All rights reserved.
112
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
113
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
114
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
115
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
116
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
117
+ # USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ require_relative 'config_helper'
2
+
3
+ RSpec.describe 'Unchecking Errands', order: :defined do
4
+ let!(:current_ops_manager) { ops_manager_driver }
5
+ let!(:env_settings) { fetch_environment_settings }
6
+
7
+ it 'logs in' do
8
+ current_ops_manager.setup_page.setup_or_login(
9
+ user: env_settings.ops_manager.username,
10
+ password: env_settings.ops_manager.password,
11
+ )
12
+ end
13
+
14
+ it 'unchecks the errands provided for the given product' do
15
+ product_errands_driver = current_ops_manager.product(product_name).product_errands
16
+
17
+ errand_names.each do |errand_name|
18
+ product_errands_driver.disable_errand(errand_name)
19
+ end
20
+ end
21
+ end
22
+ # Copyright (c) 2014-2015 Pivotal Software, Inc.
23
+ # All rights reserved.
24
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
25
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
26
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
29
+ # USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,27 @@
1
+ require_relative 'config_helper'
2
+
3
+ RSpec.describe 'Uploading and Adding a Product', order: :defined do
4
+ let!(:current_ops_manager) { ops_manager_driver }
5
+ let(:env_settings) { fetch_environment_settings }
6
+
7
+ it 'logs in' do
8
+ current_ops_manager.setup_page.setup_or_login(
9
+ user: env_settings.ops_manager.username,
10
+ password: env_settings.ops_manager.password,
11
+ )
12
+ end
13
+
14
+ it 'adds the product' do
15
+ expect do
16
+ current_ops_manager.available_products.add_product_to_install(product_name)
17
+ end.not_to raise_error
18
+ end
19
+ end
20
+ # Copyright (c) 2014-2015 Pivotal Software, Inc.
21
+ # All rights reserved.
22
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
24
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
27
+ # USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,36 @@
1
+ require_relative 'config_helper'
2
+
3
+ RSpec.describe 'Uploading and Upgrading a Product', order: :defined do
4
+ let!(:current_ops_manager) { ops_manager_driver }
5
+ let!(:env_settings) { fetch_environment_settings }
6
+
7
+ it 'logs in' do
8
+ current_ops_manager.setup_page.setup_or_login(
9
+ user: env_settings.ops_manager.username,
10
+ password: env_settings.ops_manager.password,
11
+ )
12
+ end
13
+
14
+ it 'uploads the product' do
15
+ current_ops_manager.product_dashboard.import_product_from(product_path)
16
+ if (flash_error = all('.flash-message.error').first)
17
+ fail flash_error.text
18
+ end
19
+ end
20
+
21
+ it 'upgrades the product' do
22
+ current_ops_manager.product_dashboard.upgrade_product(product_name)
23
+
24
+ expect(
25
+ current_ops_manager.available_products.product_added?(product_name)
26
+ ).to eq(true)
27
+ end
28
+ end
29
+ # Copyright (c) 2014-2015 Pivotal Software, Inc.
30
+ # All rights reserved.
31
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
32
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
33
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
35
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
36
+ # USE OR OTHER DEALINGS IN THE SOFTWARE.