-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
60-st2_all-services-ok_spec.rb
78 lines (64 loc) · 1.99 KB
/
60-st2_all-services-ok_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
require 'spec_helper'
require 'examples/show-service-log-on-failure'
describe 'external services' do
# Buggy buggy netcat vs serverspec :(
# Hostnames have to priorly resolved as addresses.
describe 'rabbitmq' do
subject { host(spec[:rabbitmqhost]) }
it { is_expected.to be_reachable.with :port => 5672, :timeout => 1 }
end
describe 'mongodb' do
subject { host(spec[:mongodbhost]) }
it { is_expected.to be_reachable.with :port => 27017, :timeout => 1 }
end
describe 'redis' do
subject { host(spec[:redishost]) }
it { is_expected.to be_reachable.with :port => 6379, :timeout => 1 }
end
end
describe 'start st2 components and services' do
before(:all) do
puts "===> Starting st2 services #{spec[:service_list].join(', ')}..."
remote_start_services(spec[:service_list])
puts
end
# Run register content
describe command(spec[:register_content_command]) do
its(:exit_status) { is_expected.to eq 0 }
after(:all) do
if described_class.exit_status > 0
puts "Register content has failed!", '>>>>>',
described_class.stderr
puts
end
end
end
end
# Check if component services are running/enabled
describe 'st2 services' do
include_examples 'show service log on failure'
spec[:service_list].each do |name|
describe service(name), prompt_on_failure: true do
it { is_expected.to be_running }
it { should be_enabled }
end
end
describe 'st2auth', prompt_on_failure: true do
subject { port(9100) }
it { should be_listening }
end
describe 'st2api', prompt_on_failure: true do
subject { port(9101) }
it { should be_listening }
end
describe 'st2stream', prompt_on_failure: true do
subject { port(9102) }
it { should be_listening }
end
end
# all st2 services should work immediately after restart
describe 'st2 services availability after restart' do
describe command("st2ctl restart && st2 action list") do
its(:exit_status) { is_expected.to eq 0 }
end
end