27. テストの記述
(httpd_spec.rb)
require 'spec_helper'
describe package('httpd') do
it { should be_installed }
end
describe service('httpd') do
it { should be_enabled }
it { should be_running }
end
describe port(80) do
it { should be_listening }
end
describe file('/var/www/html/hello.txt') do
it { should be_file }
it { should contain 'Hello, Chef' }
end
テストの初期処理の
呼び出し
13年6月15日土曜日
28. テストの記述
(httpd_spec.rb)
require 'spec_helper'
describe package('httpd') do
it { should be_installed }
end
describe service('httpd') do
it { should be_enabled }
it { should be_running }
end
describe port(80) do
it { should be_listening }
end
describe file('/var/www/html/hello.txt') do
it { should be_file }
it { should contain 'Hello, Chef' }
end
apache2のパッケージが
インストールされているか
のテスト (1件目)
13年6月15日土曜日
29. テストの記述
(httpd_spec.rb)
require 'spec_helper'
describe package('httpd') do
it { should be_installed }
end
describe service('httpd') do
it { should be_enabled }
it { should be_running }
end
describe port(80) do
it { should be_listening }
end
describe file('/var/www/html/hello.txt') do
it { should be_file }
it { should contain 'Hello, Chef' }
end
サービスの自動起動が
設定されていて、
実行中であるかのテスト
(2-3件目)
13年6月15日土曜日
30. テストの記述
(httpd_spec.rb)
require 'spec_helper'
describe package('httpd') do
it { should be_installed }
end
describe service('httpd') do
it { should be_enabled }
it { should be_running }
end
describe port(80) do
it { should be_listening }
end
describe file('/var/www/html/hello.txt') do
it { should be_file }
it { should contain 'Hello, Chef' }
end
80番が開いてるかの
テスト(4件目)
13年6月15日土曜日
31. テストの記述
(httpd_spec.rb)
require 'spec_helper'
describe package('httpd') do
it { should be_installed }
end
describe service('httpd') do
it { should be_enabled }
it { should be_running }
end
describe port(80) do
it { should be_listening }
end
describe file('/var/www/html/hello.txt') do
it { should be_file }
it { should contain 'Hello, Chef' }
end
txtが配置されていて、
内容が想定したものか
のテスト(5-6件目)
13年6月15日土曜日