vcloud-edge_gateway 1.5.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86f8618c4225d55bb5925210f8e2d61e8871dcdb
4
- data.tar.gz: 09347c90c0b67feb8a0ed4caa81a507cd2f7bbca
3
+ metadata.gz: c61eb82a7ec8f16a423428e939d8f965a6335b28
4
+ data.tar.gz: 41d62fd0e42432b96c95a6baea18c97d740dd06c
5
5
  SHA512:
6
- metadata.gz: 97df5193a9687af5e10abff2278cb96870a7940b2f4ad3219244732275eab494fee4eaa7ab135cc3231c2af9d66b50bb47d4fc723a4189e7f7b4814642e772de
7
- data.tar.gz: 77ae86c795dd2c8937c38a30d340ac551c09a2db9559359d816b94e8b84be51f4d8a2459be8c1c0c09526ae2952080ca91ff0a75b215654c5df789598659f2ff
6
+ metadata.gz: 85b79c39f0a9442411db88044e8d34fd0ac275e777efc28b4ced860740a9dcf0ceaf523f25d873160f60cdda02a790236988f84f5a4671738a2c27540f48c25b
7
+ data.tar.gz: 6529be31ab62c383f9d6822782ff5ad91cbc64e02b8416869de4745aa624b25482f654d335cf25624bba1ec73befef19a7b9371bdb3623d8507b14731c0c621b
data/.travis.yml CHANGED
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  language: ruby
3
+ sudo: false
3
4
  rvm:
4
- - 1.9.3
5
- - 2.0.0
6
- - 2.1.2
5
+ - 2.2.2
6
+ - 2.3.0
7
+ - 2.4.0
7
8
  notifications:
8
9
  email: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## 2.1.0 (2017-06-22)
2
+
3
+ - Upgrade to the latest vCloud Core, and bring the version number into line
4
+ with the rest of the toolset.
5
+ - Remove support for Ruby versions older than 2.2.2.
6
+ - Add support for Ruby 2.3.0 and 2.4.0.
7
+ - Upgrade Rspec, Rubocop, Simplecov and Rake.
8
+ - Add documentation regarding deprecation of support
9
+ - Various bug fixes
10
+
11
+ ## Unreleased
12
+
13
+ - Remove support for Ruby 1.9.3, which is now end-of-life.
14
+
1
15
  ## 1.5.2 (2015-07-20)
2
16
 
3
17
  - Update vCloud Core to 1.1.0 to pick up a bugfix.
data/CONTRIBUTING.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Contributing to vCloud Edge Gateway
2
2
 
3
- We really welcome contributions.
3
+ We now consider vCloud Tools feature complete for our purposes. We'd be happy to consider pull requests for new features but please discuss them with us in the issues first so we can let you know if it's something we'd be likely to merge. We will continue to make maintenance and bug fixes.
4
4
 
5
5
  ## A quick guide on how to contribute
6
6
 
@@ -36,11 +36,7 @@ We really welcome contributions.
36
36
 
37
37
  ## How soon will we respond?
38
38
 
