cf 1.1.2.rc1 → 1.1.2.rc2

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.
@@ -1,3 +1,3 @@
1
1
  module CF
2
- VERSION = "1.1.2.rc1".freeze
2
+ VERSION = "1.1.2.rc2".freeze
3
3
  end
@@ -120,31 +120,21 @@ class CFTunnel
120
120
  end
121
121
 
122
122
  def push_helper(token)
123
- target_base = @client.target.sub(/^[^\.]+\./, "")
124
-
125
- url = "#{random_helper_url}.#{target_base}"
126
- is_v2 = @client.is_a?(CFoundry::V2::Client)
127
-
128
123
  app = @client.app
129
124
  app.name = HELPER_NAME
130
125
  app.command = "bundle exec ruby server.rb"
131
126
  app.total_instances = 1
132
127
  app.memory = 128
133
- app.env = { "CALDECOTT_AUTH" => token }
134
-
135
- if is_v2
136
- app.space = @client.current_space
137
- else
138
- app.services = [@service] if @service
139
- app.url = url
140
- end
128
+ app.env = {"CALDECOTT_AUTH" => token}
141
129
 
130
+ space = app.space = @client.current_space
142
131
  app.create!
143
132
 
144
- if is_v2
145
- app.bind(@service) if @service
146
- app.create_route(url)
147
- end
133
+ app.bind(@service) if @service
134
+
135
+ domain = @client.domains.find { |d| d.owning_organization == nil }
136
+
137
+ app.create_route(:domain => domain, :space => space, :host => random_helper_url)
148
138
 
149
139
  begin
150
140
  app.upload(HELPER_APP)
@@ -15,13 +15,7 @@ if ENV['CF_V2_RUN_INTEGRATION']
15
15
 
16
16
  before do
17
17
  Interact::Progress::Dots.start!
18
-
19
- BlueShell::Runner.run("#{cf_bin} target #{target}") do |runner|
20
- expect(runner).to say "Setting target"
21
- expect(runner).to say target
22
- runner.wait_for_exit
23
- end
24
-
18
+ set_target
25
19
  logout
26
20
  end
27
21
 
@@ -14,24 +14,21 @@ if ENV['CF_V2_RUN_INTEGRATION']
14
14
  let(:target) { ENV['CF_V2_TEST_TARGET'] }
15
15
  let(:organization) { ENV['CF_V2_TEST_ORGANIZATION'] }
16
16
  let(:space) { ENV['CF_V2_TEST_SPACE'] }
17
- let(:admin_username) { ENV['CF_V2_ADMIN_USERNAME'] }
18
- let(:admin_password) { ENV['CF_V2_ADMIN_PW'] }
17
+ let(:username) { ENV['CF_V2_ADMIN_USERNAME'] }
18
+ let(:password) { ENV['CF_V2_ADMIN_PW'] }
19
19
 
20
20
  let(:run_id) { TRAVIS_BUILD_ID.to_s + Time.new.to_f.to_s.gsub(".", "_") }
21
21
  let(:new_org_name) { "new-org-#{run_id}" }
22
22
 
23
23
  let(:client) do
24
24
  client = CFoundry::V2::Client.new("https://#{target}")
25
- client.login(admin_username, admin_password)
25
+ client.login(username, password)
26
26
  client
27
27
  end
28
28
 
29
29
  before do
30
30
  Interact::Progress::Dots.start!
31
- "cf login #{admin_username} --password #{admin_password} -o #{organization} -s #{space}"
32
- BlueShell::Runner.run("cf login #{admin_username} --password #{admin_password} -o #{organization} -s #{space}") do |runner|
33
- runner.wait_for_exit(60)
34
- end
31
+ login
35
32
  end
36
33
 
37
34
  after do
@@ -12,7 +12,7 @@ if ENV['CF_V2_RUN_INTEGRATION']
12
12
 
13
13
  let(:run_id) { TRAVIS_BUILD_ID.to_s + Time.new.to_f.to_s.gsub(".", "_") }
14
14
  let(:app) { "hello-sinatra-#{run_id}" }
15
- let(:service_name) { "rds_mysql-#{run_id}" }
15
+ let(:service_name) { "rds-mysql-#{run_id}" }
16
16
 
17
17
  before do
18
18
  FileUtils.rm_rf File.expand_path(CF::CONFIG_DIR)
@@ -65,7 +65,7 @@ if ENV['CF_V2_RUN_INTEGRATION']
65
65
 
66
66
  # create a service here
67
67
  expect(runner).to say "What kind?>"
