cf 4.2.9.rc5 → 4.2.10.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cf/cli.rb +3 -6
- data/lib/cf/cli/app/env.rb +3 -3
- data/lib/cf/cli/app/events.rb +1 -1
- data/lib/cf/cli/app/files.rb +3 -3
- data/lib/cf/cli/app/health.rb +1 -1
- data/lib/cf/cli/app/instances.rb +1 -1
- data/lib/cf/cli/app/logs.rb +2 -2
- data/lib/cf/cli/app/rename.rb +1 -1
- data/lib/cf/cli/app/scale.rb +1 -1
- data/lib/cf/cli/app/stats.rb +1 -1
- data/lib/cf/cli/organization/rename.rb +1 -1
- data/lib/cf/cli/route/map.rb +1 -1
- data/lib/cf/cli/route/unmap.rb +1 -1
- data/lib/cf/cli/service/create.rb +20 -69
- data/lib/cf/cli/service/delete.rb +1 -1
- data/lib/cf/cli/service/rename.rb +1 -1
- data/lib/cf/cli/service/services.rb +32 -12
- data/lib/cf/cli/space/rename.rb +1 -1
- data/lib/cf/cli/space/switch.rb +1 -1
- data/lib/cf/cli/start/colors.rb +1 -1
- data/lib/cf/cli/start/targets.rb +1 -1
- data/lib/cf/cli/user/create.rb +1 -1
- data/lib/cf/cli/user/passwd.rb +1 -1
- data/lib/cf/cli/user/register.rb +1 -1
- data/lib/cf/cli/user/users.rb +1 -1
- data/lib/cf/version.rb +1 -1
- data/lib/manifests/manifests.rb +25 -41
- data/lib/tasks/gem_release.rake +2 -2
- data/spec/cf/cli/app/delete_spec.rb +2 -2
- data/spec/cf/cli/app/push/create_spec.rb +1 -1
- data/spec/cf/cli/service/create_spec.rb +4 -52
- data/spec/cf/cli/service/rename_spec.rb +1 -1
- data/spec/cf/cli/service/services_spec.rb +34 -63
- data/spec/cf/cli/space/space_spec.rb +1 -1
- data/spec/cf/cli/space/spaces_spec.rb +3 -3
- data/spec/factories/cfoundry/v2/{managed_service_instances_factory.rb → service_instances_factory.rb} +2 -2
- data/spec/features/services_spec.rb +0 -96
- data/spec/integration/push_flow_spec.rb +1 -26
- data/spec/manifests/manifests_spec.rb +25 -46
- data/spec/support/features_helper.rb +3 -36
- data/spec/support/matchers.rb +3 -14
- metadata +66 -24
- checksums.yaml +0 -7
- data/lib/cf/cli/service/service_instance_helper.rb +0 -99
- data/spec/assets/env/Gemfile +0 -4
- data/spec/assets/env/Gemfile.lock +0 -17
- data/spec/assets/env/env_test.rb +0 -58
- data/spec/assets/hello-sinatra/manifest.yml +0 -17
- data/spec/cf/cli/service/service_instance_helper_spec.rb +0 -155
- data/spec/factories/cfoundry/v2/user_provided_service_instances_factory.rb +0 -12
- data/spec/features/manifests_spec.rb +0 -86
data/lib/cf/cli/user/passwd.rb
CHANGED
@@ -3,7 +3,7 @@ require "cf/cli/user/base"
|
|
3
3
|
module CF::User
|
4
4
|
class Passwd < Base
|
5
5
|
desc "Update the current user's password"
|
6
|
-
group :admin, :user
|
6
|
+
group :admin, :user
|
7
7
|
input :password, :desc => "Current password"
|
8
8
|
input :new_password, :desc => "New password"
|
9
9
|
input :verify, :desc => "Repeat new password"
|
data/lib/cf/cli/user/register.rb
CHANGED
@@ -5,7 +5,7 @@ module CF::User
|
|
5
5
|
def precondition; end
|
6
6
|
|
7
7
|
desc "Create a user and log in"
|
8
|
-
group :admin, :user
|
8
|
+
group :admin, :user
|
9
9
|
input :email, :desc => "Desired email", :argument => :optional
|
10
10
|
input :password, :desc => "Desired password"
|
11
11
|
input :verify, :desc => "Repeat password"
|
data/lib/cf/cli/user/users.rb
CHANGED
data/lib/cf/version.rb
CHANGED
data/lib/manifests/manifests.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require "yaml"
|
2
2
|
require "set"
|
3
|
-
require "cf/cli/service/create"
|
4
3
|
|
5
4
|
require "manifests/loader"
|
6
5
|
|
@@ -183,23 +182,16 @@ module CFManifests
|
|
183
182
|
unless services.empty?
|
184
183
|
meta["services"] = {}
|
185
184
|
|
186
|
-
services.each do |
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
meta["services"][service_instance.name] = {
|
197
|
-
"label" => service.label,
|
198
|
-
"provider" => service.provider,
|
199
|
-
"version" => service.version,
|
200
|
-
"plan" => service_plan.name
|
201
|
-
}
|
202
|
-
end
|
185
|
+
services.each do |i|
|
186
|
+
p = i.service_plan
|
187
|
+
s = p.service
|
188
|
+
|
189
|
+
meta["services"][i.name] = {
|
190
|
+
"label" => s.label,
|
191
|
+
"provider" => s.provider,
|
192
|
+
"version" => s.version,
|
193
|
+
"plan" => p.name
|
194
|
+
}
|
203
195
|
end
|
204
196
|
end
|
205
197
|
|
@@ -300,33 +292,25 @@ module CFManifests
|
|
300
292
|
if instance = client.service_instance_by_name(name)
|
301
293
|
to_bind << instance
|
302
294
|
else
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
credentials: svc[:credentials]
|
309
|
-
else
|
310
|
-
offering = offerings.find { |o|
|
311
|
-
o.label == (svc[:label] || svc[:type] || svc[:vendor]) &&
|
312
|
-
(!svc[:version] || o.version == svc[:version]) &&
|
313
|
-
(o.provider == (svc[:provider] || "core"))
|
314
|
-
}
|
295
|
+
offering = offerings.find { |o|
|
296
|
+
o.label == (svc[:label] || svc[:type] || svc[:vendor]) &&
|
297
|
+
(!svc[:version] || o.version == svc[:version]) &&
|
298
|
+
(o.provider == (svc[:provider] || "core"))
|
299
|
+
}
|
315
300
|
|
316
|
-
|
301
|
+
fail "Unknown service offering: #{svc.inspect}." unless offering
|
317
302
|
|
318
|
-
|
319
|
-
|
320
|
-
|
303
|
+
plan = offering.service_plans.find { |p|
|
304
|
+
p.name == (svc[:plan] || "D100")
|
305
|
+
}
|
321
306
|
|
322
|
-
|
307
|
+
fail "Unknown service plan: #{svc[:plan]}." unless plan
|
323
308
|
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
end
|
309
|
+
invoke :create_service,
|
310
|
+
:name => name,
|
311
|
+
:offering => offering,
|
312
|
+
:plan => plan,
|
313
|
+
:app => app
|
330
314
|
end
|
331
315
|
end
|
332
316
|
|
data/lib/tasks/gem_release.rake
CHANGED
@@ -20,8 +20,8 @@ namespace :gem do
|
|
20
20
|
def generate_release_notes(old_version)
|
21
21
|
print_with_purpose "Generating release notes..."
|
22
22
|
file_name = "release_#{gem_version}"
|
23
|
-
|
24
|
-
|
23
|
+
sh!("anchorman notes --name=#{file_name} --from=v#{old_version}")
|
24
|
+
sh!("git add release_notes")
|
25
25
|
end
|
26
26
|
|
27
27
|
def sh!(cmd)
|
@@ -52,8 +52,8 @@ module CF
|
|
52
52
|
end
|
53
53
|
|
54
54
|
context "when there are apps" do
|
55
|
-
let(:service_1) { build(:
|
56
|
-
let(:service_2) { build(:
|
55
|
+
let(:service_1) { build(:service_instance, :name => "service-instance-name-1") }
|
56
|
+
let(:service_2) { build(:service_instance, :name => "service-instance-name-2") }
|
57
57
|
|
58
58
|
let(:service_binding_1) { build(:service_binding, :service_instance => service_1) }
|
59
59
|
let(:service_binding_2) { build(:service_binding, :service_instance => service_2) }
|
@@ -7,7 +7,7 @@ module CF
|
|
7
7
|
let(:given) { {} }
|
8
8
|
let(:global) { {:color => false, :quiet => true} }
|
9
9
|
|
10
|
-
let(:service_instances) { Array.new(5) { build(:
|
10
|
+
let(:service_instances) { Array.new(5) { build(:service_instance) } }
|
11
11
|
let(:lucid64) { build(:stack, :name => "lucid64") }
|
12
12
|
let(:client) { build(:client) }
|
13
13
|
|
@@ -73,8 +73,8 @@ module CF
|
|
73
73
|
} }
|
74
74
|
|
75
75
|
it "creates the specified service" do
|
76
|
-
CFoundry::V2::
|
77
|
-
CFoundry::V2::
|
76
|
+
CFoundry::V2::ServiceInstance.any_instance.should_receive(:service_plan=).with(service_plan)
|
77
|
+
CFoundry::V2::ServiceInstance.any_instance.should_receive(:create!)
|
78
78
|
capture_output { command }
|
79
79
|
end
|
80
80
|
end
|
@@ -89,59 +89,11 @@ module CF
|
|
89
89
|
let(:services) { [selected_service] }
|
90
90
|
|
91
91
|
it "uses case insensitive match" do
|
92
|
-
CFoundry::V2::
|
93
|
-
CFoundry::V2::
|
92
|
+
CFoundry::V2::ServiceInstance.any_instance.should_receive(:service_plan=).with(service_plan)
|
93
|
+
CFoundry::V2::ServiceInstance.any_instance.should_receive(:create!)
|
94
94
|
capture_output { command }
|
95
95
|
end
|
96
96
|
end
|
97
|
-
|
98
|
-
describe "when selecting the user-provided service" do
|
99
|
-
let(:services) { [build(:service), build(:service)] }
|
100
|
-
let(:user_provided_service) { build(:service, label: "user-provided")}
|
101
|
-
|
102
|
-
before do
|
103
|
-
client.stub(:services).and_return(services)
|
104
|
-
end
|
105
|
-
|
106
|
-
it "asks for an instance name and credentials" do
|
107
|
-
should_ask("What kind?", hash_including(choices: include(has_label("user-provided")))) { user_provided_service }
|
108
|
-
should_ask("Name?", anything) { "user-provided-service-name-1" }
|
109
|
-
|
110
|
-
should_print("What credential parameters should applications use to connect to this service instance? (e.g. hostname, port, password)")
|
111
|
-
should_ask("Keys") { "host, port, user name" }
|
112
|
-
should_print("'user name' is not a valid key")
|
113
|
-
should_ask("Keys") { "host, port" }
|
114
|
-
should_ask("host") { "example.com" }
|
115
|
-
should_ask("port") { "8080" }
|
116
|
-
mock_with_progress("Creating service user-provided-service-name-1")
|
117
|
-
|
118
|
-
instance = client.user_provided_service_instance
|
119
|
-
client.should_receive(:user_provided_service_instance).and_return(instance)
|
120
|
-
instance.should_receive(:create!)
|
121
|
-
|
122
|
-
capture_output { command }
|
123
|
-
|
124
|
-
instance.credentials['host'].should == 'example.com'
|
125
|
-
instance.credentials['port'].should == '8080'
|
126
|
-
end
|
127
|
-
|
128
|
-
# lame, i know
|
129
|
-
context "when invoked from another command" do
|
130
|
-
let(:params) { {
|
131
|
-
:credentials => {"k" => "v"},
|
132
|
-
:name => "service-name",
|
133
|
-
:offering => UPDummy.new,
|
134
|
-
} }
|
135
|
-
|
136
|
-
it "creates a user-provided service" do
|
137
|
-
instance = client.user_provided_service_instance
|
138
|
-
client.should_receive(:user_provided_service_instance).and_return(instance)
|
139
|
-
instance.should_receive(:create!)
|
140
|
-
|
141
|
-
Mothership.new.invoke(:create_service, params, {})
|
142
|
-
end
|
143
|
-
end
|
144
|
-
end
|
145
97
|
end
|
146
98
|
end
|
147
99
|
end
|
@@ -51,7 +51,7 @@ describe CF::Service::Rename do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
context "when there are services" do
|
54
|
-
let(:services) { Array.new(2) { build(:
|
54
|
+
let(:services) { Array.new(2) { build(:service_instance) } }
|
55
55
|
let(:renamed_service) { services.first }
|
56
56
|
|
57
57
|
context "when the defaults are used" do
|
@@ -42,34 +42,29 @@ module CF
|
|
42
42
|
|
43
43
|
let(:service_plan) { build(:service_plan, :service => build(:service, :version => "service_version", :provider => "provider")) }
|
44
44
|
let(:service_binding) { build(:service_binding, :app => app) }
|
45
|
-
let(:service1) { build(:
|
45
|
+
let(:service1) { build(:service_instance, :service_plan => service_plan, :service_bindings => [service_binding]) }
|
46
46
|
|
47
47
|
let(:service_instances) { [service1] }
|
48
48
|
let(:current_space) { build(:space, :name => "the space") }
|
49
49
|
|
50
50
|
subject do
|
51
|
-
capture_output {
|
51
|
+
capture_output { Mothership.new.invoke(:services, inputs, given, global) }
|
52
52
|
end
|
53
53
|
|
54
54
|
before do
|
55
|
-
|
55
|
+
stub_client_and_precondition
|
56
56
|
client.stub(:service_bindings).and_return([service_binding])
|
57
57
|
end
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
it "produces a table of services" do
|
65
|
-
subject
|
66
|
-
stdout.rewind
|
67
|
-
output = stdout.read
|
59
|
+
it "produces a table of services" do
|
60
|
+
subject
|
61
|
+
stdout.rewind
|
62
|
+
output = stdout.read
|
68
63
|
|
69
|
-
|
64
|
+
expect(output).to match /Getting services in the space.*OK/
|
70
65
|
|
71
|
-
|
72
|
-
|
66
|
+
expect(output).to match /name\s+service\s+provider\s+version\s+plan\s+bound apps/
|
67
|
+
expect(output).to match /service-instance-.+?\s+ # name
|
73
68
|
service-.*?\s+ # service
|
74
69
|
provider.*?\s+ # provider
|
75
70
|
service_version\s+ # version
|
@@ -77,69 +72,45 @@ module CF
|
|
77
72
|
app-name-\d+\s+ # bound apps
|
78
73
|
/x
|
79
74
|
|
80
|
-
|
81
|
-
|
82
|
-
context "when one of the services does not have a service plan" do
|
83
|
-
let(:service_instances) { [service1, service2]}
|
84
|
-
let(:service2) { build(:user_provided_service_instance, :service_bindings => [service_binding]) }
|
75
|
+
end
|
85
76
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
77
|
+
context "when one of the services does not have a service plan" do
|
78
|
+
let(:service_instances) { [service1, service2]}
|
79
|
+
let(:service2) { build(:service_instance, :service_plan => nil, :service_bindings => [service_binding]) }
|
80
|
+
it 'still produces a table of service' do
|
81
|
+
subject
|
82
|
+
stdout.rewind
|
83
|
+
output = stdout.read
|
90
84
|
|
91
|
-
|
85
|
+
expect(output).to match /Getting services in the space.*OK/
|
92
86
|
|
93
|
-
|
87
|
+
expect(output).to match /name\s+service\s+provider\s+version\s+plan\s+bound apps/
|
94
88
|
|
95
|
-
|
89
|
+
expect(output).to match /service-instance-.+?\s+ # name
|
96
90
|
service-.*?\s+ # service
|
97
91
|
provider.*?\s+ # provider
|
98
92
|
service_version\s+ # version
|
99
93
|
service-plan-.*?\s+ # plan
|
100
|
-
app-name-\d+\s+
|
94
|
+
app-name-\d+\s+ # bound apps
|
101
95
|
/x
|
102
96
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
app-name-\d+\s+
|
97
|
+
expect(output).to match /service-instance-.+?\s+ # name
|
98
|
+
none\s+ # service
|
99
|
+
none\s+ # provider
|
100
|
+
none\s+ # version
|
101
|
+
none\s+ # plan
|
102
|
+
app-name-\d+\s+ # bound apps
|
109
103
|
/x
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
context 'when given --marketplace argument' do
|
114
|
-
it 'lists services on the target' do
|
115
|
-
client.stub(:services => Array.new(3) { build(:service) })
|
116
|
-
cf %W[services --marketplace]
|
117
|
-
expect(output).to say("Getting services... OK")
|
118
|
-
expect(output).to say(/service\s+version\s+provider\s+plans\s+description/)
|
119
|
-
end
|
120
104
|
end
|
121
105
|
end
|
122
106
|
|
123
|
-
context "when the user is not targeted to a space" do
|
124
|
-
before do
|
125
|
-
service_command.stub(:check_logged_in).and_return(true)
|
126
|
-
client.stub(:current_organization).and_return(true)
|
127
|
-
end
|
128
|
-
let(:service_command) { CF::Service::Services.new(nil, {}) }
|
129
|
-
let(:current_space) { nil }
|
130
|
-
|
131
|
-
subject do
|
132
|
-
capture_output { service_command.execute(:services, inputs, global) }
|
133
|
-
|
134
|
-
#capture_output { CF::CLI.new.invoke(:services, inputs, given, global) }
|
135
|
-
end
|
136
|
-
|
137
|
-
it "returns an error" do
|
138
|
-
subject
|
139
|
-
stdout.rewind
|
140
|
-
output = stderr.read
|
141
107
|
|
142
|
-
|
108
|
+
context 'when given --marketplace argument' do
|
109
|
+
it 'lists services on the target' do
|
110
|
+
client.stub(:services => Array.new(3) { build(:service) })
|
111
|
+
cf %W[services --marketplace]
|
112
|
+
expect(output).to say("Getting services... OK")
|
113
|
+
expect(output).to say(/service\s+version\s+provider\s+plans\s+description/)
|
143
114
|
end
|
144
115
|
end
|
145
116
|
end
|
@@ -29,7 +29,7 @@ module CF
|
|
29
29
|
|
30
30
|
let(:apps) { Array.new(2) { build(:app) } }
|
31
31
|
let(:domains) { Array.new(2) { build(:domain) } }
|
32
|
-
let(:services) { Array.new(2) { build(:
|
32
|
+
let(:services) { Array.new(2) { build(:service_instance) } }
|
33
33
|
let(:space) { build(:space, :name => "some_space_name", :apps => apps, :service_instances => services, :domains => domains, :organization => organization ) }
|
34
34
|
let(:spaces) { [space] }
|
35
35
|
let(:organization) { build(:organization, :name => "Spacey Org") }
|
@@ -5,9 +5,9 @@ module CF
|
|
5
5
|
describe Spaces do
|
6
6
|
let(:full) { false }
|
7
7
|
let(:app) { build(:app) }
|
8
|
-
let!(:space_1) { build(:space, :name => "bb_second", :apps => [app], :service_instances => [build(:
|
9
|
-
let!(:space_2) { build(:space, :name => "aa_first", :apps => [app], :service_instances => [build(:
|
10
|
-
let!(:space_3) { build(:space, :name => "cc_last", :apps => [app], :service_instances => [build(:
|
8
|
+
let!(:space_1) { build(:space, :name => "bb_second", :apps => [app], :service_instances => [build(:service_instance)]) }
|
9
|
+
let!(:space_2) { build(:space, :name => "aa_first", :apps => [app], :service_instances => [build(:service_instance)], :domains => [build(:domain)]) }
|
10
|
+
let!(:space_3) { build(:space, :name => "cc_last", :apps => [app], :service_instances => [build(:service_instance)], :domains => [build(:domain)]) }
|
11
11
|
let(:spaces) { [space_1, space_2, space_3] }
|
12
12
|
let(:organization) { build(:organization, :spaces => spaces, :name => "foo") }
|
13
13
|
let(:client) do
|
@@ -1,5 +1,5 @@
|
|
1
1
|
FactoryGirl.define do
|
2
|
-
factory :
|
2
|
+
factory :service_instance, :class => CFoundry::V2::ServiceInstance do
|
3
3
|
sequence(:guid) { |n| "service-instance-guid-#{n}" }
|
4
4
|
sequence(:name) { |n| "service-instance-name-#{n}" }
|
5
5
|
|
@@ -9,4 +9,4 @@ FactoryGirl.define do
|
|
9
9
|
|
10
10
|
initialize_with { new(guid, client) }
|
11
11
|
end
|
12
|
-
end
|
12
|
+
end
|
@@ -6,25 +6,6 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
6
6
|
login
|
7
7
|
end
|
8
8
|
|
9
|
-
describe "listing services" do
|
10
|
-
let(:service1) { "some-provided-instance-#{Time.now.to_i}" }
|
11
|
-
let(:service2) { "cf-managed-instance-#{Time.now.to_i}" }
|
12
|
-
|
13
|
-
it "shows all service instances in the space" do
|
14
|
-
create_service_instance("user-provided", service1, credentials: { hostname: "myservice.com"} )
|
15
|
-
create_service_instance("dummy-dev", service2, plan: "small")
|
16
|
-
|
17
|
-
BlueShell::Runner.run("#{cf_bin} services") do |runner|
|
18
|
-
expect(runner).to say /#{service1}\s+user-provided\s+n\/a\s+n\/a\s+n\/a\s+.*/
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
after do
|
23
|
-
delete_service(service1)
|
24
|
-
delete_service(service2)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
9
|
describe "creating a service" do
|
29
10
|
describe "when the user leaves the line blank for a plan" do
|
30
11
|
it "re-prompts for the plan" do
|
@@ -39,83 +20,6 @@ if ENV['CF_V2_RUN_INTEGRATION']
|
|
39
20
|
end
|
40
21
|
end
|
41
22
|
end
|
42
|
-
|
43
|
-
describe "when the service is a user-provided instance" do
|
44
|
-
let(:service_name) { "my-private-db-#{Random.rand(1000) + 1000}"}
|
45
|
-
|
46
|
-
it "can create a service instance" do
|
47
|
-
BlueShell::Runner.run("#{cf_bin} create-service") do |runner|
|
48
|
-
expect(runner).to say "What kind?"
|
49
|
-
runner.send_keys "user-provided"
|
50
|
-
|
51
|
-
expect(runner).to say "Name?"
|
52
|
-
runner.send_keys service_name
|
53
|
-
|
54
|
-
expect(runner).to say "What credential parameters should applications use to connect to this service instance? (e.g. hostname, port, password)\nKeys"
|
55
|
-
runner.send_keys "hostname"
|
56
|
-
expect(runner).to say "hostname"
|
57
|
-
runner.send_keys "myserviceinstance.com"
|
58
|
-
|
59
|
-
expect(runner).to say /Creating service #{service_name}.+ OK/
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
after do
|
64
|
-
delete_service(service_name)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
describe "binding to a service" do
|
70
|
-
let(:app_folder) { "env" }
|
71
|
-
let(:app_name) { "services_env_test_app-#{Time.now.to_i}" }
|
72
|
-
|
73
|
-
let(:service_name) { "some-provided-instance-#{Time.now.to_i}" }
|
74
|
-
|
75
|
-
it "can bind and unbind user-provided services to apps" do
|
76
|
-
push_app(app_folder, app_name, start_command: "'bundle exec ruby env_test.rb -p $PORT'", timeout: 90)
|
77
|
-
create_service_instance("user-provided", service_name, credentials: { hostname: "myservice.com"} )
|
78
|
-
|
79
|
-
BlueShell::Runner.run("#{cf_bin} bind-service") do |runner|
|
80
|
-
expect(runner).to say "Which application?>"
|
81
|
-
runner.send_keys app_name
|
82
|
-
|
83
|
-
expect(runner).to say "Which service?>"
|
84
|
-
runner.send_keys service_name
|
85
|
-
|
86
|
-
expect(runner).to say "Binding #{service_name} to #{app_name}... OK"
|
87
|
-
end
|
88
|
-
|
89
|
-
BlueShell::Runner.run("#{cf_bin} unbind-service") do |runner|
|
90
|
-
expect(runner).to say "Which application?"
|
91
|
-
runner.send_keys app_name
|
92
|
-
|
93
|
-
expect(runner).to say "Which service?>"
|
94
|
-
runner.send_keys service_name
|
95
|
-
|
96
|
-
expect(runner).to say "Unbinding #{service_name} from #{app_name}... OK"
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
after do
|
101
|
-
delete_app(app_name)
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
def delete_service(service_name)
|
106
|
-
BlueShell::Runner.run("#{cf_bin} delete-service --service #{service_name} --force") do |runner|
|
107
|
-
expect(runner).to say "Deleting #{service_name}... OK"
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
def delete_app(app_name, routes=true)
|
112
|
-
delete_cmd = "#{cf_bin} delete #{app_name}"
|
113
|
-
delete_cmd + " --routes" if routes
|
114
|
-
BlueShell::Runner.run(delete_cmd) do |runner|
|
115
|
-
expect(runner).to say "Really delete #{app_name}?"
|
116
|
-
runner.send_keys "y"
|
117
|
-
expect(runner).to say "Deleting #{app_name}... OK"
|
118
|
-
end
|
119
23
|
end
|
120
24
|
end
|
121
25
|
end
|