vcloud-edge_gateway 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 1.4.0 (2014-12-03)
2
+
3
+ Features:
4
+
5
+ - Update vCloud Core to 0.14.0 to improve speed of integration tests.
6
+ - Update vCloud Core to 0.16.0 for `vcloud-logout` utility.
7
+
1
8
  ## 1.3.0 (2014-10-14)
2
9
 
3
10
  Features:
@@ -10,13 +17,17 @@ Features:
10
17
 
11
18
  ## 1.2.0 (2014-09-11)
12
19
 
20
+ Features:
21
+
13
22
  - Upgrade dependency on vCloud Core to 0.11.0 which prevents plaintext
14
23
  passwords in FOG_RC. Please use tokens via vcloud-login as per
15
24
  the documentation: http://gds-operations.github.io/vcloud-tools/usage/
16
25
 
17
26
  ## 1.1.0 (2014-08-11)
18
27
 
19
- Update to vCloud Core 0.10.0 for the following:
28
+ Features:
29
+
30
+ Update to vCloud Core 0.10.0 for the following:
20
31
 
21
32
  - New vcloud-login tool for fetching session tokens without the need to
22
33
  store your password in a plaintext FOG_RC file.
@@ -26,7 +37,9 @@ Update to vCloud Core 0.10.0 for the following:
26
37
 
27
38
  ## 1.0.2 (2014-07-14)
28
39
 
29
- Update the dependency on vCloud Core to version 0.6.0 to avoid dependency issues._
40
+ Bugfix:
41
+
42
+ - Update the dependency on vCloud Core to version 0.6.0 to avoid dependency issues.
30
43
 
31
44
  ## 1.0.1 (2014-06-13)
32
45
 
@@ -12,7 +12,7 @@ gateway: "My gateway name"
12
12
  load_balancer_service:
13
13
  pools:
14
14
  - name: 'pool-001'
15
- description: 'pool for balancing http(s)"
15
+ description: 'pool for balancing http(s)'
16
16
  service:
17
17
  http:
18
18
  port: 80
@@ -43,7 +43,7 @@ load_balancer_service:
43
43
 
44
44
  virtual_servers:
45
45
  - name: 'vs-website'
46
- description: 'virtual server for my website"
46
+ description: 'virtual server for my website'
47
47
  ip_address: 20.20.20.20
48
48
  network: '00000000-1111-2222-3333-444444444444'
49
49
  pool: 'pool-001'
data/jenkins_tests.sh CHANGED
@@ -28,5 +28,6 @@ rm -rf vcloud-tools-testing-config
28
28
  # Never log token to STDOUT.
29
29
  set +x
30
30
  eval $(printenv API_PASSWORD | bundle exec vcloud-login)
31
+ trap "bundle exec vcloud-logout" EXIT
31
32
 
32
33
  bundle exec rake integration
@@ -1,6 +1,6 @@
1
1
  module Vcloud
2
2
  module EdgeGateway
3
- VERSION = '1.3.0'
3
+ VERSION = '1.4.0'
4
4
  end
5
5
  end
6
6
 
@@ -46,14 +46,13 @@ module Vcloud
46
46
  end
47
47
 
48
48
  it "should only make one EdgeGateway update task, to minimise EdgeGateway reload events" do
49
- start_time = Time.now.getutc
50
- task_list_before_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
49
+ last_task = IntegrationHelper.get_last_task(@test_params.edge_gateway)
51
50
  diff = EdgeGateway::Configure.new(@initial_load_balancer_config_file, @vars_config_file).update
52
- task_list_after_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
51
+ tasks_elapsed = IntegrationHelper.get_tasks_since(@test_params.edge_gateway, last_task)
53
52
 
54
53
  expect(diff.keys).to eq([:LoadBalancerService])
55
54
  expect(diff[:LoadBalancerService]).to have_at_least(1).items
56
- expect(task_list_after_update.size - task_list_before_update.size).to be(1)
55
+ expect(tasks_elapsed).to have(1).items
57
56
  end
58
57
 
59
58
  it "should have configured at least one LoadBancer Pool entry" do
@@ -164,17 +163,6 @@ module Vcloud
164
163
  :edge_gateway_ext_network_ip => @test_params.provider_network_ip,
165
164
  }
166
165
  end
167
-
168
- def get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(timestamp)
169
- vcloud_time = timestamp.strftime('%FT%T.000Z')
170
- q = Vcloud::Core::QueryRunner.new
171
- q.run('task',
172
- :filter =>
173
- "name==networkConfigureEdgeGatewayServices;objectName==#{@test_params.edge_gateway};startDate=ge=#{vcloud_time}",
174
- :sortDesc => 'startDate',
175
- )
176
- end
177
-
178
166
  end
179
167
 
180
168
  end
@@ -37,15 +37,14 @@ module Vcloud
37
37
  end