68
- runner.send_keys "rds_mysql"
68
+ runner.send_keys "rds-mysql"
69
69
 
70
70
  expect(runner).to say "Name?>"
71
71
  runner.send_keys service_name
@@ -97,8 +97,8 @@ if ENV['CF_V2_RUN_INTEGRATION']
97
97
 
98
98
  BlueShell::Runner.run("#{cf_bin} services") do |runner|
99
99
  expect(runner).to say /name\s+service\s+provider\s+version\s+plan\s+bound apps/
100
- expect(runner).to say /rds_mysql-.+?\s+ # name
101
- rds_mysql\s+ # service
100
+ expect(runner).to say /rds-mysql-.+?\s+ # name
101
+ rds-mysql\s+ # service
102
102
  aws\s+ # provider
103
103
  n\/a\s+ # version
104
104
  10mb\s+ # plan
@@ -13,7 +13,9 @@ module FeaturesHelper
13
13
  end
14
14
 
15
15
  def logout
16
- BlueShell::Runner.run("#{cf_bin} logout")
16
+ BlueShell::Runner.run("#{cf_bin} logout") do |runner|
17
+ runner.wait_for_exit 60
18
+ end
17
19
  end
18
20
 
19
21
  def set_target
@@ -0,0 +1,54 @@
1
+ require "spec_helper"
2
+
3
+ describe CFTunnel do
4
+ # temporary solution until we get rspec-mocks! ;)
5
+ class NullObject
6
+ def initialize(id = "")
7
+ @id = id
8
+ end
9
+
10
+ def ==(other)
11
+ @id == other.id
12
+ end
13
+
14
+ def <=>(other)
15
+ @id <=> other.id
16
+ end
17
+
18
+ def nil?
19
+ true
20
+ end
21
+
22
+ def method_missing(*args)
23
+ return self
24
+ end
25
+ end
26
+
27
+ let(:client) { fake_client }
28
+ let(:service) { NullObject.new }
29
+
30
+ subject { CFTunnel.new(client, service) }
31
+
32
+ describe "#open!" do
33
+ describe "creating a route for caldecott" do
34
+ let!(:app) { NullObject.new("app") }
35
+ let!(:domain) { fake(:domain, :owning_organization => nil) }
36
+ let!(:route) { fake(:route) }
37
+ let!(:space) { fake(:space) }
38
+ let(:host) { "caldecott" }
39
+
40
+ before do
41
+ stub(subject).random_helper_url { "caldecott" }
42
+ stub(client).app { app }
43
+ stub(client).current_space { space }
44
+ stub(client).domains { [fake(:domain, :owning_organization => fake(:organization)), domain] }
45
+ end
46
+
47
+ it "adds a new route to caldecott app" do
48
+ mock(app).create_route(:domain => domain, :host => host, :space => space)
49
+
50
+ subject.send("push_helper", "this is a token")
51
+ end
52
+ end
53
+ end
54
+ 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: 1.1.2.rc1
4
+ version: 1.1.2.rc2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-05-24 00:00:00.000000000 Z
13
+ date: 2013-05-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable
@@ -51,10 +51,10 @@ dependencies:
51
51
  requirements:
52
52
  - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
- version: 1.3.0
54
+ version: 1.5.0
55
55
  - - <
56
56
  - !ruby/object:Gem::Version
57
- version: '1.4'
57
+ version: '1.6'
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: 1.3.0
65
+ version: 1.5.0
66
66
  - - <
67
67
  - !ruby/object:Gem::Version
68
- version: '1.4'
68
+ version: '1.6'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: interact
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -520,6 +520,7 @@ files:
520
520
  - spec/support/shared_examples/errors.rb
521
521
  - spec/support/shared_examples/input.rb
522
522
  - spec/tunnel/plugin_spec.rb
523
+ - spec/tunnel/tunnel_spec.rb
523
524
  - bin/cf
524
525
  homepage: http://github.com/cloudfoundry/cf
525
526
  licenses: []
@@ -535,7 +536,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
535
536
  version: '0'
536
537
  segments:
537
538
  - 0
538
- hash: -3839279030645441050
539
+ hash: -4028856741876005173
539
540
  required_rubygems_version: !ruby/object:Gem::Requirement
540
541
  none: false
541
542
  requirements:
@@ -666,3 +667,4 @@ test_files:
666
667
  - spec/support/shared_examples/errors.rb
667
668
  - spec/support/shared_examples/input.rb
668
669
  - spec/tunnel/plugin_spec.rb
670
+ - spec/tunnel/tunnel_spec.rb