Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.

Commit b666d6c

Browse files
authored
Merge pull request #191 from josejulio/use_official_docker
Use the official docker repository from hawkular.
2 parents 269c39d + b5a7ca9 commit b666d6c

8 files changed

Lines changed: 83 additions & 78 deletions

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
hawkular:
2-
image: "pilhuhn/hawkular-services:latest"
2+
image: "hawkular/hawkular-services:latest"
33
ports:
44
- "8080:8080"
55
- "8443:8443"

spec/integration/operations_spec.rb

Lines changed: 52 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ module Hawkular::Operations::RSpec
159159
feed_id: @feed_id,
160160
resource_ids: [@wf_server_resource_id])
161161
wf_agent_path = path_for_installed_agent(wf_path)
162-
@agent_in_container = in_container(inventory_client, wf_agent_path)
162+
@agent_immutable = immutable(inventory_client, wf_agent_path)
163163
end
164164
end
165165
@bindings = { random_uuid: @random_uuid, tenant_id: @tenant_id, feed_id: @feed_id }
@@ -188,15 +188,15 @@ module Hawkular::Operations::RSpec
188188
actual_data[:data] = data
189189
end
190190
on.failure do |error|
191-
actual_data[:data] = :error
192-
puts 'error callback was called, reason: ' + error.to_s unless @agent_in_container
191+
actual_data[:data] = error
192+
puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
193193
end
194194
end
195195
actual_data = wait_for actual_data
196-
expect(actual_data['status']).to eq('OK') unless @agent_in_container
197-
expect(actual_data['message']).to start_with('Added JDBC Driver') unless @agent_in_container
198-
expect(actual_data['driverName']).to eq(driver_name) unless @agent_in_container
199-
expect(actual_data).to eq(:error) if @agent_in_container
196+
expect(actual_data['status']).to eq('OK') unless @agent_immutable
197+
expect(actual_data['message']).to start_with('Added JDBC Driver') unless @agent_immutable
198+
expect(actual_data['driverName']).to eq(driver_name) unless @agent_immutable
199+
expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
200200
end
201201

202202
it 'Restart should be performed and eventually respond with success' do
@@ -270,13 +270,14 @@ module Hawkular::Operations::RSpec
270270
actual_data[:data] = data
271271
end
272272
on.failure do |error|
273-
actual_data[:data] = {}
274-
puts 'error callback was called, reason: ' + error.to_s
273+
actual_data[:data] = error
274+
puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
275275
end
276276
end
277277
actual_data = wait_for actual_data
278-
expect(actual_data['status']).to eq('OK')
279-
expect(actual_data['message']).to start_with('Performed [Disable Deployment] on')
278+
expect(actual_data['status']).to eq('OK') unless @agent_immutable
279+
expect(actual_data['message']).to start_with('Performed [Disable Deployment] on') unless @agent_immutable
280+
expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
280281
end
281282

282283
it 'Add non-XA datasource should be doable' do
@@ -311,16 +312,17 @@ module Hawkular::Operations::RSpec
311312
actual_data[:data] = data
312313
end
313314
on.failure do |error|
314-
actual_data[:data] = { 'status' => 'ERROR' }
315-
puts 'error callback was called, reason: ' + error.to_s
315+
actual_data[:data] = error
316+
puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
316317
end
317318
end
318319
actual_data = wait_for actual_data
319-
expect(actual_data['status']).to eq('OK')
320-
expect(actual_data['message']).to start_with('Added Datasource')
321-
expect(actual_data['xaDatasource']).to be_falsey
322-
expect(actual_data['datasourceName']).to eq(payload[:datasourceName])
323-
expect(actual_data['resourcePath']).to eq(payload[:resourcePath])
320+
expect(actual_data['status']).to eq('OK') unless @agent_immutable
321+
expect(actual_data['message']).to start_with('Added Datasource') unless @agent_immutable
322+
expect(actual_data['xaDatasource']).to be_falsey unless @agent_immutable
323+
expect(actual_data['datasourceName']).to eq(payload[:datasourceName]) unless @agent_immutable
324+
expect(actual_data['resourcePath']).to eq(payload[:resourcePath]) unless @agent_immutable
325+
expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
324326
end
325327

326328
it 'Add XA datasource should be doable' do
@@ -355,16 +357,17 @@ module Hawkular::Operations::RSpec
355357
actual_data[:data] = data
356358
end
357359
on.failure do |error|
358-
actual_data[:data] = { 'status' => 'ERROR' }
359-
puts 'error callback was called, reason: ' + error.to_s
360+
actual_data[:data] = error
361+
puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
360362
end
361363
end
362364
actual_data = wait_for actual_data
363-
expect(actual_data['status']).to eq('OK')
364-
expect(actual_data['message']).to start_with('Added Datasource')
365-
expect(actual_data['xaDatasource']).to be_truthy
366-
expect(actual_data['datasourceName']).to eq(payload[:datasourceName])
367-
expect(actual_data['resourcePath']).to eq(payload[:resourcePath])
365+
expect(actual_data['status']).to eq('OK') unless @agent_immutable
366+
expect(actual_data['message']).to start_with('Added Datasource') unless @agent_immutable
367+
expect(actual_data['xaDatasource']).to be_truthy unless @agent_immutable
368+
expect(actual_data['datasourceName']).to eq(payload[:datasourceName]) unless @agent_immutable
369+
expect(actual_data['resourcePath']).to eq(payload[:resourcePath]) unless @agent_immutable
370+
expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
368371
end
369372