38
38
 
39
39
  it "should only create one edgeGateway update task when updating the configuration" do
40
- start_time = Time.now.getutc
41
- task_list_before_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
40
+ last_task = IntegrationHelper.get_last_task(@test_params.edge_gateway)
42
41
  diff = EdgeGateway::Configure.new(@initial_config_file, @vars_config_file).update
43
- task_list_after_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
42
+ tasks_elapsed = IntegrationHelper.get_tasks_since(@test_params.edge_gateway, last_task)
44
43
 
45
44
  expect(diff.keys).to eq([:FirewallService, :NatService])
46
45
  expect(diff[:FirewallService]).to have_at_least(1).items
47
- expect(diff[:NatService]).to have_at_least(1).items
48
- expect(task_list_after_update.size - task_list_before_update.size).to be(1)
46
+ expect(diff[:NatService]).to have_at_least(1).items
47
+ expect(tasks_elapsed).to have(1).items
49
48
  end
50
49
 
51
50
  it "should now have nat and firewall rules configured, no load balancer yet" do
@@ -57,34 +56,31 @@ module Vcloud
57
56
  end
58
57
 
59
58
  it "should not update the EdgeGateway again if the config hasn't changed" do
60
- start_time = Time.now.getutc
61
- task_list_before_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
59
+ last_task = IntegrationHelper.get_last_task(@test_params.edge_gateway)
62
60
  diff = EdgeGateway::Configure.new(@initial_config_file, @vars_config_file).update
63
- task_list_after_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
61
+ tasks_elapsed = IntegrationHelper.get_tasks_since(@test_params.edge_gateway, last_task)
64
62
 
65
63
  expect(diff).to eq({})
66
- expect(task_list_after_update.size - task_list_before_update.size).to be(0)
64
+ expect(tasks_elapsed).to have(0).items
67
65
  end
68
66
 
69
67
  it "should only create one additional edgeGateway update task when adding the LoadBalancer config" do
70
- start_time = Time.now.getutc
71
- task_list_before_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
68
+ last_task = IntegrationHelper.get_last_task(@test_params.edge_gateway)
72
69
  diff = EdgeGateway::Configure.new(@adding_load_balancer_config_file, @vars_config_file).update
73
- task_list_after_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
70
+ tasks_elapsed = IntegrationHelper.get_tasks_since(@test_params.edge_gateway, last_task)
74
71
 
75
72
  expect(diff.keys).to eq([:LoadBalancerService])
76
73
  expect(diff[:LoadBalancerService]).to have_at_least(1).items
77
- expect(task_list_after_update.size - task_list_before_update.size).to be(1)
74
+ expect(tasks_elapsed).to have(1).items
78
75
  end
79
76
 
80
77
  it "should not update the EdgeGateway again if we reapply the 'adding load balancer' config" do
81
- start_time = Time.now.getutc
82
- task_list_before_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
78
+ last_task = IntegrationHelper.get_last_task(@test_params.edge_gateway)
83
79
  diff = EdgeGateway::Configure.new(@adding_load_balancer_config_file, @vars_config_file).update
84
- task_list_after_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
80
+ tasks_elapsed = IntegrationHelper.get_tasks_since(@test_params.edge_gateway, last_task)
85
81
 
86
82
  expect(diff).to eq({})
87
- expect(task_list_after_update.size - task_list_before_update.size).to be(0)
83
+ expect(tasks_elapsed).to have(0).items
88
84
  end
89
85
 
90
86
  end
@@ -124,18 +120,6 @@ module Vcloud
124
120
  edge_gateway_ext_network_ip: @test_params.provider_network_ip,
125
121
  }
126
122
  end
127
-
128
- def get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(timestamp)
129
- vcloud_time = timestamp.strftime('%FT%T.000Z')
130
- q = Vcloud::Core::QueryRunner.new
131
-
132
- q.run('task',
133
- :filter =>
134
- "name==networkConfigureEdgeGatewayServices;objectName==#{@test_params.edge_gateway};startDate=ge=#{vcloud_time}",
135
- :sortDesc => 'startDate',
136
- )
137
- end
138
-
139
123
  end
140
124
 
141
125
  end
@@ -48,14 +48,13 @@ module Vcloud
48
48
  end
49
49
 
50
50
  it "should only make one EdgeGateway update task, to minimise EdgeGateway reload events" do
51
- start_time = Time.now.getutc
52
- task_list_before_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
51
+ last_task = IntegrationHelper.get_last_task(@test_params.edge_gateway)
53
52
  diff = EdgeGateway::Configure.new(@initial_nat_config_file, @vars_config_file).update
54
- task_list_after_update = get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(start_time)
53
+ tasks_elapsed = IntegrationHelper.get_tasks_since(@test_params.edge_gateway, last_task)
55
54
 
