clc-chef-provisioning-vsphere 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,60 @@
1
+ require_relative '../../lib/chef/provisioning/vsphere_driver/vsphere_url.rb'
2
+
3
+ describe 'VsphereUrl' do
4
+ expected_host='1.1.1.1'
5
+ expected_port=1818
6
+ expected_path='/path'
7
+
8
+ let(:url) {URI("vsphere://#{expected_host}:#{expected_port}#{expected_path}")}
9
+
10
+ it "has the vsphere scheme" do
11
+ expect(url.scheme).to eq('vsphere')
12
+ end
13
+ it "has the expected host" do
14
+ expect(url.host).to eq(expected_host)
15
+ end
16
+ it "has the expected port" do
17
+ expect(url.port).to eq(expected_port)
18
+ end
19
+ it "has the expected path" do
20
+ expect(url.path).to eq(expected_path)
21
+ end
22
+ it "has the the default ssl setting" do
23
+ expect(url.use_ssl).to eq(true)
24
+ end
25
+ it "has the the default insecure setting" do
26
+ expect(url.insecure).to eq(false)
27
+ end
28
+
29
+ context "when setting from a hash" do
30
+ let(:url) {URI::VsphereUrl.from_config({:host => '2.2.2.2', :port => 2345, :path => "/hoooo", :use_ssl => false, :insecure => true})}
31
+
32
+ it "asigns the correct url" do
33
+ expect(url.to_s).to eq('vsphere://2.2.2.2:2345/hoooo?use_ssl=false&insecure=true')
34
+ end
35
+ end
36
+ context "when ssl is enabled" do
37
+ it "retuns an ssl value of true" do
38
+ url = URI("vsphere://#{expected_host}:#{expected_port}#{expected_path}?use_ssl=true")
39
+ expect(url.use_ssl).to eq(true)
40
+ end
41
+ end
42
+ context "when ssl is disabled" do
43
+ it "retuns an ssl value of true" do
44
+ url = URI("vsphere://#{expected_host}:#{expected_port}#{expected_path}?use_ssl=false")
45
+ expect(url.use_ssl).to eq(false)
46
+ end
47
+ end
48
+ context "when insecure is enabled" do
49
+ it "retuns an insecure value of true" do
50
+ url = URI("vsphere://#{expected_host}:#{expected_port}#{expected_path}?insecure=true")
51
+ expect(url.insecure).to eq(true)
52
+ end
53
+ end
54
+ context "when insecure is disabled" do
55
+ it "retuns an insecure value of true" do
56
+ url = URI("vsphere://#{expected_host}:#{expected_port}#{expected_path}?insecure=false")
57
+ expect(url.insecure).to eq(false)
58
+ end
59
+ end
60
+ end
metadata ADDED
@@ -0,0 +1,127 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: clc-chef-provisioning-vsphere
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.0
5
+ platform: ruby
6
+ authors:
7
+ - CenturyLink Cloud
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rbvmomi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.8.0
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.8.2
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 1.8.0
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.8.2
33
+ - !ruby/object:Gem::Dependency
34
+ name: chef-provisioning
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.1'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.1'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ description: Provisioner for creating vSphere VM instances in Chef Provisioning.
76
+ email: matt.wrock@CenturyLinkCloud.com
77
+ executables: []
78
+ extensions: []
79
+ extra_rdoc_files:
80
+ - README.md
81
+ files:
82
+ - ".gitignore"
83
+ - Gemfile
84
+ - README.md
85
+ - Rakefile
86
+ - chef-provisioning-vsphere.gemspec
87
+ - lib/chef/provisioning/driver_init/vsphere.rb
88
+ - lib/chef/provisioning/vsphere_driver.rb
89
+ - lib/chef/provisioning/vsphere_driver/driver.rb
90
+ - lib/chef/provisioning/vsphere_driver/version.rb
91
+ - lib/chef/provisioning/vsphere_driver/vsphere_helpers.rb
92
+ - lib/chef/provisioning/vsphere_driver/vsphere_url.rb
93
+ - lib/kitchen/driver/vsphere.rb
94
+ - spec/integration_tests/.gitignore
95
+ - spec/integration_tests/vsphere_driver_spec.rb
96
+ - spec/unit_tests/VsphereDriver_spec.rb
97
+ - spec/unit_tests/VsphereUrl_spec.rb
98
+ homepage: https://github.com/tier3/chef-provisioning-vsphere
99
+ licenses:
100
+ - Apache 2.0
101
+ metadata: {}
102
+ post_install_message:
103
+ rdoc_options: []
104
+ require_paths:
105
+ - lib
106
+ required_ruby_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ requirements: []
117
+ rubyforge_project:
118
+ rubygems_version: 2.4.1
119
+ signing_key:
120
+ specification_version: 4
121
+ summary: Provisioner for creating vSphere VM instances in Chef Provisioning.
122
+ test_files:
123
+ - spec/integration_tests/.gitignore
124
+ - spec/integration_tests/vsphere_driver_spec.rb
125
+ - spec/unit_tests/VsphereDriver_spec.rb
126
+ - spec/unit_tests/VsphereUrl_spec.rb
127
+ has_rdoc: