diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb new file mode 100644 index 0000000..a29e237 --- /dev/null +++ b/spec/acceptance/basic_spec.rb @@ -0,0 +1,64 @@ +require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance' + +describe 'basic meetbot', :if => ['debian', 'ubuntu'].include?(os[:family]) do + def pp_path + base_path = File.dirname(__FILE__) + File.join(base_path, 'fixtures') + end + + def puppet_manifest + module_path = File.join(pp_path, 'default.pp') + File.read(module_path) + end + + it 'should work with no errors' do + apply_manifest(puppet_manifest, catch_failures: true) + end + + it 'should be idempotent' do + apply_manifest(puppet_manifest, catch_changes: true) + end + + describe command(" curl http://localhost") do + its(:stdout) { should contain('Welcome to Openstack IRC log server') } + end + + expected_vhost = < + ServerName eavesdrop.openstack.org + DocumentRoot /srv/meetbot-openstack + + ForceType text/plain + AddDefaultCharset UTF-8 + + + Options Indexes FollowSymLinks MultiViews + AllowOverride None + Order allow,deny + allow from all + = 2.4> + Require all granted + + + + + + Header set Access-Control-Allow-Origin "*" + + + + ErrorLog /var/log/apache2/eavesdrop.openstack.org_error.log + LogLevel warn + CustomLog /var/log/apache2/eavesdrop.openstack.org_access.log combined + ServerSignature Off + +EOF + describe file('/etc/apache2/sites-enabled/50-eavesdrop.openstack.org.conf') do + its(:content) { should eq expected_vhost } + end +end diff --git a/spec/acceptance/fixtures/default.pp b/spec/acceptance/fixtures/default.pp new file mode 100644 index 0000000..0c49cb5 --- /dev/null +++ b/spec/acceptance/fixtures/default.pp @@ -0,0 +1,22 @@ +include httpd +httpd::mod { 'headers': + ensure => present, +} + +include meetbot +$vhost_extra = ' + + Header set Access-Control-Allow-Origin "*" + +' +meetbot::site { 'openstack': + nick => 'openstack', + nickpass => 'nickpass', + network => 'FreeNode', + server => 'chat.freenode.net:7000', + use_ssl => 'True', + vhost_extra => $vhost_extra, + vhost_name => 'eavesdrop.openstack.org', + manage_index => true, + channels => ['#one', '#two', '#three'], +}