39
- We will comment on your pull request within two working days. However, we might not be able to review it immediately.
40
-
41
- We may come back to you with comments and suggestions, and if we would like you to make changes, we will close the pull request as well as adding details of the changes we'd like you to make.
42
-
43
- If you feel your pull request has been outstanding too long, please feel free to bump it by making a comment on it.
39
+ We will comment on your issue as soon as we can. If you feel your issue is important, please feel free to bump it by making a comment on it or raise your issue on the [mailing list](https://groups.google.com/a/digital.cabinet-office.gov.uk/forum/#!forum/vcloud-tools).
44
40
 
45
41
  ## Guidelines for making a pull request
46
42
 
data/Jenkinsfile ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env groovy
2
+
3
+ repoName = JOB_NAME.split('/')[0]
4
+
5
+ node {
6
+ def govuk = load '/var/lib/jenkins/groovy_scripts/govuk_jenkinslib.groovy'
7
+
8
+ try {
9
+ stage("Checkout") {
10
+ govuk.checkoutFromGitHubWithSSH(repoName)
11
+ }
12
+
13
+ stage("Clean up workspace") {
14
+ govuk.cleanupGit()
15
+ }
16
+
17
+ stage("bundle install") {
18
+ govuk.setEnvar("RBENV_VERSION", "2.2.2")
19
+ govuk.bundleGem()
20
+ }
21
+
22
+ stage("Run tests") {
23
+ govuk.runTests()
24
+ }
25
+
26
+ if (env.BRANCH_NAME == "master") {
27
+ stage("Publish gem") {
28
+ govuk.publishGem(repoName, env.BRANCH_NAME)
29
+ }
30
+ }
31
+ } catch (e) {
32
+ currentBuild.result = "FAILED"
33
+ step([$class: 'Mailer',
34
+ notifyEveryUnstableBuild: true,
35
+ recipients: 'govuk-ci-notifications@digital.cabinet-office.gov.uk',
36
+ sendToIndividuals: true])
37
+ throw e
38
+ }
39
+ }
40
+
data/README.md CHANGED
@@ -43,6 +43,7 @@ You can configure the following services on an existing edgegateway using
43
43
  - nat_service
44
44
  - load_balancer_service
45
45
  - gateway_ipsec_vpn_service
46
+ - static_routing_service
46
47
 
47
48
  The `vcloud-edge-configure` tool takes an input YAML file describing one
48
49
  or more of these services and updates the edge gateway configuration to match,
@@ -356,6 +357,71 @@ There is no persistence option for 'tcp' service_profiles.
356
357
  See [the vCloud Director Admin Guide](http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.admin.doc_51/GUID-EC5EE5F9-1A2C-4609-9347-4C3143727704.html)
357
358
  for more details on configuring VirtualServer entries.
358
359
 
360
+ ### gateway_ipsec_vpn_service
361
+
362
+ The edge gateway VPN service allows setting up a basic IPSEC VPN peer. Configuration will depend on how the remote peer device is configured. Multiple tunnels can be
363
+ configured, along with multiple local and remote peer subnets in a single tunnel.
364
+
365
+ The configuration requires several details:
366
+
367
+ * Peer IP address: the public address of the remote peer
368
+ * Local IP address: the public address of the local peer
369
+ * Peer subnets: A private network address range which determines what traffic will traverse the tunnel
370
+ * Local subnets: A private network address range which determines what traffic will be routed from the remote peer
371
+ * Shared secret: This is the shared secret key which must be the same on both sides of the tunnel for encryption purposes
372
+ * Encryption protocol: This should match on both sides of the tunnel
373
+ * MTU: This sould match on both sides of the tunnel
374
+
375
+ Here is an example configuration:
376
+
377
+ ```
378
+ ---
379
+ gateway: GATEWAY_ID
380
+ gateway_ipsec_vpn_service:
381
+ enabled: true
382
+ tunnels:
383
+ - :name: 'Example_name_without_spaces'
384
+ :enabled: true
385
+ :rule_type: 'DNAT'
386
+ :description: 'Description name with spaces'
387
+ :ipsec_vpn_local_peer:
388
+ :id: 'this-is-an-example-edgegatewayid'
389
+ :name: 'NameOfEdgeGateway'
390
+ :peer_ip_address: 1.2.3.4
391
+ :peer_id: '1.2.3.4'
392
+ :local_ip_address: 4.3.2.1
393
+ :local_id: '4.3.2.1'
394
+ :peer_subnets:
395
+ - :name: '172.16.0.0/24'
396
+ :gateway: '172.16.0.1'
397
+ :netmask: '255.255.255.0'
398
+ :shared_secret: usesomethinglikea32characterpassword
399
+ :encryption_protocol: 'AES'
400
+ :mtu: 1500
401
+ :local_subnets:
402
+ - :name: '192.168.0.0/24'
403
+ :gateway: '192.168.0.1'
404
+ :netmask: '255.255.255.0'
405
+ ```
406
+
407
+ ### static_routing_service
408
+
409
+ You can set up specific static routes using the vEdge Gateway. It allows you to route traffic that is destined to a specific destination IP to go via
410
+ a specific gateway.
411
+
412
+ ```
413
+ ---
414
+ gateway: GATEWAY_ID
415
+ static_routing_service:
416
+ static_routes:
417
+ - enabled: true
418
+ name: 'Example Static Route'
419
+ network: '192.168.0.0/24'
420
+ next_hop: '172.16.0.1'
421
+ apply_on: EDGE_GATEWAY_EXT_NETWORK
422
+ ```
423
+
424
+
359
425
  ### Finding external network details from vcloud-walk
360
426
 
361
427
  You can find the network UUID and external address allocations using [vCloud
@@ -441,6 +507,6 @@ default: # This is the fog credential that refers to your testing
441
507
 
442
508
  ## Contributing
443
509
 
444
- Please see the [contributing guidelines](/CONTRIBUTING.md).
510
+ Please see [CONTRIBUTING.md](/CONTRIBUTING.md).
445
511
 
446
512
  [fog]: http://fog.io/
@@ -25,6 +25,7 @@ module Vcloud
25
25
  new_rule[:Id] = rule.key?(:id) ? rule[:id] : i.to_s
26
26
  new_rule[:IsEnabled] = rule.key?(:enabled) ? rule[:enabled].to_s : 'true'
27
27
  new_rule[:RuleType] = rule[:rule_type]
28
+ new_rule[:Description] = rule[:description] if rule.key?(:description)
28
29
  gateway_nat_rule = populate_gateway_nat_rule(rule)
29
30
  new_rule[:GatewayNatRule] = gateway_nat_rule
30
31
  i += 1
@@ -36,7 +36,7 @@ module Vcloud
36
36
  enabled: { type: 'boolean', required: false },
37
37
  port: { type: 'string_or_number', required: false },
38
38
  algorithm: { type: 'enum', required: false,
39
- acceptable_values: [ 'ROUND_ROBIN', 'IP_HASH', 'URI', 'LEAST_CONNECTED' ]},
39
+ acceptable_values: [ 'ROUND_ROBIN', 'IP_HASH', 'URI', 'LEAST_CONN' ]},
40
40
  health_check: {
41
41
  type: 'hash',
42
42
  required: false,
@@ -1,6 +1,6 @@
1
1
  module Vcloud
2
2
  module EdgeGateway
3
- VERSION = '1.5.2'
3
+ VERSION = '2.1.0'
4
4
  end
5
5
  end
6
6
 
data/rbenv_version.sh CHANGED
@@ -1 +1 @@
1
- export RBENV_VERSION="2.1.2"
1
+ export RBENV_VERSION="2.2.2"
@@ -39,7 +39,7 @@ module Vcloud
39
39
 
40
40
  it "should be starting our tests from an empty firewall" do
41
41
  remote_vcloud_config = @edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration][:FirewallService]
42
- expect(remote_vcloud_config[:FirewallRule].empty?).to be_true
42
+ expect(remote_vcloud_config[:FirewallRule].empty?).to be true
43
43
  end
44
44
 
45
45
  it "should only need to make one call to Core::EdgeGateway.update_configuration" do
@@ -52,7 +52,7 @@ module Vcloud
52
52
 
53
53
  it "should have configured at least one firewall rule" do
54
54
  remote_vcloud_config = @edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration][:FirewallService]
