vcloud-walker 3.6.0 → 4.0.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,7 @@
1
+ ## 4.0.0 (2015-01-22)
2
+
3
+ - Update dependency on vCloud Core to 1.0.0 since it is now stable.
4
+
1
5
  ## 3.6.0 (2014-12-03)
2
6
 
3
7
  Features:
data/jenkins_tests.sh CHANGED
@@ -2,10 +2,12 @@
2
2
  set -eu
3
3
 
4
4
  function cleanup {
5
+ set +e
6
+ bundle exec vcloud-logout
5
7
  rm $FOG_RC
8
+ unset FOG_RC
6
9
  }
7
10
 
8
- # Override default of ~/.fog and delete afterwards.
9
11
  export FOG_RC=$(mktemp /tmp/vcloud_fog_rc.XXXXXXXXXX)
10
12
  trap cleanup EXIT
11
13
 
@@ -25,6 +27,5 @@ bundle exec rake
25
27
  # Never log token to STDOUT.
26
28
  set +x
27
29
  eval $(printenv API_PASSWORD | bundle exec vcloud-login)
28
- trap "bundle exec vcloud-logout" EXIT
29
30
 
30
31
  bundle exec rake integration
@@ -19,7 +19,6 @@ module Vcloud
19
19
  @tunnel = {
20
20
  :Name => fog_vpn_tunnel[:Name],
21
21
  :Description => fog_vpn_tunnel[:Description],
22
- :ThirdPartyPeerId => fog_vpn_tunnel[:IpsecVpnThirdPartyPeer][:PeerId],
23
22
  :PeerId => fog_vpn_tunnel[:PeerId],
24
23
  :LocalId => fog_vpn_tunnel[:LocalId],
25
24
  :PeerIpAddress => fog_vpn_tunnel[:PeerIpAddress],
@@ -31,6 +30,15 @@ module Vcloud
31
30
  :IsOperational => fog_vpn_tunnel[:IsOperational]
32
31
  }
33
32
 
33
+ if (third_party_peer = fog_vpn_tunnel.fetch(:IpsecVpnThirdPartyPeer, false))
34
+ @tunnel[:ThirdPartyPeerId] = third_party_peer[:PeerId]
35
+ end
36
+
37
+ if (local_peer = fog_vpn_tunnel.fetch(:IpsecVpnLocalPeer, false))
38
+ @tunnel[:LocalPeerId] = local_peer[:Id]
39
+ @tunnel[:LocalPeerName] = local_peer[:Name]
40
+ end
41
+
34
42
  @tunnel[:SharedSecret] = "*" * 65 if fog_vpn_tunnel[:SharedSecret]
35
43
  @tunnel[:SharedSecretEncrypted] = "******" if fog_vpn_tunnel[:SharedSecretEncrypted]
36
44
  @tunnel[:EncryptionProtocol] = "******" if fog_vpn_tunnel[:EncryptionProtocol]
@@ -1,5 +1,5 @@
1
1
  module Vcloud
2
2
  module Walker
3
- VERSION = '3.6.0'
3
+ VERSION = '4.0.0'
4
4
  end
5
5
  end
@@ -1,9 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Vcloud::Walker::Resource::GatewayIpsecVpnService do
4
+ let(:gateway_vpn_service) {
5
+ Vcloud::Walker::Resource::GatewayIpsecVpnService.new(fog_vpn_service)
6
+ }
7
+
4
8
  context "vpn service with single tunnel" do
