
Add acceptance tests for puppet-cgit module so that once the module is applied we check if files were created, packages were installed and services were started. Co-Authored-By: Bruno Tavares <btavare@thoughtworks.com> Co-Authored-By: Danilo Ramalho <dramalho@thoughtworks.com> Change-Id: I8d12999b6d91f1ab67fa16d6bbd8bc1d2efa3a05
104 lines
2.7 KiB
Ruby
104 lines
2.7 KiB
Ruby
require 'spec_helper_acceptance'
|
|
|
|
describe 'cgit server', :if => ['fedora', 'redhat'].include?(os[:family]) do
|
|
describe 'running web server' do
|
|
describe command('curl http://localhost/cgit') do
|
|
its(:stdout) { should match 'OpenStack git repository browser' }
|
|
end
|
|
|
|
describe command('curl --insecure https://localhost/cgit') do
|
|
its(:stdout) { should match 'OpenStack git repository browser' }
|
|
end
|
|
|
|
describe port(80) do
|
|
it { should be_listening }
|
|
end
|
|
|
|
describe port(443) do
|
|
it { should be_listening }
|
|
end
|
|
|
|
describe port(9418) do
|
|
it { should be_listening }
|
|
end
|
|
|
|
describe service('httpd') do
|
|
it { should be_enabled }
|
|
it { should be_running }
|
|
end
|
|
end
|
|
|
|
describe service('git-daemon.socket'), :if => ['fedora', 'redhat'].include?(os[:family]) && os[:release] >= '7' do
|
|
it { should be_enabled }
|
|
it { should be_running }
|
|
end
|
|
|
|
describe service('git-daemon'), :if => ['fedora', 'redhat'].include?(os[:family]) && os[:release] < '7' do
|
|
it { should be_enabled }
|
|
it { should be_running }
|
|
end
|
|
end
|
|
|
|
describe 'cgit server behind proxy', :if => ['fedora', 'redhat'].include?(os[:family]) do
|
|
before(:all) do
|
|
behind_proxy_manifest = File.join(File.dirname(__FILE__), 'fixtures', 'behindproxy.pp')
|
|
apply_manifest(File.read(behind_proxy_manifest), catch_failures: true)
|
|
end
|
|
|
|
describe 'running web server' do
|
|
describe command('curl http://localhost:8080/cgit') do
|
|
its(:stdout) { should match 'OpenStack git repository browser' }
|
|
end
|
|
|
|
describe command('curl --insecure https://localhost:4443/cgit') do
|
|
its(:stdout) { should match 'OpenStack git repository browser' }
|
|
end
|
|
|
|
describe port(8080) do
|
|
it { should be_listening }
|
|
end
|
|
|
|
describe port(4443) do
|
|
it { should be_listening }
|
|
end
|
|
|
|
describe port(29418) do
|
|
it { should be_listening }
|
|
end
|
|
|
|
describe service('httpd') do
|
|
it { should be_enabled }
|
|
it { should be_running }
|
|
end
|
|
end
|
|
|
|
describe service('git-daemon.socket'), :if => ['fedora', 'redhat'].include?(os[:family]) && os[:release] >= '7' do
|
|
it { should be_enabled }
|
|
it { should be_running }
|
|
end
|
|
|
|
describe service('git-daemon'), :if => ['fedora', 'redhat'].include?(os[:family]) && os[:release] < '7' do
|
|
it { should be_enabled }
|
|
it { should be_running }
|
|
end
|
|
end
|
|
|
|
describe 'cgit loadbalancer', :if => ['debian', 'ubuntu'].include?(os[:family]) do
|
|
describe port(80) do
|
|
it { should be_listening }
|
|
end
|
|
|
|
describe port(443) do
|
|
it { should be_listening }
|
|
end
|
|
|
|
describe port(9418) do
|
|
it { should be_listening }
|
|
end
|
|
|
|
describe service('haproxy') do
|
|
it { should be_enabled }
|
|
it { should be_running }
|
|
end
|
|
end
|