55
- expect(remote_vcloud_config[:FirewallRule].empty?).to be_false
55
+ expect(remote_vcloud_config[:FirewallRule].empty?).to be false
56
56
  end
57
57
 
58
58
  it "should have configured the same number of firewall rules as in our configuration" do
@@ -41,8 +41,8 @@ module Vcloud
41
41
  it "should be starting our tests from an empty LoadBalancerService" do
42
42
  edge_service_config = @edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration]
43
43
  remote_vcloud_config = edge_service_config[:LoadBalancerService]
44
- expect(remote_vcloud_config[:Pool].empty?).to be_true
45
- expect(remote_vcloud_config[:VirtualServer].empty?).to be_true
44
+ expect(remote_vcloud_config[:Pool].empty?).to be true
45
+ expect(remote_vcloud_config[:VirtualServer].empty?).to be true
46
46
  end
47
47
 
48
48
  it "should only make one EdgeGateway update task, to minimise EdgeGateway reload events" do
@@ -62,7 +62,7 @@ module Vcloud
62
62
 
63
63
  edge_service_config = @edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration]
64
64
  remote_vcloud_config = edge_service_config[:LoadBalancerService]
65
- expect(remote_vcloud_config[:Pool].empty?).to be_false
65
+ expect(remote_vcloud_config[:Pool].empty?).to be false
66
66
  end
67
67
 
68
68
  it "should have configured at least one LoadBancer VirtualServer entry" do
@@ -70,7 +70,7 @@ module Vcloud
70
70
 
71
71
  edge_service_config = @edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration]
72
72
  remote_vcloud_config = edge_service_config[:LoadBalancerService]
73
- expect(remote_vcloud_config[:VirtualServer].empty?).to be_false
73
+ expect(remote_vcloud_config[:VirtualServer].empty?).to be false
74
74
  end
75
75
 
76
76
  it "should have configured the same number of Pools as in our configuration" do
@@ -30,10 +30,10 @@ module Vcloud
30
30
 
31
31
  it "should be starting our tests from an empty EdgeGateway" do
32
32
  remote_vcloud_config = @edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration]
33
- expect(remote_vcloud_config[:FirewallService][:FirewallRule].empty?).to be_true
34
- expect(remote_vcloud_config[:NatService][:NatRule].empty?).to be_true
35
- expect(remote_vcloud_config[:LoadBalancerService][:Pool].empty?).to be_true
36
- expect(remote_vcloud_config[:LoadBalancerService][:VirtualServer].empty?).to be_true
33
+ expect(remote_vcloud_config[:FirewallService][:FirewallRule].empty?).to be true
34
+ expect(remote_vcloud_config[:NatService][:NatRule].empty?).to be true
35
+ expect(remote_vcloud_config[:LoadBalancerService][:Pool].empty?).to be true
36
+ expect(remote_vcloud_config[:LoadBalancerService][:VirtualServer].empty?).to be true
37
37
  end
38
38
 
39
39
  it "should only create one edgeGateway update task when updating the configuration" do
@@ -53,8 +53,8 @@ module Vcloud
53
53
  pending("This test will fail until https://github.com/fog/fog/pull/3695 is merged and released by Fog")
54
54
 
55
55
  remote_vcloud_config = @edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration]
56
- expect(remote_vcloud_config[:FirewallService][:FirewallRule].empty?).to be_false
57
- expect(remote_vcloud_config[:NatService][:NatRule].empty?).to be_false
56
+ expect(remote_vcloud_config[:FirewallService][:FirewallRule].empty?).to be false
57
+ expect(remote_vcloud_config[:NatService][:NatRule].empty?).to be false
58
58
  expect(remote_vcloud_config[:LoadBalancerService][:Pool].empty?).to be(true)
59
59
  expect(remote_vcloud_config[:LoadBalancerService][:VirtualServer].empty?).to be(true)
60
60
  end
@@ -44,7 +44,7 @@ module Vcloud
44
44
 
45
45
  it "should be starting our tests from an empty NatService" do
46
46
  remote_vcloud_config = @edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration][:NatService]
47
- expect(remote_vcloud_config[:NatRule].empty?).to be_true
47
+ expect(remote_vcloud_config[:NatRule].empty?).to be true
48
48
  end
49
49
 
50
50
  it "should only make one EdgeGateway update task, to minimise EdgeGateway reload events" do
@@ -63,7 +63,7 @@ module Vcloud
63
63
  pending("This test will fail until https://github.com/fog/fog/pull/3695 is merged and released by Fog")
64
64
 
65
65
  remote_vcloud_config = @edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration][:NatService]
66
- expect(remote_vcloud_config[:NatRule].empty?).to be_false
66
+ expect(remote_vcloud_config[:NatRule].empty?).to be false
67
67
  end
68
68
 
69
69
  it "should have configured the same number of nat rules as in our configuration" do
@@ -97,6 +97,7 @@ module Vcloud
97
97
  expect(dnat_rule).not_to be_nil
98
98
  expect(dnat_rule[:RuleType]).to eq('DNAT')
99
99
  expect(dnat_rule[:Id]).to eq('65537')
