Skip to content

Commit

Permalink
(CAT-2050) Fix service task specs
Browse files Browse the repository at this point in the history
(CAT-2050) Fix rubocop
  • Loading branch information
skyamgarp committed Sep 25, 2024
1 parent 13a29e8 commit c171b4b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions spec/acceptance/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,39 @@
it 'enable/status a service' do
result = run_bolt_task('service', 'action' => 'enable', 'name' => package_to_use)
expect(result.exit_code).to eq(0)
expect(result['result']).to include('status' => %r{in_sync|enabled})
expect(result['result']).to include('status' => %r{in_sync|enabled|active})

result = run_bolt_task('service', 'action' => 'status', 'name' => package_to_use)
expect(result.exit_code).to eq(0)
expect(result['result']).to include('enabled' => 'true')
expect(result['result']).to include('enabled' => %r{true|enabled}i)
end
end

describe 'restart action' do
it 'restart/status a service' do
result = run_bolt_task('service', 'action' => 'restart', 'name' => package_to_use)
expect(result.exit_code).to eq(0)
expect(result['result']).to include('status' => %r{restarted}i)
expect(result['result']).to include('status' => %r{restarted|active}i)

result = run_bolt_task('service', 'action' => 'status', 'name' => package_to_use)
expect(result.exit_code).to eq(0)
expect(result['result']).to include('status' => %r{running|Started}i)
expect(result['result']).to include('enabled' => %r{true|manual|automatic|delayed}i)
expect(result['result']).to include('status' => %r{running|Started|active}i)
expect(result['result']).to include('enabled' => %r{true|manual|automatic|delayed|enabled}i)
end
end

describe 'stop action' do
it 'stop/status a service' do
result = run_bolt_task('service', 'action' => 'stop', 'name' => package_to_use)
expect(result.exit_code).to eq(0)
expect(result['result']).to include('status' => %r{in_sync|stopped}i)
expect(result['result']).to include('status' => %r{in_sync|stopped|inactive}i)

# Debian can give incorrect status
unless ['debian', 'ubuntu'].include?(os[:family])
result = run_bolt_task('service', 'action' => 'status', 'name' => package_to_use)
expect(result.exit_code).to eq(0)
expect(result['result']).to include('status' => %r{stopped}i)
expect(result['result']).to include('enabled' => %r{true|manual|automatic|delayed}i)
expect(result['result']).to include('status' => %r{stopped|inactive}i)
expect(result['result']).to include('enabled' => %r{true|manual|automatic|delayed|enabled}i)
end
end
end
Expand All @@ -65,14 +65,14 @@
it 'start/status a service' do
result = run_bolt_task('service', 'action' => 'start', 'name' => package_to_use)
expect(result.exit_code).to eq(0)
expect(result['result']).to include('status' => %r{in_sync|started}i)
expect(result['result']).to include('status' => %r{in_sync|started|active}i)

# Debian can give incorrect status
unless ['debian', 'ubuntu'].include?(os[:family])
result = run_bolt_task('service', 'action' => 'status', 'name' => package_to_use)
expect(result.exit_code).to eq(0)
expect(result['result']).to include('status' => %r{running|Started}i)
expect(result['result']).to include('enabled' => %r{true|manual|automatic|delayed}i)
expect(result['result']).to include('status' => %r{running|Started|active}i)
expect(result['result']).to include('enabled' => %r{true|manual|automatic|delayed|enabled}i)
end
end
end
Expand All @@ -81,11 +81,11 @@
it 'disable/status a service' do
result = run_bolt_task('service', 'action' => 'disable', 'name' => package_to_use)
expect(result.exit_code).to eq(0)
expect(result['result']).to include('status' => 'disabled')
expect(result['result']).to include('status' => %r{disabled|active})

result = run_bolt_task('service', 'action' => 'status', 'name' => package_to_use)
expect(result.exit_code).to eq(0)
expect(result['result']).to include('enabled' => 'false')
expect(result['result']).to include('enabled' => %r{false|disabled})
end
end
end

0 comments on commit c171b4b

Please sign in to comment.