56
55
  expect(diff.keys).to eq([:NatService])
57
56
  expect(diff[:NatService]).to have_at_least(1).items
58
- expect(task_list_after_update.size - task_list_before_update.size).to be(1)
57
+ expect(tasks_elapsed).to have(1).items
59
58
  end
60
59
 
61
60
  it "should have configured at least one NAT rule" do
@@ -187,16 +186,6 @@ module Vcloud
187
186
  :original_ip => @test_params.provider_network_ip,
188
187
  }
189
188
  end
190
-
191
- def get_all_edge_gateway_update_tasks_ordered_by_start_date_since_time(timestamp)
192
- vcloud_time = timestamp.strftime('%FT%T.000Z')
193
- q = Vcloud::Core::QueryRunner.new
194
- q.run('task',
195
- :filter => "name==networkConfigureEdgeGatewayServices;objectName==#{@test_params.edge_gateway};startDate=ge=#{vcloud_time}",
196
- :sortDesc => 'startDate',
197
- )
198
- end
199
-
200
189
  end
201
190
 
202
191
  end
@@ -13,5 +13,27 @@ module IntegrationHelper
13
13
  }
14
14
  end
15
15
 
16
+ def self.get_last_task(gateway_name)
17
+ tasks = Vcloud::Core::QueryRunner.new.run('task',
18
+ :filter => "name==networkConfigureEdgeGatewayServices;" + \
19
+ "objectName==#{gateway_name}",
20
+ :sortDesc => 'startDate',
21
+ :pageSize => 1,
22
+ )
16
23
 
24
+ raise "Unable to find last vCloud task" if tasks.empty?
25
+ tasks.first
26
+ end
27
+
28
+ def self.get_tasks_since(gateway_name, task)
29
+ tasks = Vcloud::Core::QueryRunner.new.run('task',
30
+ :filter => "name==networkConfigureEdgeGatewayServices;" + \
31
+ "objectName==#{gateway_name};" + \
32
+ "startDate=ge=#{task.fetch(:startDate)}",
33
+ :sortDesc => 'startDate',
34
+ )
35
+
36
+ tasks.reject! { |t| t.fetch(:href) == task.fetch(:href) }
37
+ tasks
38
+ end
17
39
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.required_ruby_version = '>= 1.9.3'
23
23
 
24
- s.add_runtime_dependency 'vcloud-core', '~> 0.13.0'
24
+ s.add_runtime_dependency 'vcloud-core', '~> 0.16.0'
25
25
  s.add_runtime_dependency 'hashdiff'
26
26
  s.add_development_dependency 'pry'
27
27
  s.add_development_dependency 'rake'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcloud-edge_gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-14 00:00:00.000000000 Z
12
+ date: 2014-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vcloud-core
16
- requirement: &18676320 !ruby/object:Gem::Requirement
16
+ requirement: &5059140 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.13.0
21
+ version: 0.16.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *18676320
24
+ version_requirements: *5059140
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: hashdiff
27
- requirement: &18674160 !ruby/object:Gem::Requirement
27
+ requirement: &5057080 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *18674160
35
+ version_requirements: *5057080
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: pry
38
- requirement: &18670380 !ruby/object:Gem::Requirement
38
+ requirement: &5067820 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *18670380
46
+ version_requirements: *5067820
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &18686460 !ruby/object:Gem::Requirement
49
+ requirement: &5065480 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *18686460
57
+ version_requirements: *5065480
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rspec
60
- requirement: &18683520 !ruby/object:Gem::Requirement
60
+ requirement: &5917940 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 2.14.1
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *18683520
68
+ version_requirements: *5917940
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubocop
71
- requirement: &18696860 !ruby/object:Gem::Requirement
71
+ requirement: &5913460 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.23.0
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *18696860
79
+ version_requirements: *5913460
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: simplecov
82
- requirement: &18695360 !ruby/object:Gem::Requirement
82
+ requirement: &5926620 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 0.7.1
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *18695360
90
+ version_requirements: *5926620
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: gem_publisher
93
- requirement: &18692800 !ruby/object:Gem::Requirement
93
+ requirement: &5925020 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - =
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.2.0
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *18692800
101
+ version_requirements: *5925020
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: vcloud-tools-tester
104
- requirement: &18721100 !ruby/object:Gem::Requirement
104
+ requirement: &5921500 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: 0.2.0
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *18721100
112
+ version_requirements: *5921500
113
113
  description: Tool to configure a VMware vCloud Edge Gateway. Uses vcloud-core.
114
114
  email:
115
115
  - anna.shipman@digital.cabinet-office.gov.uk
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  version: '0'
221
221
  segments:
222
222
  - 0
223
- hash: -4151502617445342539
223
+ hash: -2969149712000054635
224
224
  requirements: []
225
225
  rubyforge_project:
226
226
  rubygems_version: 1.8.11