100
+ expect(dnat_rule[:Description]).to eq('Example DNAT')
100
101
  expect(dnat_rule[:IsEnabled]).to eq('true')
101
102
  expect(dnat_rule[:GatewayNatRule][:Interface][:href]).to include(@test_params.provider_network_id)
102
103
  expect(dnat_rule[:GatewayNatRule][:OriginalIp]).to eq(@test_params.provider_network_ip)
@@ -113,6 +114,7 @@ module Vcloud
113
114
  expect(snat_rule).not_to be_nil
114
115
  expect(snat_rule[:RuleType]).to eq('SNAT')
115
116
  expect(snat_rule[:Id]).to eq('65538')
117
+ expect(snat_rule[:Description]).to eq('Example SNAT')
116
118
  expect(snat_rule[:IsEnabled]).to eq('true')
117
119
  expect(snat_rule[:GatewayNatRule][:Interface][:href]).to include(@test_params.provider_network_id)
118
120
  expect(snat_rule[:GatewayNatRule][:OriginalIp]).to eq('10.10.1.2-10.10.1.3')
@@ -144,6 +146,7 @@ module Vcloud
144
146
  expect(expected_rule).not_to be_nil
145
147
  expect(expected_rule[:RuleType]).to eq('DNAT')
146
148
  expect(expected_rule[:Id]).to eq('65537')
149
+ expect(dnat_rule[:Description]).to eq('Example DNAT')
147
150
  expect(expected_rule[:RuleType]).to eq('DNAT')
148
151
  expect(expected_rule[:IsEnabled]).to eq('true')
149
152
  expect(expected_rule[:GatewayNatRule][:Interface][:name]).to eq(@test_params.network_1)
@@ -43,7 +43,7 @@ module Vcloud
43
43
  edge_service_config = @edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration]
44
44
  remote_vcloud_config = edge_service_config[:StaticRoutingService]
45
45
  if remote_vcloud_config
46
- expect(remote_vcloud_config[:StaticRoute].nil?).to be_true
46
+ expect(remote_vcloud_config[:StaticRoute].nil?).to be true
47
47
  end
48
48
  end
49
49
 
@@ -61,7 +61,7 @@ module Vcloud
61
61
  it "should have configured at least one static route" do
62
62
  edge_service_config = @edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration]
63
63
  remote_vcloud_config = edge_service_config[:StaticRoutingService]
64
- expect(remote_vcloud_config[:StaticRoute].empty?).to be_false
64
+ expect(remote_vcloud_config[:StaticRoute].empty?).to be false
65
65
  end
66
66
 
67
67
  it "should have configured the same number of static routes as in our configuration" do
@@ -92,7 +92,7 @@ module Vcloud
92
92
 
93
93
  expect(diff.keys).to eq([:StaticRoutingService])
94
94
  expect(diff[:StaticRoutingService]).to have_at_least(1).items
95
- expect(remote_vcloud_config[:StaticRoute].nil?).to be_true
95
+ expect(remote_vcloud_config[:StaticRoute].nil?).to be true
96
96
  end
97
97
 
98
98
  end
@@ -5,6 +5,7 @@ nat_service:
5
5
  - enabled: true
6
6
  network_id: {{ network_id }}
7
7
  rule_type: 'DNAT'
8
+ decription: 'Example DNAT'
8
9
  translated_ip: '10.10.1.2-10.10.1.3'
9
10
  translated_port: '3412'
10
11
  original_ip: {{ original_ip }}
@@ -13,5 +14,6 @@ nat_service:
13
14
  - enabled: true
14
15
  network_id: {{ network_id }}
15
16
  rule_type: 'SNAT'
17
+ description: 'Example SNAT'
16
18
  translated_ip: {{ original_ip }}
17
19
  original_ip: '10.10.1.2-10.10.1.3'
@@ -111,7 +111,7 @@ module Vcloud
111
111
  end
112
112
 
113
113
  it 'should default to description being not set' do
114
- expect(@rule.key?(:Description)).to be_false
114
+ expect(@rule.key?(:Description)).to be false
115
115
  end
116
116
 
117
117
  it 'should match our expected complete entry' do
@@ -26,6 +26,7 @@ module Vcloud
26
26
 
27
27
  before(:each) do
