vmware-vra 3.1.2 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/linters.yml +9 -0
- data/.markdownlint.yaml +5 -0
- data/.mdlrc +1 -0
- data/CHANGELOG.md +9 -0
- data/README.md +37 -26
- data/Rakefile +2 -2
- data/lib/vra/catalog.rb +6 -7
- data/lib/vra/catalog_base.rb +4 -4
- data/lib/vra/catalog_item.rb +12 -12
- data/lib/vra/catalog_source.rb +13 -13
- data/lib/vra/catalog_type.rb +6 -6
- data/lib/vra/client.rb +13 -13
- data/lib/vra/deployment.rb +21 -21
- data/lib/vra/deployment_request.rb +8 -9
- data/lib/vra/deployments.rb +1 -1
- data/lib/vra/http.rb +6 -6
- data/lib/vra/request.rb +6 -6
- data/lib/vra/request_parameters.rb +9 -9
- data/lib/vra/resource.rb +16 -16
- data/lib/vra/version.rb +1 -1
- data/lib/vra.rb +14 -14
- data/spec/catalog_item_spec.rb +50 -50
- data/spec/catalog_source_spec.rb +53 -53
- data/spec/catalog_spec.rb +45 -45
- data/spec/catalog_type_spec.rb +32 -32
- data/spec/client_spec.rb +202 -202
- data/spec/deployment_request_spec.rb +74 -74
- data/spec/deployment_spec.rb +70 -70
- data/spec/deployments_spec.rb +19 -19
- data/spec/http_spec.rb +59 -59
- data/spec/request_spec.rb +34 -34
- data/spec/resource_spec.rb +55 -55
- data/spec/spec_helper.rb +4 -4
- metadata +6 -6
- data/.github/ISSUE_TEMPLATE.md +0 -23
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -14
- data/.github/workflows/unit.yml +0 -23
data/spec/http_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "spec_helper"
|
4
|
+
require "webmock"
|
5
5
|
|
6
6
|
describe Vra::Http do
|
7
7
|
def expecting_request(method, url, with = nil)
|
@@ -27,129 +27,129 @@ describe Vra::Http do
|
|
27
27
|
execute :head, params
|
28
28
|
end
|
29
29
|
|
30
|
-
describe
|
31
|
-
it
|
32
|
-
headers = {
|
30
|
+
describe "#execute" do
|
31
|
+
it "makes a HEAD request" do
|
32
|
+
headers = { "X-Made-Up-Header" => "Foo AND bar? Are you sure?" }
|
33
33
|
|
34
|
-
expecting_request(:head,
|
35
|
-
head url:
|
34
|
+
expecting_request(:head, "http://test.local", headers: headers) do
|
35
|
+
head url: "http://test.local", headers: headers
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
it
|
40
|
-
headers = {
|
39
|
+
it "makes a GET request" do
|
40
|
+
headers = { "X-Made-Up-Header" => "Foo AND bar? Are you sure?" }
|
41
41
|
|
42
|
-
expecting_request(:get,
|
43
|
-
get url:
|
42
|
+
expecting_request(:get, "http://test.local", headers: headers) do
|
43
|
+
get url: "http://test.local", headers: headers
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
it
|
48
|
-
headers = {
|
49
|
-
payload =
|
47
|
+
it "makes a POST request" do
|
48
|
+
headers = { "X-Made-Up-Header" => "Foo AND bar? Are you sure?" }
|
49
|
+
payload = "withabodylikethis"
|
50
50
|
|
51
|
-
expecting_request(:post,
|
52
|
-
post url:
|
51
|
+
expecting_request(:post, "http://test.local", headers: headers, body: payload) do
|
52
|
+
post url: "http://test.local", headers: headers, payload: payload
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
it
|
57
|
-
stub_request(:head,
|
58
|
-
.to_return(headers: {
|
56
|
+
it "preserves Location" do
|
57
|
+
stub_request(:head, "http://test.local")
|
58
|
+
.to_return(headers: { "Location" => "http://test-location.local" })
|
59
59
|
|
60
|
-
response = head(url:
|
60
|
+
response = head(url: "http://test.local")
|
61
61
|
|
62
|
-
expect(response.location).to eq
|
62
|
+
expect(response.location).to eq "http://test-location.local"
|
63
63
|
end
|
64
64
|
|
65
|
-
it
|
66
|
-
stub_request(:head,
|
67
|
-
.to_return(status: [204,
|
65
|
+
it "preserves status code" do
|
66
|
+
stub_request(:head, "http://test.local")
|
67
|
+
.to_return(status: [204, "No content"])
|
68
68
|
|
69
|
-
response = head(url:
|
69
|
+
response = head(url: "http://test.local")
|
70
70
|
|
71
71
|
expect(response.code).to eq 204
|
72
72
|
end
|
73
73
|
|
74
|
-
it
|
74
|
+
it "configures ssl verification" do
|
75
75
|
allow(Net::HTTP).to receive(:start).and_wrap_original do |_http, *args|
|
76
76
|
expect(args.last).to include(verify_mode: OpenSSL::SSL::VERIFY_NONE)
|
77
|
-
double(
|
77
|
+
double("response", final?: true, success?: true)
|
78
78
|
end
|
79
79
|
|
80
|
-
execute(:get, url:
|
80
|
+
execute(:get, url: "https://test.local", verify_ssl: false)
|
81
81
|
end
|
82
82
|
|
83
|
-
context
|
84
|
-
it
|
85
|
-
stub_request(:head,
|
86
|
-
.to_return(status: [200,
|
83
|
+
context "when successful" do
|
84
|
+
it "returns a successful response given a status 200" do
|
85
|
+
stub_request(:head, "http://test.local")
|
86
|
+
.to_return(status: [200, "Whatevs"])
|
87
87
|
|
88
|
-
response = head(url:
|
88
|
+
response = head(url: "http://test.local")
|
89
89
|
|
90
90
|
expect(response.success_ok?).to be_truthy
|
91
91
|
end
|
92
92
|
|
93
|
-
it
|
94
|
-
stub_request(:head,
|
95
|
-
.to_return(status: [204,
|
93
|
+
it "returns a successful response given a status 204" do
|
94
|
+
stub_request(:head, "http://test.local")
|
95
|
+
.to_return(status: [204, "Whatevs"])
|
96
96
|
|
97
|
-
response = head(url:
|
97
|
+
response = head(url: "http://test.local")
|
98
98
|
|
99
99
|
expect(response.success_no_content?).to be_truthy
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
context
|
103
|
+
context "when unsuccessful" do
|
104
104
|
(400..418).each do |status|
|
105
105
|
it "raises an exception given a status #{status}" do
|
106
|
-
stub_request(:get,
|
107
|
-
.to_return(status: [status,
|
106
|
+
stub_request(:get, "http://test.local")
|
107
|
+
.to_return(status: [status, "Whatevs"],
|
108
108
|
body: '{"message":"Error"}')
|
109
109
|
|
110
|
-
expect { get(url:
|
110
|
+
expect { get(url: "http://test.local") }.to raise_error do |error|
|
111
111
|
expect(error).to be_a(StandardError)
|
112
112
|
expect(error.http_code).to eq status
|
113
|
-
expect(error.response).to eq({
|
113
|
+
expect(error.response).to eq({ "message" => "Error" })
|
114
114
|
end
|
115
115
|
end
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
context
|
119
|
+
context "when redirected" do
|
120
120
|
[301, 302, 307].each do |status|
|
121
|
-
%i
|
121
|
+
%i{get head}.each do |method|
|
122
122
|
it "follows #{status} redirected #{method.to_s.upcase} requests" do
|
123
|
-
stub_request(method,
|
124
|
-
.to_return(status: [status,
|
125
|
-
headers: {
|
123
|
+
stub_request(method, "http://test.local")
|
124
|
+
.to_return(status: [status, "redirect"],
|
125
|
+
headers: { "Location" => "http://test.local/redirect" })
|
126
126
|
|
127
|
-
expecting_request(method,
|
128
|
-
execute(method, url:
|
127
|
+
expecting_request(method, "http://test.local/redirect") do
|
128
|
+
execute(method, url: "http://test.local")
|
129
129
|
end
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
133
|
it "does not follow #{status} redirected POST requests" do
|
134
|
-
stub_request(:post,
|
135
|
-
.to_return(status: [status,
|
136
|
-
headers: {
|
134
|
+
stub_request(:post, "http://test.local")
|
135
|
+
.to_return(status: [status, "redirect"],
|
136
|
+
headers: { "Location" => "http://test.local/redirect" })
|
137
137
|
|
138
|
-
expect { post(url:
|
138
|
+
expect { post(url: "http://test.local") }.to raise_error do |error|
|
139
139
|
expect(error).to be_a(StandardError)
|
140
140
|
expect(error.http_code).to eq status
|
141
141
|
end
|
142
142
|
end
|
143
143
|
end
|
144
144
|
|
145
|
-
%i
|
145
|
+
%i{head post}.each do |method|
|
146
146
|
it "converts #{method.to_s.upcase} to GET on 303 redirect" do
|
147
|
-
stub_request(method,
|
148
|
-
.to_return(status: [303,
|
149
|
-
headers: {
|
147
|
+
stub_request(method, "http://test.local")
|
148
|
+
.to_return(status: [303, "See Other"],
|
149
|
+
headers: { "Location" => "http://test.local/redirect" })
|
150
150
|
|
151
|
-
expecting_request(:get,
|
152
|
-
execute method, url:
|
151
|
+
expecting_request(:get, "http://test.local/redirect") do
|
152
|
+
execute method, url: "http://test.local"
|
153
153
|
end
|
154
154
|
end
|
155
155
|
end
|
data/spec/request_spec.rb
CHANGED
@@ -17,15 +17,15 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
19
|
|
20
|
-
require
|
20
|
+
require "spec_helper"
|
21
21
|
|
22
|
-
shared_examples
|
23
|
-
it
|
22
|
+
shared_examples "refresh_trigger_method" do |method|
|
23
|
+
it "calls #refresh_if_needed" do
|
24
24
|
expect(request).to receive(:refresh_if_empty)
|
25
25
|
request.send(method)
|
26
26
|
end
|
27
27
|
|
28
|
-
it
|
28
|
+
it "returns nil if request data is empty" do
|
29
29
|
allow(request).to receive(:refresh_if_empty)
|
30
30
|
allow(request).to receive(:request_empty?).and_return true
|
31
31
|
expect(request.send(method)).to eq nil
|
@@ -35,24 +35,24 @@ end
|
|
35
35
|
describe Vra::Request do
|
36
36
|
let(:client) do
|
37
37
|
Vra::Client.new(
|
38
|
-
username:
|
39
|
-
password:
|
40
|
-
tenant:
|
41
|
-
base_url:
|
38
|
+
username: "user@corp.local",
|
39
|
+
password: "password",
|
40
|
+
tenant: "tenant",
|
41
|
+
base_url: "https://vra.corp.local"
|
42
42
|
)
|
43
43
|
end
|
44
44
|
|
45
|
-
let(:deployment_id) {
|
45
|
+
let(:deployment_id) { "dep-123" }
|
46
46
|
|
47
|
-
let(:request_id) {
|
47
|
+
let(:request_id) { "req-123" }
|
48
48
|
|
49
49
|
let(:completed_payload) do
|
50
|
-
JSON.parse(File.read(
|
50
|
+
JSON.parse(File.read("spec/fixtures/resource/sample_dep_request.json"))
|
51
51
|
end
|
52
52
|
|
53
53
|
let(:in_progress_payload) do
|
54
|
-
JSON.parse(File.read(
|
55
|
-
|
54
|
+
JSON.parse(File.read("spec/fixtures/resource/sample_dep_request.json"))
|
55
|
+
.merge("status" => "IN_PROGRESS")
|
56
56
|
end
|
57
57
|
|
58
58
|
let(:request) { Vra::Request.new(client, deployment_id, data: in_progress_payload) }
|
@@ -61,28 +61,28 @@ describe Vra::Request do
|
|
61
61
|
allow(client).to receive(:authorized?).and_return(true)
|
62
62
|
end
|
63
63
|
|
64
|
-
describe
|
65
|
-
it
|
64
|
+
describe "#initialize" do
|
65
|
+
it "sets the id" do
|
66
66
|
allow(client).to receive(:get_parsed).and_return(completed_payload)
|
67
67
|
|
68
68
|
req = described_class.new(client, deployment_id, id: request_id)
|
69
69
|
expect(req.id).to eq(request_id)
|
70
70
|
end
|
71
71
|
|
72
|
-
it
|
72
|
+
it "sets the attributes correctly" do
|
73
73
|
allow(client).to receive(:get_parsed).and_return(completed_payload)
|
74
74
|
|
75
75
|
req = described_class.new(client, deployment_id, id: request_id)
|
76
|
-
expect(req.status).to eq(
|
76
|
+
expect(req.status).to eq("SUCCESSFUL")
|
77
77
|
expect(req.completed?).to be_truthy
|
78
78
|
expect(req.failed?).to be_falsey
|
79
|
-
expect(req.name).to eq(
|
80
|
-
expect(req.requested_by).to eq(
|
79
|
+
expect(req.name).to eq("Create")
|
80
|
+
expect(req.requested_by).to eq("admin")
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
describe
|
85
|
-
it
|
84
|
+
describe "#refresh" do
|
85
|
+
it "calls the request API endpoint" do
|
86
86
|
expect(client).to receive(:get_parsed)
|
87
87
|
.with("/deployment/api/deployments/#{deployment_id}/requests/#{request_id}?deleted=true")
|
88
88
|
.and_return(in_progress_payload)
|
@@ -90,7 +90,7 @@ describe Vra::Request do
|
|
90
90
|
request.refresh
|
91
91
|
end
|
92
92
|
|
93
|
-
it
|
93
|
+
it "should raise an exception if the resource not found" do
|
94
94
|
allow(client).to receive(:get_parsed).and_raise(Vra::Exception::HTTPNotFound)
|
95
95
|
|
96
96
|
expect { request.refresh }
|
@@ -99,38 +99,38 @@ describe Vra::Request do
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
describe
|
103
|
-
context
|
104
|
-
it
|
102
|
+
describe "#refresh_if_empty" do
|
103
|
+
context "request data is not empty" do
|
104
|
+
it "does not call #refresh" do
|
105
105
|
allow(request).to receive(:request_empty?).and_return(false)
|
106
106
|
expect(request).to_not receive(:refresh)
|
107
107
|
end
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
-
describe
|
112
|
-
it_behaves_like
|
111
|
+
describe "#status" do
|
112
|
+
it_behaves_like "refresh_trigger_method", :status
|
113
113
|
end
|
114
114
|
|
115
|
-
describe
|
116
|
-
context
|
117
|
-
it
|
115
|
+
describe "#completed?" do
|
116
|
+
context "when the request is neither successful or failed yet" do
|
117
|
+
it "returns false" do
|
118
118
|
allow(request).to receive(:successful?).and_return(false)
|
119
119
|
allow(request).to receive(:failed?).and_return(false)
|
120
120
|
expect(request.completed?).to eq false
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
context
|
125
|
-
it
|
124
|
+
context "when the request is successful" do
|
125
|
+
it "returns true" do
|
126
126
|
allow(request).to receive(:successful?).and_return(true)
|
127
127
|
allow(request).to receive(:failed?).and_return(false)
|
128
128
|
expect(request.completed?).to eq true
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
-
context
|
133
|
-
it
|
132
|
+
context "when the request failed" do
|
133
|
+
it "returns true" do
|
134
134
|
allow(request).to receive(:successful?).and_return(false)
|
135
135
|
allow(request).to receive(:failed?).and_return(true)
|
136
136
|
expect(request.completed?).to eq true
|
data/spec/resource_spec.rb
CHANGED
@@ -17,53 +17,53 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
19
|
|
20
|
-
require
|
21
|
-
require
|
20
|
+
require "spec_helper"
|
21
|
+
require "ffi_yajl"
|
22
22
|
|
23
23
|
describe Vra::Resource do
|
24
24
|
let(:client) do
|
25
25
|
Vra::Client.new(
|
26
|
-
username:
|
27
|
-
password:
|
28
|
-
tenant:
|
29
|
-
base_url:
|
26
|
+
username: "user@corp.local",
|
27
|
+
password: "password",
|
28
|
+
tenant: "tenant",
|
29
|
+
base_url: "https://vra.corp.local"
|
30
30
|
)
|
31
31
|
end
|
32
32
|
|
33
|
-
let(:resource_id) {
|
34
|
-
let(:deployment_id) {
|
33
|
+
let(:resource_id) { "res-123" }
|
34
|
+
let(:deployment_id) { "dep-123" }
|
35
35
|
|
36
36
|
let(:vm_payload) do
|
37
|
-
JSON.parse(File.read(
|
37
|
+
JSON.parse(File.read("spec/fixtures/resource/sample_dep_resource.json"))
|
38
38
|
end
|
39
39
|
|
40
|
-
describe
|
41
|
-
it
|
40
|
+
describe "#initialize" do
|
41
|
+
it "raises an error if no ID or resource data have been provided" do
|
42
42
|
expect { Vra::Resource.new(client, deployment_id) }.to raise_error(ArgumentError)
|
43
43
|
end
|
44
44
|
|
45
|
-
it
|
46
|
-
expect { Vra::Resource.new(client, deployment_id, id: 123, data:
|
45
|
+
it "raises an error if an ID and resource data have both been provided" do
|
46
|
+
expect { Vra::Resource.new(client, deployment_id, id: 123, data: "foo") }.to raise_error(ArgumentError)
|
47
47
|
end
|
48
48
|
|
49
|
-
context
|
50
|
-
it
|
49
|
+
context "when an ID is provided" do
|
50
|
+
it "calls fetch_resource_data" do
|
51
51
|
resource = Vra::Resource.allocate
|
52
52
|
expect(resource).to receive(:fetch_resource_data)
|
53
53
|
resource.send(:initialize, client, deployment_id, id: resource_id)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
context
|
58
|
-
it
|
57
|
+
context "when resource data is provided" do
|
58
|
+
it "populates the ID correctly" do
|
59
59
|
resource = Vra::Resource.new(client, deployment_id, data: vm_payload)
|
60
60
|
expect(resource.id).to eq resource_id
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
describe
|
66
|
-
it
|
65
|
+
describe "#fetch_resource_data" do
|
66
|
+
it "calls get_parsed against the resources API endpoint" do
|
67
67
|
expect(client).to receive(:get_parsed)
|
68
68
|
.with("/deployment/api/deployments/#{deployment_id}/resources/#{resource_id}")
|
69
69
|
.and_return({})
|
@@ -71,7 +71,7 @@ describe Vra::Resource do
|
|
71
71
|
Vra::Resource.new(client, deployment_id, id: resource_id)
|
72
72
|
end
|
73
73
|
|
74
|
-
it
|
74
|
+
it "should raise an exception if the resource not found" do
|
75
75
|
allow(client).to receive(:get_parsed).and_raise(Vra::Exception::HTTPNotFound)
|
76
76
|
|
77
77
|
expect { Vra::Resource.new(client, deployment_id, id: resource_id) }
|
@@ -80,80 +80,80 @@ describe Vra::Resource do
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
context
|
83
|
+
context "when a valid VM resource instance has been created" do
|
84
84
|
let(:resource) { Vra::Resource.new(client, deployment_id, data: vm_payload) }
|
85
85
|
|
86
|
-
describe
|
87
|
-
it
|
88
|
-
expect(resource.name).to eq
|
86
|
+
describe "#name" do
|
87
|
+
it "returns the correct name" do
|
88
|
+
expect(resource.name).to eq "Cloud_vSphere_Machine_1"
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
-
describe
|
93
|
-
it
|
94
|
-
expect(resource.status).to eq
|
92
|
+
describe "#status" do
|
93
|
+
it "returns the correct status" do
|
94
|
+
expect(resource.status).to eq "SUCCESS"
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
-
describe
|
99
|
-
context
|
100
|
-
let(:resource_data) { {
|
101
|
-
it
|
98
|
+
describe "#vm?" do
|
99
|
+
context "when the resource type is Cloud.vSphere.Machine" do
|
100
|
+
let(:resource_data) { { "type" => "Cloud.vSphere.Machine" } }
|
101
|
+
it "returns true" do
|
102
102
|
allow(resource).to receive(:resource_data).and_return(resource_data)
|
103
103
|
expect(resource.vm?).to eq(true)
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
context
|
108
|
-
let(:resource_data) { {
|
109
|
-
it
|
107
|
+
context "when the resource type is Cloud.Machine" do
|
108
|
+
let(:resource_data) { { "type" => "Cloud.Machine" } }
|
109
|
+
it "returns true" do
|
110
110
|
allow(resource).to receive(:resource_data).and_return(resource_data)
|
111
111
|
expect(resource.vm?).to eq(true)
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
context
|
116
|
-
let(:resource_data) { {
|
117
|
-
it
|
115
|
+
context "when the resource type is an unknown type" do
|
116
|
+
let(:resource_data) { { "type" => "Infrastructure.Unknown" } }
|
117
|
+
it "returns false" do
|
118
118
|
allow(resource).to receive(:resource_data).and_return(resource_data)
|
119
119
|
expect(resource.vm?).to eq(false)
|
120
120
|
end
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
describe
|
125
|
-
it
|
126
|
-
expect(resource.project_id).to eq
|
124
|
+
describe "#project" do
|
125
|
+
it "returns the correct project ID" do
|
126
|
+
expect(resource.project_id).to eq "pro-123"
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
-
describe
|
131
|
-
it
|
132
|
-
expect(resource.owner_names).to eq
|
130
|
+
describe "#owner_names" do
|
131
|
+
it "returns the correct owner names" do
|
132
|
+
expect(resource.owner_names).to eq "admin"
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
-
describe
|
137
|
-
it
|
136
|
+
describe "#network_interfaces" do
|
137
|
+
it "returns an array of 2 elements" do
|
138
138
|
expect(resource.network_interfaces.size).to be 2
|
139
139
|
end
|
140
140
|
|
141
|
-
it
|
141
|
+
it "contains the correct data" do
|
142
142
|
nic1, nic2 = resource.network_interfaces
|
143
143
|
|
144
|
-
expect(nic1[
|
145
|
-
expect(nic1[
|
146
|
-
expect(nic1[
|
144
|
+
expect(nic1["NETWORK_NAME"]).to eq "VM Network"
|
145
|
+
expect(nic1["NETWORK_ADDRESS"]).to eq "192.168.110.200"
|
146
|
+
expect(nic1["NETWORK_MAC_ADDRESS"]).to eq "00:50:56:ae:95:3c"
|
147
147
|
|
148
|
-
expect(nic2[
|
149
|
-
expect(nic2[
|
150
|
-
expect(nic2[
|
148
|
+
expect(nic2["NETWORK_NAME"]).to eq "Management Network"
|
149
|
+
expect(nic2["NETWORK_ADDRESS"]).to eq "192.168.220.200"
|
150
|
+
expect(nic2["NETWORK_MAC_ADDRESS"]).to eq "00:50:56:ae:95:3d"
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
154
|
-
describe
|
155
|
-
it
|
156
|
-
expect(resource.ip_address).to eq
|
154
|
+
describe "#ip_addresses" do
|
155
|
+
it "should have the correct ip address" do
|
156
|
+
expect(resource.ip_address).to eq "10.30.236.64"
|
157
157
|
end
|
158
158
|
end
|
159
159
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -17,19 +17,19 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
19
|
|
20
|
-
require
|
21
|
-
require
|
20
|
+
require "webmock/rspec"
|
21
|
+
require "simplecov"
|
22
22
|
|
23
23
|
SimpleCov.start do
|
24
24
|
enable_coverage :branch
|
25
25
|
end
|
26
26
|
|
27
|
-
require
|
27
|
+
require "vra"
|
28
28
|
|
29
29
|
def fixtures_dir
|
30
30
|
@fixtures_dir ||= begin
|
31
31
|
base_dir = File.dirname(__FILE__)
|
32
|
-
File.join(base_dir,
|
32
|
+
File.join(base_dir, "fixtures")
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vmware-vra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Leff
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-05-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi-yajl
|
@@ -130,10 +130,10 @@ executables: []
|
|
130
130
|
extensions: []
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
|
-
- ".github/
|
134
|
-
- ".github/PULL_REQUEST_TEMPLATE.md"
|
135
|
-
- ".github/workflows/unit.yml"
|
133
|
+
- ".github/workflows/linters.yml"
|
136
134
|
- ".gitignore"
|
135
|
+
- ".markdownlint.yaml"
|
136
|
+
- ".mdlrc"
|
137
137
|
- ".rubocop.yml"
|
138
138
|
- CHANGELOG.md
|
139
139
|
- Gemfile
|
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
209
|
requirements: []
|
210
|
-
rubygems_version: 3.3
|
210
|
+
rubygems_version: 3.2.3
|
211
211
|
signing_key:
|
212
212
|
specification_version: 4
|
213
213
|
summary: Client gem for interacting with VMware vRealize Automation.
|
data/.github/ISSUE_TEMPLATE.md
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
### Versions:
|
2
|
-
<!--- Version of the software where you are encountering the issue --->
|
3
|
-
<!-- You should probably update in this is not newest release.--->
|
4
|
-
* Version of vmware-vra-gem:
|
5
|
-
* Version of chef:
|
6
|
-
* Version of ruby:
|
7
|
-
|
8
|
-
### Platform Details
|
9
|
-
<!--- What version of vRA are you running? What version of ESXi are you using too?--->
|
10
|
-
* Version of vRA:
|
11
|
-
* Version of ESXi:
|
12
|
-
|
13
|
-
### Scenario:
|
14
|
-
<!--- What you are trying to achieve and you can't?--->
|
15
|
-
|
16
|
-
### Steps to Reproduce:
|
17
|
-
<!--- If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this gem or any resources it includes?--->
|
18
|
-
|
19
|
-
### Expected Result:
|
20
|
-
<!--- What are you expecting to happen as the consequence of above reproduction steps?--->
|
21
|
-
|
22
|
-
### Actual Result:
|
23
|
-
<!--- What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.--->
|
@@ -1,14 +0,0 @@
|
|
1
|
-
### Description
|
2
|
-
|
3
|
-
<!--- Describe what this change achieves--->
|
4
|
-
|
5
|
-
### Issues Resolved
|
6
|
-
|
7
|
-
<!--- List any existing issues this PR resolves--->
|
8
|
-
|
9
|
-
### Check List
|
10
|
-
|
11
|
-
- [ ] All tests pass.
|
12
|
-
- [ ] All style checks pass.
|
13
|
-
- [ ] Functionality includes testing.
|
14
|
-
- [ ] Functionality has been documented in the README if applicable
|