-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhello_spec.rb
More file actions
46 lines (38 loc) · 1.1 KB
/
hello_spec.rb
File metadata and controls
46 lines (38 loc) · 1.1 KB
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
# better to start is in background and check it's running only
# better to avoid shell scripting check proc/port/output using inspec as shown below
describe command('bash -c "cd /srv/hello && ./tests/run_test.sh"') do
its('exit_status') { should eq 0 }
end
#cmd = <<-EOH
## script something
## script something
## script something
#EOH
#describe command(cmd) do
#its('exit_status') { should eq 0 }
#end
## check port
#describe port(5000) do
#it { should be_listening }
#end
#describe command('curl -m 10 -s -v -f http://127.0.0.1:5000/') do
#its('stdout') { should eq 'Hello World!' }
#its('exit_status') { should eq 0 }
#end
## BUT BE AWARE OF NOT YET IMPLEMENTED F ON DOCKER ENV BELOW
#return if ::File.exist?('/.dockerenv')
## check that ssh runs
#if os.unix?
#describe port(5000) do
#it { should be_listening }
#its('protocols') { should include('tcp') }
#end
#end
## extra test for linux
#if os.linux?
#describe port(5000) do
#its('processes') { should include 'python' }
#its('protocols') { should include 'tcp' }
#its('addresses') {should include '0.0.0.0'}
#end
#end