28
28
  input = { nat_rules: [{
29
+ description: 'Default Outbound',
29
30
  rule_type: 'SNAT',
30
31
  network_id: '2ad93597-7b54-43dd-9eb1-631dd337e5a7',
31
32
  original_ip: "192.0.2.2",
@@ -43,8 +44,12 @@ module Vcloud
43
44
  expect(@rule[:RuleType]).to eq('SNAT')
44
45
  end
45
46
 
47
+ it 'should have a Description of Default Outbound' do
48
+ expect(@rule[:Description]).to eq('Default Outbound')
49
+ end
50
+
46
51
  it 'should not include a Protocol' do
47
- expect(@rule[:GatewayNatRule].key?(:Protocol)).to be_false
52
+ expect(@rule[:GatewayNatRule].key?(:Protocol)).to be false
48
53
  end
49
54
 
50
55
  it 'should completely match our expected default rule' do
@@ -52,6 +57,7 @@ module Vcloud
52
57
  :Id=>"#{@base_nat_id}",
53
58
  :IsEnabled=>"true",
54
59
  :RuleType=>"SNAT",
60
+ :Description=>"Default Outbound",
55
61
  :GatewayNatRule=>{
56
62
  :Interface=>{
57
63
  :type => 'application/vnd.vmware.admin.network+xml',
@@ -70,6 +76,7 @@ module Vcloud
70
76
  before(:each) do
71
77
  input = { nat_rules: [{
72
78
  rule_type: 'DNAT',
79
+ description: 'Default Inbound',
73
80
  network_id: '2ad93597-7b54-43dd-9eb1-631dd337e5a7',
74
81
  original_ip: "192.0.2.2",
75
82
  original_port: '22',
@@ -89,6 +96,10 @@ module Vcloud
89
96
  expect(@rule[:RuleType]).to eq('DNAT')
90
97
  end
91
98
 
99
+ it 'should have a Decription of Default Inbound' do
100
+ expect(@rule[:Description]).to eq('Default Inbound')
101
+ end
102
+
92
103
  it 'should include a default Protocol of tcp' do
93
104
  expect(@rule[:GatewayNatRule][:Protocol]).to eq('tcp')
94
105
  end
@@ -98,6 +109,7 @@ module Vcloud
98
109
  :Id=>"#{@base_nat_id}",
99
110
  :IsEnabled=>"true",
100
111
  :RuleType=>"DNAT",
112
+ :Description=>"Default Inbound",
101
113
  :GatewayNatRule=>{
102
114
  :Interface=>{
103
115
  :type => 'application/vnd.vmware.admin.network+xml',
@@ -42,7 +42,7 @@ module Vcloud
42
42
 
43
43
  it "if `config` is called before `update_required` then config is not empty when it shouldn't be" do
44
44
  config = @proposed_config.config
45
- expect(config.empty?).to be_false
45
+ expect(config.empty?).to be false
46
46
  end
47
47
 
48
48
  end
@@ -97,10 +97,10 @@ module Vcloud
97
97
  it "proposed diff contains changes for all services" do
98
98
  diff = @proposed_config.diff
99
99
  expect(diff.keys).to eq([:FirewallService, :NatService, :GatewayIpsecVpnService, :LoadBalancerService])
100
- expect(diff[:FirewallService]).to have_at_least(1).items
101
- expect(diff[:NatService]).to have_at_least(1).items
102
- expect(diff[:GatewayIpsecVpnService]).to have_at_least(1).items
103
- expect(diff[:LoadBalancerService]).to have_at_least(1).items
100
+ expect(diff[:FirewallService].size).to be >= 1
101
+ expect(diff[:NatService].size).to be >= 1
102
+ expect(diff[:GatewayIpsecVpnService].size).to be >= 1
103
+ expect(diff[:LoadBalancerService].size).to be >= 1
104
104
  end
105
105
 
106
106
  end
@@ -144,7 +144,7 @@ module Vcloud
144
144
  it "proposed diff contains changes for firewall service" do
145
145
  diff = @proposed_config.diff
146
146
  expect(diff.keys).to eq([:FirewallService])
147
- expect(diff[:FirewallService]).to have_at_least(1).items
147
+ expect(diff[:FirewallService].size).to be >= 1
148
148
  end
149
149
 
150
150
  end
@@ -195,7 +195,7 @@ module Vcloud
195
195
  it "proposed diff contains changes for firewall and VPN service" do
196
196
  diff = @proposed_config.diff
197
197
  expect(diff.keys).to eq([:FirewallService, :GatewayIpsecVpnService])
198
- expect(diff[:FirewallService]).to have_at_least(1).items
198
+ expect(diff[:FirewallService].size).to be >= 1
199
199
  end
200
200
 
201
201
  end
@@ -241,7 +241,7 @@ module Vcloud
241
241
  it "proposed diff contains changes for load balancer service" do
242
242
  diff = @proposed_config.diff
243
243
  expect(diff.keys).to eq([:LoadBalancerService])
244
- expect(diff[:LoadBalancerService]).to have_at_least(1).items
244
+ expect(diff[:LoadBalancerService].size).to be >= 1
245
245
  end
246
246
 
247
247
  end
@@ -288,8 +288,8 @@ module Vcloud
288
288
  it "proposed diff contains changes for firewall and load balancer services" do
289
289
  diff = @proposed_config.diff
290
290
  expect(diff.keys).to eq([:FirewallService, :LoadBalancerService])
291
- expect(diff[:FirewallService]).to have_at_least(1).items
292
- expect(diff[:LoadBalancerService]).to have_at_least(1).items
291
+ expect(diff[:FirewallService].size).to be >= 1
292
+ expect(diff[:LoadBalancerService].size).to be >= 1
293
293
  end
294
294
 
295
295
  end
@@ -334,7 +334,7 @@ module Vcloud
334
334
  it "proposed diff contains changes for load balancer service" do
335
335
  diff = @proposed_config.diff
336
336
  expect(diff.keys).to eq([:LoadBalancerService])
337
- expect(diff[:LoadBalancerService]).to have_at_least(1).items
337
+ expect(diff[:LoadBalancerService].size).to be >= 1
338
338
  end
339
339
 
340
340
  end
@@ -479,7 +479,7 @@ module Vcloud
479
479
  it "proposed diff contains changes for nat service" do
480
480
  diff = @proposed_config.diff
481
481
  expect(diff.keys).to eq([:NatService])
482
- expect(diff[:NatService]).to have_at_least(1).items
482
+ expect(diff[:NatService].size).to be >= 1
483
483
  end
484
484
 
485
485
  end
@@ -522,7 +522,7 @@ module Vcloud
522
522
  it "proposed diff contains changes for firewall service" do
523
523
  diff = @proposed_config.diff
524
524
  expect(diff.keys).to eq([:FirewallService])
525
- expect(diff[:FirewallService]).to have_at_least(1).items
525
+ expect(diff[:FirewallService].size).to be >= 1
526
526
  end
527
527
 
528
528
  end
@@ -565,7 +565,7 @@ module Vcloud
565
565
  it "proposed diff contains changes for nat service" do
566
566
  diff = @proposed_config.diff
567
567
  expect(diff.keys).to eq([:NatService])
568
- expect(diff[:NatService]).to have_at_least(1).items
568
+ expect(diff[:NatService].size).to be >= 1
569
569
  end
570
570
 
571
571
  end
@@ -612,7 +612,7 @@ module Vcloud
612
612
  it "proposed diff contains changes for load balancer service" do
613
613
  diff = @proposed_config.diff
614
614
  expect(diff.keys).to eq([:LoadBalancerService])
615
- expect(diff[:LoadBalancerService]).to have_at_least(1).items
615
+ expect(diff[:LoadBalancerService].size).to be >= 1
616
616
  end
617
617
 
618
618
  end
@@ -655,7 +655,7 @@ module Vcloud
655
655
  it "proposed diff contains changes for VPN service" do
656
656
  diff = @proposed_config.diff
657
657
  expect(diff.keys).to eq([:GatewayIpsecVpnService])
658
- expect(diff[:GatewayIpsecVpnService]).to have_at_least(1).items
658
+ expect(diff[:GatewayIpsecVpnService].size).to be >= 1
659
659
  end
660
660
 
661
661
  end
@@ -17,7 +17,7 @@ module Vcloud
17
17
 
18
18
  }
19
19
  validator = Vcloud::Core::ConfigValidator.validate(:base, config, Vcloud::EdgeGateway::Schema::FIREWALL_SERVICE)
20
- expect(validator.valid?).to be_false
20
+ expect(validator.valid?).to be false
21
21
  expect(validator.errors).to eq([
22
22
  "source_ip: 192.0 is not a valid IP address range. Valid values can be IP address, CIDR, IP range, 'Any','internal' and 'external'.",
23
23
  "destination_ip: 10.10 is not a valid IP address range. Valid values can be IP address, CIDR, IP range, 'Any','internal' and 'external'."
@@ -38,7 +38,7 @@ module Vcloud
38
38
 
39
39
  }
40
40
  validator = Vcloud::Core::ConfigValidator.validate(:base, config, Vcloud::EdgeGateway::Schema::FIREWALL_SERVICE)
41
- expect(validator.valid?).to be_true
41
+ expect(validator.valid?).to be true
42
42
  end
43
43
  end
44
44
  end
@@ -56,7 +56,7 @@ module Vcloud
56
56
  validator = Vcloud::Core::ConfigValidator.validate(:base, test[:input],
57
57
  Vcloud::EdgeGateway::Schema::LOAD_BALANCER_POOL_ENTRY)
58
58
  expect(validator.errors).to eq([])
59
- expect(validator.valid?).to be_true
59
+ expect(validator.valid?).to be true
60
60
  end
61
61
  end
62
62
 
@@ -96,7 +96,7 @@ module Vcloud
96
96
  validator = Vcloud::Core::ConfigValidator.validate(:base, test[:input],
97
97
  Vcloud::EdgeGateway::Schema::LOAD_BALANCER_VIRTUAL_SERVER_ENTRY)
98
98
  expect(validator.errors).to eq([])
99
- expect(validator.valid?).to be_true
99
+ expect(validator.valid?).to be true
100
100
  end
101
101
  end
102
102
 
@@ -122,7 +122,7 @@ module Vcloud
122
122
  validator = Vcloud::Core::ConfigValidator.validate(:base, input,
123
123
  Vcloud::EdgeGateway::Schema::LOAD_BALANCER_VIRTUAL_SERVER_ENTRY)
124
124
  expect(validator.errors).to eq([])
125
- expect(validator.valid?).to be_true
125
+ expect(validator.valid?).to be true
126
126
  end
127
127
 
128
128
  it "does not validate a virtual_server entry with a COOKIE http " +
@@ -149,7 +149,7 @@ module Vcloud
149
149
  "persistence: missing 'cookie_name' parameter",
150
150
  "persistence: missing 'cookie_mode' parameter",
151
151
  ])
152
- expect(validator.valid?).to be_false
152
+ expect(validator.valid?).to be false
153
153
  end
154
154
 
155
155
  it "validates a virtual_server entry with a SSL_SESSION_ID https persistence method" do
@@ -172,7 +172,7 @@ module Vcloud
172
172
  validator = Vcloud::Core::ConfigValidator.validate(:base, input,
173
173
  Vcloud::EdgeGateway::Schema::LOAD_BALANCER_VIRTUAL_SERVER_ENTRY)
174
174
  expect(validator.errors).to eq([])
175
- expect(validator.valid?).to be_true
175
+ expect(validator.valid?).to be true
176
176
  end
177
177
 
178
178
  it "validates a virtual_server entry with a tcp service_profile" do
@@ -192,7 +192,7 @@ module Vcloud
192
192
  validator = Vcloud::Core::ConfigValidator.validate(:base, input,
193
193
  Vcloud::EdgeGateway::Schema::LOAD_BALANCER_VIRTUAL_SERVER_ENTRY)
194
194
  expect(validator.errors).to eq([])
195
- expect(validator.valid?).to be_true
195
+ expect(validator.valid?).to be true
196
196
  end
197
197
 
198
198
  it "does not validate a virtual_server tcp service_profile with a persistence section" do
@@ -213,7 +213,7 @@ module Vcloud
213
213
  validator = Vcloud::Core::ConfigValidator.validate(:base, input,
214
214
  Vcloud::EdgeGateway::Schema::LOAD_BALANCER_VIRTUAL_SERVER_ENTRY)
215
215
  expect(validator.errors).to eq(["tcp: parameter 'persistence' is invalid"])
216
- expect(validator.valid?).to be_false
216
+ expect(validator.valid?).to be false
217
217
  end
218
218
 
219
219
  end
@@ -242,7 +242,7 @@ module Vcloud
242
242
  }
243
243
  validator = Vcloud::Core::ConfigValidator.validate(:base, input, Vcloud::EdgeGateway::Schema::LOAD_BALANCER_SERVICE)
244
244
  expect(validator.errors).to eq([])
245
- expect(validator.valid?).to be_true
245
+ expect(validator.valid?).to be true
246
246
  end
247
247
 
248
248
  it "should validate ok if an empty pool service section is provided" do
@@ -262,7 +262,7 @@ module Vcloud
262
262
  }
263
263
  validator = Vcloud::Core::ConfigValidator.validate(:base, input, Vcloud::EdgeGateway::Schema::LOAD_BALANCER_SERVICE)
264
264
  expect(validator.errors).to eq([])
265
- expect(validator.valid?).to be_true
265
+ expect(validator.valid?).to be true
266
266
  end
267
267
 
268
268
  it "should validate ok if an empty virtual_server service_profile section is provided" do
@@ -284,7 +284,7 @@ module Vcloud
284
284
  }
285
285
  validator = Vcloud::Core::ConfigValidator.validate(:base, input, Vcloud::EdgeGateway::Schema::LOAD_BALANCER_SERVICE)
286
286
  expect(validator.errors).to eq([])
287
- expect(validator.valid?).to be_true
287
+ expect(validator.valid?).to be true
288
288
  end
289
289
 
290
290
  it "should be ok if no pools are specified" do
@@ -292,7 +292,7 @@ module Vcloud
292
292
  virtual_servers: []
293
293
  }
294
294
  validator = Vcloud::Core::ConfigValidator.validate(:base, input, Vcloud::EdgeGateway::Schema::LOAD_BALANCER_SERVICE)
295
- expect(validator.valid?).to be_true
295
+ expect(validator.valid?).to be true
296
296
  end
297
297
 
298
298
  it "should be ok if no virtual_servers are specified" do
@@ -300,7 +300,7 @@ module Vcloud
300
300
  pools: []
301
301
  }
302
302
  validator = Vcloud::Core::ConfigValidator.validate(:base, input, Vcloud::EdgeGateway::Schema::LOAD_BALANCER_SERVICE)
303
- expect(validator.valid?).to be_true
303
+ expect(validator.valid?).to be true
304
304
  end
305
305
 
306
306
  end
@@ -14,7 +14,7 @@ module Vcloud
14
14
 
15
15
  }
16
16
  validator = Vcloud::Core::ConfigValidator.validate(:base, snat_rule, Vcloud::EdgeGateway::Schema::NAT_RULE)
17
- expect(validator.valid?).to be_true
17
+ expect(validator.valid?).to be true
18
18
  expect(validator.errors).to be_empty
19
19
 
20
20
  end
@@ -34,7 +34,7 @@ module Vcloud
34
34
  it "should error since mandatory field #{mandatory_field} is missing" do
35
35
  @snat_rule.delete(mandatory_field)
36
36
  validator = Vcloud::Core::ConfigValidator.validate(:base, @snat_rule, Vcloud::EdgeGateway::Schema::NAT_RULE)
37
- expect(validator.valid?).to be_false
37
+ expect(validator.valid?).to be false
38
38
  expect(validator.errors).to eq(["base: missing '#{mandatory_field}' parameter"])
39
39
  end
40
40
  end
@@ -53,7 +53,7 @@ module Vcloud
53
53
 
54
54
  }
55
55
  validator = Vcloud::Core::ConfigValidator.validate(:base, snat_rule, Vcloud::EdgeGateway::Schema::NAT_RULE)
56
- expect(validator.valid?).to be_true
56
+ expect(validator.valid?).to be true
57
57
  expect(validator.errors).to be_empty
58
58
  end
59
59
  end
@@ -85,7 +85,7 @@ module Vcloud
85
85
  ]
