cf 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/cf/cli/service/create.rb +1 -2
- data/lib/cf/version.rb +1 -1
- data/spec/features/account_lifecycle_spec.rb +1 -11
- data/spec/features/org_spec.rb +0 -12
- data/spec/features/push_flow_spec.rb +0 -5
- data/spec/features/services_spec.rb +27 -0
- data/spec/features/space_spec.rb +0 -9
- data/spec/features/switching_targets_spec.rb +8 -12
- data/spec/spec_helper.rb +1 -7
- data/spec/support/features_helper.rb +6 -2
- metadata +25 -7
|
@@ -94,12 +94,11 @@ module CF::Service
|
|
|
94
94
|
ask "Name?", :default => "#{offering.label}-#{random}"
|
|
95
95
|
end
|
|
96
96
|
|
|
97
|
-
def ask_plan(plans
|
|
97
|
+
def ask_plan(plans)
|
|
98
98
|
ask "Which plan?",
|
|
99
99
|
:choices => plans.sort_by(&:name),
|
|
100
100
|
:indexed => true,
|
|
101
101
|
:display => proc { |p| "#{p.name}: #{p.description || 'No description'}" },
|
|
102
|
-
:default => default_plan,
|
|
103
102
|
:complete => proc(&:name)
|
|
104
103
|
end
|
|
105
104
|
end
|
data/lib/cf/version.rb
CHANGED
|
@@ -15,15 +15,6 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
|
15
15
|
let(:target) { ENV['CF_V2_TEST_TARGET'] }
|
|
16
16
|
let(:username) { ENV['CF_V2_TEST_USER'] }
|
|
17
17
|
let(:password) { ENV['CF_V2_TEST_PASSWORD'] }
|
|
18
|
-
let(:organization) { ENV['CF_V2_TEST_ORGANIZATION'] }
|
|
19
|
-
let(:space) { ENV['CF_V2_TEST_SPACE'] }
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
let(:client) do
|
|
23
|
-
client = CFoundry::V2::Client.new("https://#{target}")
|
|
24
|
-
client.login(username, password)
|
|
25
|
-
client
|
|
26
|
-
end
|
|
27
18
|
|
|
28
19
|
before do
|
|
29
20
|
Interact::Progress::Dots.start!
|
|
@@ -46,8 +37,6 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
|
46
37
|
expect(runner).to say "Authenticating... OK"
|
|
47
38
|
end
|
|
48
39
|
|
|
49
|
-
login
|
|
50
|
-
|
|
51
40
|
# TODO: do this when cf delete-user is implemented
|
|
52
41
|
#BlueShell::Runner.run("#{cf_bin} delete-user #{email}") do |runner|
|
|
53
42
|
# expect(runner).to say "Really delete user #{email}?>"
|
|
@@ -56,6 +45,7 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
|
56
45
|
#end
|
|
57
46
|
|
|
58
47
|
# TODO: not this.
|
|
48
|
+
client = CFoundry::V2::Client.new("https://#{target}")
|
|
59
49
|
client.login(email, password)
|
|
60
50
|
user = client.current_user
|
|
61
51
|
guid = user.guid
|
data/spec/features/org_spec.rb
CHANGED
|
@@ -10,21 +10,9 @@ if ENV["CF_V2_RUN_INTEGRATION"]
|
|
|
10
10
|
WebMock.disable_net_connect!
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
let(:target) { ENV["CF_V2_TEST_TARGET"] }
|
|
14
|
-
let(:organization) { ENV["CF_V2_TEST_ORGANIZATION"] }
|
|
15
|
-
let(:space) { ENV["CF_V2_TEST_SPACE"] }
|
|
16
|
-
let(:username) { ENV["CF_V2_ADMIN_USERNAME"] }
|
|
17
|
-
let(:password) { ENV["CF_V2_ADMIN_PW"] }
|
|
18
|
-
|
|
19
13
|
let(:run_id) { TRAVIS_BUILD_ID.to_s + Time.new.to_f.to_s.gsub(".", "_") }
|
|
20
14
|
let(:new_org_name) { "new-org-#{run_id}" }
|
|
21
15
|
|
|
22
|
-
let(:client) do
|
|
23
|
-
client = CFoundry::V2::Client.new("https://#{target}")
|
|
24
|
-
client.login(username, password)
|
|
25
|
-
client
|
|
26
|
-
end
|
|
27
|
-
|
|
28
16
|
before do
|
|
29
17
|
Interact::Progress::Dots.start!
|
|
30
18
|
login
|
|
@@ -5,11 +5,6 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
|
5
5
|
describe 'A new user tries to use CF against v2', :ruby19 => true do
|
|
6
6
|
include CF::Interactive
|
|
7
7
|
|
|
8
|
-
let(:target) { ENV['CF_V2_TEST_TARGET'] }
|
|
9
|
-
let(:username) { ENV['CF_V2_TEST_USER'] }
|
|
10
|
-
let(:password) { ENV['CF_V2_TEST_PASSWORD'] }
|
|
11
|
-
let(:organization) { ENV['CF_V2_TEST_ORGANIZATION_TWO'] }
|
|
12
|
-
|
|
13
8
|
let(:run_id) { TRAVIS_BUILD_ID.to_s + Time.new.to_f.to_s.gsub(".", "_") }
|
|
14
9
|
let(:app) { "hello-sinatra-#{run_id}" }
|
|
15
10
|
let(:service_name) { "dummy-service-#{run_id}" }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
if ENV['CF_V2_RUN_INTEGRATION']
|
|
4
|
+
describe "Services" do
|
|
5
|
+
before do
|
|
6
|
+
login
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
describe "creating a service" do
|
|
10
|
+
describe "when the user leaves the line blank for a plan" do
|
|
11
|
+
let(:services) { [selected_service] }
|
|
12
|
+
|
|
13
|
+
it "re-prompts for the plan" do
|
|
14
|
+
BlueShell::Runner.run("#{cf_bin} create-service") do |runner|
|
|
15
|
+
expect(runner).to say "What kind?"
|
|
16
|
+
runner.send_keys "1"
|
|
17
|
+
expect(runner).to say "Name?"
|
|
18
|
+
runner.send_return
|
|
19
|
+
expect(runner).to say "Which plan?"
|
|
20
|
+
runner.send_return
|
|
21
|
+
expect(runner).to say "Which plan?"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
data/spec/features/space_spec.rb
CHANGED
|
@@ -12,18 +12,9 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
|
12
12
|
WebMock.disable_net_connect!
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
let(:target) { ENV['CF_V2_TEST_TARGET'] }
|
|
16
|
-
let(:username) { ENV['CF_V2_TEST_USER'] }
|
|
17
|
-
let(:password) { ENV['CF_V2_TEST_PASSWORD'] }
|
|
18
15
|
let(:organization) { ENV['CF_V2_TEST_ORGANIZATION'] }
|
|
19
16
|
let(:space) { ENV['CF_V2_TEST_SPACE'] }
|
|
20
17
|
|
|
21
|
-
let(:client) do
|
|
22
|
-
client = CFoundry::V2::Client.new("https://#{target}")
|
|
23
|
-
client.login(username, password)
|
|
24
|
-
client
|
|
25
|
-
end
|
|
26
|
-
|
|
27
18
|
before do
|
|
28
19
|
Interact::Progress::Dots.start!
|
|
29
20
|
login
|
|
@@ -4,12 +4,9 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
|
4
4
|
describe 'A new user tries to use CF against v2 production', :ruby19 => true do
|
|
5
5
|
|
|
6
6
|
let(:target) { ENV['CF_V2_TEST_TARGET'] }
|
|
7
|
-
let(:username) { ENV['CF_V2_TEST_USER'] }
|
|
8
|
-
let(:password) { ENV['CF_V2_TEST_PASSWORD'] }
|
|
9
7
|
let(:space) { ENV['CF_V2_TEST_SPACE'] }
|
|
10
|
-
let(:
|
|
11
|
-
let(:
|
|
12
|
-
let(:organization_two) { ENV['CF_V2_TEST_ORGANIZATION_TWO'] }
|
|
8
|
+
let(:space_2) { "#{ENV['CF_V2_TEST_SPACE']}-2"}
|
|
9
|
+
let(:organization_2) { ENV['CF_V2_TEST_ORGANIZATION_TWO'] }
|
|
13
10
|
|
|
14
11
|
let(:created_space_1) { "space-#{rand(10000)}"}
|
|
15
12
|
let(:created_space_2) { "space-#{rand(10000)}"}
|
|
@@ -17,7 +14,6 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
|
17
14
|
before do
|
|
18
15
|
Interact::Progress::Dots.start!
|
|
19
16
|
end
|
|
20
|
-
|
|
21
17
|
after do
|
|
22
18
|
logout
|
|
23
19
|
Interact::Progress::Dots.stop!
|
|
@@ -40,12 +36,12 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
|
40
36
|
it "can switch organizations and spaces" do
|
|
41
37
|
login
|
|
42
38
|
|
|
43
|
-
BlueShell::Runner.run("#{cf_bin} target -o #{
|
|
44
|
-
expect(runner).to say("Switching to organization #{
|
|
39
|
+
BlueShell::Runner.run("#{cf_bin} target -o #{organization_2}") do |runner|
|
|
40
|
+
expect(runner).to say("Switching to organization #{organization_2}")
|
|
45
41
|
expect(runner).to say("Space>")
|
|
46
|
-
runner.send_keys
|
|
42
|
+
runner.send_keys space_2
|
|
47
43
|
|
|
48
|
-
expect(runner).to say(/Switching to space #{
|
|
44
|
+
expect(runner).to say(/Switching to space #{space_2}/)
|
|
49
45
|
|
|
50
46
|
runner.wait_for_exit
|
|
51
47
|
end
|
|
@@ -55,8 +51,8 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
|
55
51
|
runner.wait_for_exit(15)
|
|
56
52
|
end
|
|
57
53
|
|
|
58
|
-
BlueShell::Runner.run("#{cf_bin} target -s #{
|
|
59
|
-
expect(runner).to say("Switching to space #{
|
|
54
|
+
BlueShell::Runner.run("#{cf_bin} target -s #{space_2}") do |runner|
|
|
55
|
+
expect(runner).to say("Switching to space #{space_2}")
|
|
60
56
|
runner.wait_for_exit(15)
|
|
61
57
|
end
|
|
62
58
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -11,7 +11,6 @@ require "ostruct"
|
|
|
11
11
|
require "fakefs/safe"
|
|
12
12
|
require "blue-shell"
|
|
13
13
|
|
|
14
|
-
INTEGRATE_WITH = ENV["INTEGRATE_WITH"] || "default"
|
|
15
14
|
TRAVIS_BUILD_ID = ENV["TRAVIS_BUILD_ID"]
|
|
16
15
|
|
|
17
16
|
OriginalFile = File
|
|
@@ -23,12 +22,7 @@ class FakeFS::File
|
|
|
23
22
|
end
|
|
24
23
|
|
|
25
24
|
def cf_bin
|
|
26
|
-
|
|
27
|
-
if INTEGRATE_WITH != 'default'
|
|
28
|
-
"rvm #{INTEGRATE_WITH}@cf do #{cf}"
|
|
29
|
-
else
|
|
30
|
-
cf
|
|
31
|
-
end
|
|
25
|
+
File.expand_path("#{SPEC_ROOT}/../bin/cf.dev")
|
|
32
26
|
end
|
|
33
27
|
|
|
34
28
|
Dir[File.expand_path('../support/**/*.rb', __FILE__)].each do |file|
|
|
@@ -3,10 +3,13 @@ module FeaturesHelper
|
|
|
3
3
|
set_target
|
|
4
4
|
logout
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
space = ENV['CF_V2_TEST_SPACE']
|
|
7
|
+
organization = ENV['CF_V2_TEST_ORGANIZATION']
|
|
8
|
+
username = ENV['CF_V2_TEST_USER']
|
|
9
|
+
password = ENV['CF_V2_TEST_PASSWORD']
|
|
7
10
|
|
|
8
11
|
cmd = "#{cf_bin} login #{username} --password #{password} -o #{organization}"
|
|
9
|
-
cmd += " -s #{
|
|
12
|
+
cmd += " -s #{space}"
|
|
10
13
|
BlueShell::Runner.run(cmd) do |runner|
|
|
11
14
|
runner.wait_for_exit 60
|
|
12
15
|
end
|
|
@@ -19,6 +22,7 @@ module FeaturesHelper
|
|
|
19
22
|
end
|
|
20
23
|
|
|
21
24
|
def set_target
|
|
25
|
+
target = ENV['CF_V2_TEST_TARGET']
|
|
22
26
|
BlueShell::Runner.run("#{cf_bin} target #{target}") do |runner|
|
|
23
27
|
runner.wait_for_exit(20)
|
|
24
28
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cf
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -51,10 +51,10 @@ dependencies:
|
|
|
51
51
|
requirements:
|
|
52
52
|
- - ! '>='
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 2.0.
|
|
54
|
+
version: 2.0.2
|
|
55
55
|
- - <
|
|
56
56
|
- !ruby/object:Gem::Version
|
|
57
|
-
version: '
|
|
57
|
+
version: '3.0'
|
|
58
58
|
type: :runtime
|
|
59
59
|
prerelease: false
|
|
60
60
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -62,10 +62,10 @@ dependencies:
|
|
|
62
62
|
requirements:
|
|
63
63
|
- - ! '>='
|
|
64
64
|
- !ruby/object:Gem::Version
|
|
65
|
-
version: 2.0.
|
|
65
|
+
version: 2.0.2
|
|
66
66
|
- - <
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '
|
|
68
|
+
version: '3.0'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: interact
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -168,6 +168,22 @@ dependencies:
|
|
|
168
168
|
- - ~>
|
|
169
169
|
- !ruby/object:Gem::Version
|
|
170
170
|
version: '2.1'
|
|
171
|
+
- !ruby/object:Gem::Dependency
|
|
172
|
+
name: anchorman
|
|
173
|
+
requirement: !ruby/object:Gem::Requirement
|
|
174
|
+
none: false
|
|
175
|
+
requirements:
|
|
176
|
+
- - ! '>='
|
|
177
|
+
- !ruby/object:Gem::Version
|
|
178
|
+
version: '0'
|
|
179
|
+
type: :development
|
|
180
|
+
prerelease: false
|
|
181
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
182
|
+
none: false
|
|
183
|
+
requirements:
|
|
184
|
+
- - ! '>='
|
|
185
|
+
- !ruby/object:Gem::Version
|
|
186
|
+
version: '0'
|
|
171
187
|
- !ruby/object:Gem::Dependency
|
|
172
188
|
name: blue-shell
|
|
173
189
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -516,6 +532,7 @@ files:
|
|
|
516
532
|
- spec/features/login_spec.rb
|
|
517
533
|
- spec/features/org_spec.rb
|
|
518
534
|
- spec/features/push_flow_spec.rb
|
|
535
|
+
- spec/features/services_spec.rb
|
|
519
536
|
- spec/features/space_spec.rb
|
|
520
537
|
- spec/features/switching_targets_spec.rb
|
|
521
538
|
- spec/manifests/errors_spec.rb
|
|
@@ -549,7 +566,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
549
566
|
version: '0'
|
|
550
567
|
segments:
|
|
551
568
|
- 0
|
|
552
|
-
hash:
|
|
569
|
+
hash: 142598794769615443
|
|
553
570
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
554
571
|
none: false
|
|
555
572
|
requirements:
|
|
@@ -558,7 +575,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
558
575
|
version: '0'
|
|
559
576
|
requirements: []
|
|
560
577
|
rubyforge_project: cf
|
|
561
|
-
rubygems_version: 1.8.
|
|
578
|
+
rubygems_version: 1.8.24
|
|
562
579
|
signing_key:
|
|
563
580
|
specification_version: 3
|
|
564
581
|
summary: Friendly command-line interface for Cloud Foundry.
|
|
@@ -676,6 +693,7 @@ test_files:
|
|
|
676
693
|
- spec/features/login_spec.rb
|
|
677
694
|
- spec/features/org_spec.rb
|
|
678
695
|
- spec/features/push_flow_spec.rb
|
|
696
|
+
- spec/features/services_spec.rb
|
|
679
697
|
- spec/features/space_spec.rb
|
|
680
698
|
- spec/features/switching_targets_spec.rb
|
|
681
699
|
- spec/manifests/errors_spec.rb
|