370373
it 'should not be possible to perform on closed client' do
@@ -438,15 +441,16 @@ module Hawkular::Operations::RSpec
438441
actual_data[:data] = data
439442
end
440443
on.failure do |error|
441-
actual_data[:data] = {}
442-
puts 'error callback was called, reason: ' + error.to_s
444+
actual_data[:data] = error
445+
puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
443446
end
444447
end
445448
actual_data = wait_for actual_data
446-
expect(actual_data['status']).to eq('OK')
447-
expect(actual_data['message']).to start_with('Performed [Deploy] on')
448-
expect(actual_data['destinationFileName']).to eq(app_name)
449-
expect(actual_data['resourcePath']).to eq(wf_path)
449+
expect(actual_data['status']).to eq('OK') unless @agent_immutable
450+
expect(actual_data['message']).to start_with('Performed [Deploy] on') unless @agent_immutable
451+
expect(actual_data['destinationFileName']).to eq(app_name) unless @agent_immutable
452+
expect(actual_data['resourcePath']).to eq(wf_path) unless @agent_immutable
453+
expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
450454
end
451455

452456
it 'Undeploy deployment should be performed and eventually respond with success' do
@@ -465,13 +469,14 @@ module Hawkular::Operations::RSpec
465469
actual_data[:data] = data
466470
end
467471
on.failure do |error|
468-
actual_data[:data] = { 'status' => 'ERROR' }
469-
puts 'error callback was called, reason: ' + error.to_s
472+
actual_data[:data] = error
473+
puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
470474
end
471475
end
472476
actual_data = wait_for actual_data
473-
expect(actual_data['status']).to eq('OK')
474-
expect(actual_data['message']).to start_with('Performed [Undeploy] on')
477+
expect(actual_data['status']).to eq('OK') unless @agent_immutable
478+
expect(actual_data['message']).to start_with('Performed [Undeploy] on') unless @agent_immutable
479+
expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
475480
end
476481

477482
it 'Remove datasource should be performed and eventually respond with success' do
@@ -491,14 +496,15 @@ module Hawkular::Operations::RSpec
491496
actual_data[:data] = data
492497
end
493498
on.failure do |error|
494-
actual_data[:data] = {}
495-
puts 'error callback was called, reason: ' + error.to_s
499+
actual_data[:data] = error
500+
puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
496501
end
497502
end
498503
actual_data = wait_for actual_data
499-
expect(actual_data['status']).to eq('OK')
500-
expect(actual_data['message']).to start_with('Performed [Remove] on')
501-
expect(actual_data['serverRefreshIndicator']).to eq('RELOAD-REQUIRED')
504+
expect(actual_data['status']).to eq('OK') unless @agent_immutable
505+
expect(actual_data['message']).to start_with('Performed [Remove] on') unless @agent_immutable
506+
expect(actual_data['serverRefreshIndicator']).to eq('RELOAD-REQUIRED') unless @agent_immutable
507+
expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
502508
end
503509

504510
it 'Remove JDBC driver should be performed and eventually respond with success' do
@@ -515,16 +521,16 @@ module Hawkular::Operations::RSpec
515521
actual_data[:data] = data
516522
end
517523
on.failure do |error|
518-
actual_data[:data] = :error
519-
puts 'error callback was called, reason: ' + error.to_s unless @agent_in_container
524+
actual_data[:data] = error
525+
puts 'error callback was called, reason: ' + error.to_s unless @agent_immutable
520526
end
521527
end
522528
actual_data = wait_for actual_data
523-
expect(actual_data['status']).to eq('OK') unless @agent_in_container
524-
expect(actual_data['resourcePath']).to eq(path) unless @agent_in_container
529+
expect(actual_data['status']).to eq('OK') unless @agent_immutable
530+
expect(actual_data['resourcePath']).to eq(path) unless @agent_immutable
525531
expect(actual_data['message']).to start_with(
526-
'Performed [Remove] on a [JDBC Driver]') unless @agent_in_container
527-
expect(actual_data).to eq(:error) if @agent_in_container
532+
'Performed [Remove] on a [JDBC Driver]') unless @agent_immutable
533+
expect(actual_data).to include('Command not allowed because the agent is immutable') if @agent_immutable
528534
end
529535

530536
xit 'Export JDR should retrieve the zip file with the report' do

spec/spec_helper.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,8 @@ def in_container(inventory, resource_path)
206206
end
207207

208208
def immutable(inventory, resource_path)
209-
inventory.get_resource(resource_path, true).properties
210-
properties['Immutable'] == 'true' if properties.key? 'Immutable'
211-
false
209+
properties = inventory.get_resource(resource_path, true).properties
210+
properties.key?('Immutable') ? (properties['Immutable'] == 'true') : false
212211
end
213212

214213
def make_template(base_directory, cassette_name, bindings)

spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/agent_properties.yml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/get_feed.yml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/vcr_cassettes/Operation/NonSecure/Operation/Add_JDBC_driver_should_add_the_driver.json

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)