86
86
  }
87
87
  validator = Vcloud::Core::ConfigValidator.validate(:base, nat_service, Vcloud::EdgeGateway::Schema::NAT_SERVICE)
88
- expect(validator.valid?).to be_true
88
+ expect(validator.valid?).to be true
89
89
  expect(validator.errors).to be_empty
90
90
  end
91
91
  end
@@ -15,7 +15,7 @@ module Vcloud
15
15
  ]
16
16
  }
17
17
  validator = Vcloud::Core::ConfigValidator.validate(:base, config, Vcloud::EdgeGateway::Schema::STATIC_ROUTING_SERVICE)
18
- expect(validator.valid?).to be_false
18
+ expect(validator.valid?).to be false
19
19
  expect(validator.errors).to eq([
20
20
  "network: 10.10.10.10/256 is not a valid IP address range. Valid values can be IP address, CIDR, IP range, 'Any','internal' and 'external'.",
21
21
  "next_hop: 192.1 is not a valid ip_address",
@@ -34,7 +34,7 @@ module Vcloud
34
34
  ]
35
35
  }
36
36
  validator = Vcloud::Core::ConfigValidator.validate(:base, config, Vcloud::EdgeGateway::Schema::STATIC_ROUTING_SERVICE)
37
- expect(validator.valid?).to be_true
37
+ expect(validator.valid?).to be true
38
38
  end
