diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb new file mode 100755 index 0000000..61ae0d9 --- /dev/null +++ b/spec/acceptance/basic_spec.rb @@ -0,0 +1,31 @@ +require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance' + +describe 'planet', if: os[:family] == 'ubuntu' do + + def pp_path + base_path = File.dirname(__FILE__) + File.join(base_path, 'fixtures') + end + + def puppet_manifest + manifest_path = File.join(pp_path, 'default.pp') + File.read(manifest_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('cd /var/lib/planet/openstack && planet /var/lib/planet/openstack/planet.ini') do + its(:exit_status) { should eq 0 } + end + + describe command('curl http://localhost') do + its(:stdout) { should contain('Planet OpenStack') } + end + +end diff --git a/spec/acceptance/fixtures/default.pp b/spec/acceptance/fixtures/default.pp new file mode 100644 index 0000000..5b16714 --- /dev/null +++ b/spec/acceptance/fixtures/default.pp @@ -0,0 +1,34 @@ +include ::planet + +planet::site { 'openstack': + git_url => 'git://git.openstack.org/openstack/openstack-planet', +} + +$planet_config = '[Planet] +name = Planet OpenStack +link = http://planet.openstack.org/ +owner_name = Monty Taylor +owner_email = mordred@inaugust.com +output_theme = classic_fancy +cache_directory = cache +output_dir = /srv/planet/openstack +feed_timeout = 20 +items_per_page = 60 +future_dates = ignore_date +log_level = DEBUG +bill_of_materials: + images/#{face} + +[DEFAULT] +facewidth = 85 +faceheight = 85 + +[http://www.openstack.org/blog/feed/] +name = OpenStack Blog +nick = openstack' + +file { '/var/lib/planet/openstack/planet.ini': + ensure => present, + content => $planet_config, + require => Vcsrepo['/var/lib/planet/openstack'], +}