5
- before(:all) do
6
- fog_vpn_service = {
9
+ let(:fog_vpn_service) do
10
+ {
7
11
  IsEnabled: true,
8
12
  Tunnel: {
9
13
  Name: "ss_one",
@@ -36,23 +40,23 @@ describe Vcloud::Walker::Resource::GatewayIpsecVpnService do
36
40
  IsOperational: "false"
37
41
  }
38
42
  }
39
-
40
- @gateway_vpn_service = Vcloud::Walker::Resource::GatewayIpsecVpnService.new(fog_vpn_service)
41
43
  end
44
+
42
45
  it "should report status of vpn service" do
43
- expect(@gateway_vpn_service.IsEnabled).to eq(true)
44
- expect(@gateway_vpn_service.Tunnels).not_to be_empty
46
+ expect(gateway_vpn_service.IsEnabled).to eq(true)
47
+ expect(gateway_vpn_service.Tunnels).not_to be_empty
45
48
  end
46
49
 
47
50
  context "report tunnel info" do
48
- before(:all) do
49
- @tunnel = @gateway_vpn_service.Tunnels.first
50
- end
51
+ let(:tunnel) {
52
+ gateway_vpn_service.Tunnels.first
53
+ }
51
54
 
52
55
  it "with peer details" do
53
- expect(@tunnel[:PeerId]).to eq('1')
54
- expect(@tunnel[:PeerIpAddress]).to eq('8.8.8.8')
55
- expect(@tunnel[:PeerSubnet]).to eq({
56
+ expect(tunnel[:ThirdPartyPeerId]).to eq('1')
57
+ expect(tunnel[:PeerId]).to eq('1')
58
+ expect(tunnel[:PeerIpAddress]).to eq('8.8.8.8')
59
+ expect(tunnel[:PeerSubnet]).to eq({
56
60
  Name: "8.8.8.0/8",
57
61
  Gateway: "8.8.8.0",
58
62
  Netmask: "255.0.0.0"
@@ -60,9 +64,9 @@ describe Vcloud::Walker::Resource::GatewayIpsecVpnService do
60
64
  end
61
65
 
62
66
  it "with local network details" do
63
- expect(@tunnel[:LocalId]).to eq('1')
64
- expect(@tunnel[:LocalIpAddress]).to eq('192.0.2.1')
65
- expect(@tunnel[:LocalSubnet]).to eq({
67
+ expect(tunnel[:LocalId]).to eq('1')
68
+ expect(tunnel[:LocalIpAddress]).to eq('192.0.2.1')
69
+ expect(tunnel[:LocalSubnet]).to eq({
66
70
  Name: "Default",
67
71
  Gateway: "192.168.0.1",
68
72
  Netmask: "255.255.0.0"
@@ -70,31 +74,31 @@ describe Vcloud::Walker::Resource::GatewayIpsecVpnService do
70
74
  end
71
75
 
72
76
  it "with maximum transmission unit" do
73
- expect(@tunnel[:Mtu]).to eq('1500')
77
+ expect(tunnel[:Mtu]).to eq('1500')
74
78
  end
75
79
 
76
80
  it "with masked vpn shared secret information" do
77
- expect(@tunnel[:SharedSecret]).to eq("*" * 65)
78
- expect(@tunnel[:SharedSecretEncrypted]).to eq("******")
79
- expect(@tunnel[:EncryptionProtocol]).to eq("******")
81
+ expect(tunnel[:SharedSecret]).to eq("*" * 65)
82
+ expect(tunnel[:SharedSecretEncrypted]).to eq("******")
83
+ expect(tunnel[:EncryptionProtocol]).to eq("******")
80
84
  end
81
85
 
82
86
  it "should skip any addditional vpn details provided by fog" do
83
- expect(@tunnel[:AdditionalDetails]).to be_nil
87
+ expect(tunnel[:AdditionalDetails]).to be_nil
84
88
  end
85
89
  end
86
-
87
90
  end
88
91
 
89
- it "should report vpn service with multiple tunnels" do
90
- fog_vpn_service = {
91
- IsEnabled: true,
92
- Tunnel: [
93
- {
94
- Name: "remove vpn 1",
95
- Description: "describe me",
96
- IpsecVpnThirdPartyPeer: {
97
- PeerId: "1"
92
+ context "vpn service with inter-vDC tunnel" do
93
+ let(:fog_vpn_service) do
94
+ {
95
+ IsEnabled: true,
96
+ Tunnel: {
97
+ Name: "ss_one",
98
+ Description: "desc one",
99
+ IpsecVpnLocalPeer: {
100
+ Id: "1",
101
+ Name: "Foo",
98
102
  },
99
103
  PeerIpAddress: "8.8.8.8",
100
104
  PeerId: "1",
@@ -105,53 +109,104 @@ describe Vcloud::Walker::Resource::GatewayIpsecVpnService do
105
109
  Gateway: "192.168.0.1",
106
110
  Netmask: "255.255.0.0"
107
111
  },
108
- PeerSubnet: {
109
- Name: "8.8.8.0/8",
110
- Gateway: "8.8.8.0",
111
- Netmask: "255.0.0.0"
112
- },
112
+ PeerSubnet: [
113
+ {
114
+ Name: "Bar",
115
+ Gateway: "10.0.0.1",
116
+ Netmask: "255.255.255.0"
117
+ },
118
+ ],
113
119
  SharedSecret: "DoNotDiscloseDoNotDiscloseDoNotDiscloseDoNotDiscloseDoNotDisclose",
114
120
  SharedSecretEncrypted: "false",
115
121
  EncryptionProtocol: "AES256",
116
122
  Mtu: "1500",
117
- AdditionalDetails: {
118
- shared_network: true
119
- },
120
- IsEnabled: "true",
121
- IsOperational: "false"
122
- },
123
- {
124
- Name: "remote vpn 2",
125
- Description: "describe me",
126
- IpsecVpnThirdPartyPeer: {
127
- PeerId: "2"
128
- },
129
- PeerIpAddress: "8.8.4.4",
130
- PeerId: "2",
131
- LocalIpAddress: "172.26.2.3",
132
- LocalId: "2",
133
- LocalSubnet: {
134
- Name: "Default",
135
- Gateway: "192.168.0.1",
136
- Netmask: "255.255.0.0"
137
- },
138
- PeerSubnet: {
139
- Name: "8.8.4.4/8",
140
- Gateway: "8.8.4.4",
141
- Netmask: "255.0.0.0"
142
- },
143
- SharedSecret: "PrivyPrivyPrivyPrivyPrivyPrivyPrivyPrivyPrivyPrivy",
144
- SharedSecretEncrypted: "false",
145
- EncryptionProtocol: "AES256",
146
- Mtu: "1500",
147
123
  IsEnabled: "true",
148
124
  IsOperational: "false"
149
125
  }
150
- ]
151
- }
126
+ }
127
+ end
152
128
 
153
- gateway_vpn_service = Vcloud::Walker::Resource::GatewayIpsecVpnService.new(fog_vpn_service)
154
- expect(gateway_vpn_service.Tunnels.count).to eq(2)
129
+ context "report tunnel info" do
130
+ let(:tunnel) {
131
+ gateway_vpn_service.Tunnels.first
132
+ }
133
+
134
+ it "returns accurate local peer details" do
135
+ expect(tunnel[:LocalPeerId]).to eq('1')
136
+ expect(tunnel[:LocalPeerName]).to eq('Foo')
137
+ end
138
+ end
155
139
  end
156
140
 
141
+ context "vpn service with multiple tunnels" do
142
+
143
+ let(:fog_vpn_service) do
144
+ {
145
+ IsEnabled: true,
146
+ Tunnel: [
147
+ {
148
+ Name: "remove vpn 1",
149
+ Description: "describe me",
150
+ IpsecVpnThirdPartyPeer: {
151
+ PeerId: "1"
152
+ },
153
+ PeerIpAddress: "8.8.8.8",
154
+ PeerId: "1",
155
+ LocalIpAddress: "192.0.2.1",
156
+ LocalId: "1",
157
+ LocalSubnet: {
158
+ Name: "Default",
159
+ Gateway: "192.168.0.1",
160
+ Netmask: "255.255.0.0"
161
+ },
162
+ PeerSubnet: {
163
+ Name: "8.8.8.0/8",
164
+ Gateway: "8.8.8.0",
165
+ Netmask: "255.0.0.0"
166
+ },
167
+ SharedSecret: "DoNotDiscloseDoNotDiscloseDoNotDiscloseDoNotDiscloseDoNotDisclose",
168
+ SharedSecretEncrypted: "false",
169
+ EncryptionProtocol: "AES256",
170
+ Mtu: "1500",
171
+ AdditionalDetails: {
172
+ shared_network: true
173
+ },
174
+ IsEnabled: "true",
175
+ IsOperational: "false"
176
+ },
177
+ {
178
+ Name: "remote vpn 2",
179
+ Description: "describe me",
180
+ IpsecVpnThirdPartyPeer: {
181
+ PeerId: "2"
182
+ },
183
+ PeerIpAddress: "8.8.4.4",
184
+ PeerId: "2",
185
+ LocalIpAddress: "172.26.2.3",
186
+ LocalId: "2",
187
+ LocalSubnet: {
188
+ Name: "Default",
189
+ Gateway: "192.168.0.1",
190
+ Netmask: "255.255.0.0"
191
+ },
192
+ PeerSubnet: {
193
+ Name: "8.8.4.4/8",
194
+ Gateway: "8.8.4.4",
195
+ Netmask: "255.0.0.0"
196
+ },
197
+ SharedSecret: "PrivyPrivyPrivyPrivyPrivyPrivyPrivyPrivyPrivyPrivy",
198
+ SharedSecretEncrypted: "false",
199
+ EncryptionProtocol: "AES256",
200
+ Mtu: "1500",
201
+ IsEnabled: "true",
202
+ IsOperational: "false"
203
+ }
204
+ ]
205
+ }
206
+ end
207
+
208
+ it "should report vpn service with multiple tunnels" do
209
+ expect(gateway_vpn_service.Tunnels.count).to eq(2)
210
+ end
211
+ end
157
212
  end
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
 
23
23
  s.add_runtime_dependency 'fog', '>= 1.21.0'
24
24
  s.add_runtime_dependency 'json', '~> 1.8.0'
25
- s.add_runtime_dependency 'vcloud-core', '~> 0.16.0'
25
+ s.add_runtime_dependency 'vcloud-core', '~> 1.0.0'
26
26
  s.add_development_dependency 'gem_publisher', '1.2.0'
27
27
  s.add_development_dependency 'json_spec', '~> 1.1.1'
28
28
  s.add_development_dependency 'rake'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcloud-walker
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0
4
+ version: 4.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-03 00:00:00.000000000 Z
12
+ date: 2015-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fog
16
- requirement: &5117360 !ruby/object:Gem::Requirement
16
+ requirement: &3706860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.21.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *5117360
24
+ version_requirements: *3706860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &5116480 !ruby/object:Gem::Requirement
27
+ requirement: &3718440 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,21 +32,21 @@ dependencies:
32
32
  version: 1.8.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *5116480
35
+ version_requirements: *3718440
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: vcloud-core
38
- requirement: &5115820 !ruby/object:Gem::Requirement
38
+ requirement: &3716960 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
42
42
  - !ruby/object:Gem::Version
43
- version: 0.16.0
43
+ version: 1.0.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *5115820
46
+ version_requirements: *3716960
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: gem_publisher
49
- requirement: &5115180 !ruby/object:Gem::Requirement
49
+ requirement: &3715360 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - =
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.2.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *5115180
57
+ version_requirements: *3715360
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: json_spec
60
- requirement: &5114600 !ruby/object:Gem::Requirement
60
+ requirement: &3738240 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.1.1
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *5114600
68
+ version_requirements: *3738240
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
- requirement: &5114140 !ruby/object:Gem::Requirement
71
+ requirement: &4569520 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *5114140
79
+ version_requirements: *4569520
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &5113460 !ruby/object:Gem::Requirement
82
+ requirement: &4578740 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 2.14.1
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *5113460
90
+ version_requirements: *4578740
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec-mocks
93
- requirement: &5112820 !ruby/object:Gem::Requirement
93
+ requirement: &4576140 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 2.14.3
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *5112820
101
+ version_requirements: *4576140
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rubocop
104
- requirement: &5112000 !ruby/object:Gem::Requirement
104
+ requirement: &4596780 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 0.23.0
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *5112000
112
+ version_requirements: *4596780
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: simplecov
115
- requirement: &5111280 !ruby/object:Gem::Requirement
115
+ requirement: &4192100 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ~>
@@ -120,7 +120,7 @@ dependencies:
120
120
  version: 0.7.1
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *5111280
123
+ version_requirements: *4192100
124
124
  description: ! "Vcloud-walker is a command line tool to describe different vCloud
125
125
  entities.\n This tool is a thin layer around fog api, which exposes
126
126
  summarized vCloud entities\n in the form of JSON"
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  version: '0'
202
202
  segments:
203
203
  - 0
204
- hash: -3886802048453073772
204
+ hash: 111889673649538721
205
205
  requirements: []
206
206
  rubyforge_project:
207
207
  rubygems_version: 1.8.11