39
39
  end
40
40
  end
@@ -29,7 +29,7 @@ module Vcloud
29
29
  }]
30
30
  }
31
31
  validator = Vcloud::Core::ConfigValidator.validate(:base, vpn_tunnel, Vcloud::EdgeGateway::Schema::VPN_RULE)
32
- expect(validator.valid?).to be_true
32
+ expect(validator.valid?).to be true
33
33
  expect(validator.errors).to be_empty
34
34
 
35
35
  end
@@ -68,7 +68,7 @@ module Vcloud
68
68
  it "should error since mandatory field #{mandatory_field} is missing" do
69
69
  @vpn_tunnel.delete(mandatory_field)
70
70
  validator = Vcloud::Core::ConfigValidator.validate(:base, @vpn_tunnel, Vcloud::EdgeGateway::Schema::VPN_RULE)
71
- expect(validator.valid?).to be_false
71
+ expect(validator.valid?).to be false
72
72
  expect(validator.errors).to eq(["base: missing '#{mandatory_field}' parameter"])
73
73
  end
74
74
  end
@@ -101,7 +101,7 @@ module Vcloud
101
101
  description: 'foobarbaz'
102
102
  }
103
103
  validator = Vcloud::Core::ConfigValidator.validate(:base, vpn_tunnel, Vcloud::EdgeGateway::Schema::VPN_RULE)
104
- expect(validator.valid?).to be_true
104
+ expect(validator.valid?).to be true
105
105
  expect(validator.errors).to be_empty
106
106
  end
107
107
  end
@@ -19,16 +19,17 @@ Gem::Specification.new do |s|
19
19
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
20
20
  s.require_paths = ['lib']
21
21
 
22
- s.required_ruby_version = '>= 1.9.3'
22
+ s.required_ruby_version = '>= 2.2.2'
23
23
 
24
- s.add_runtime_dependency 'vcloud-core', '~> 1.1.0'
24
+ s.add_runtime_dependency 'vcloud-core', '~> 2.1.0'
25
25
  s.add_runtime_dependency 'hashdiff'
26
26
  s.add_development_dependency 'pry'
27
- s.add_development_dependency 'rake'
28
- s.add_development_dependency 'rspec', '~> 2.14.1'
29
- s.add_development_dependency 'rubocop', '~> 0.23.0'
30
- s.add_development_dependency 'simplecov', '~> 0.7.1'
27
+ s.add_development_dependency 'rake', '>= 12'
28
+ s.add_development_dependency 'rspec', '>= 3.6 '
29
+ s.add_development_dependency 'rubocop', '~> 0.49.1'
30
+ s.add_development_dependency 'simplecov', '~> 0.14.1'
31
31
  s.add_development_dependency 'gem_publisher', '1.2.0'
32
- s.add_development_dependency 'vcloud-tools-tester', '~> 1.0.0'
32
+ s.add_development_dependency 'nokogiri', '~> 1.6.8.1'
33
+ s.add_development_dependency 'vcloud-tools-tester', '~> 2.1.0'
33
34
  end
34
35
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcloud-edge_gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anna Shipman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-21 00:00:00.000000000 Z
11
+ date: 2017-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vcloud-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.0
19
+ version: 2.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.0
26
+ version: 2.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: hashdiff
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,56 +58,56 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '12'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '12'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 2.14.1
75
+ version: '3.6'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 2.14.1
82
+ version: '3.6'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.23.0
89
+ version: 0.49.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.23.0
96
+ version: 0.49.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.7.1
103
+ version: 0.14.1
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.7.1
110
+ version: 0.14.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: gem_publisher
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -122,20 +122,34 @@ dependencies:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
124
  version: 1.2.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: nokogiri
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 1.6.8.1
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 1.6.8.1
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: vcloud-tools-tester
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
143
  - - "~>"
130
144
  - !ruby/object:Gem::Version
131
- version: 1.0.0
145
+ version: 2.1.0
132
146
  type: :development
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
150
  - - "~>"
137
151
  - !ruby/object:Gem::Version
138
- version: 1.0.0
152
+ version: 2.1.0
139
153
  description: Tool to configure a VMware vCloud Edge Gateway. Uses vcloud-core.
140
154
  email:
141
155
  - anna.shipman@digital.cabinet-office.gov.uk
@@ -150,6 +164,7 @@ files:
150
164
  - CHANGELOG.md
151
165
  - CONTRIBUTING.md
152
166
  - Gemfile
167
+ - Jenkinsfile
153
168
  - LICENSE.txt
154
169
  - README.md
155
170
  - Rakefile
@@ -251,7 +266,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
251
266
  requirements:
252
267
  - - ">="
253
268
  - !ruby/object:Gem::Version
254
- version: 1.9.3
269
+ version: 2.2.2
255
270
  required_rubygems_version: !ruby/object:Gem::Requirement
256
271
  requirements:
257
272
  - - ">="
@@ -259,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
274
  version: '0'
260
275
  requirements: []
261
276
  rubyforge_project:
262
- rubygems_version: 2.2.2
277
+ rubygems_version: 2.4.5
263
278
  signing_key:
264
279
  specification_version: 4
265
280
  summary: Tool to configure a VMware vCloud Edge Gateway