Add basic rspec test

Add a basic deployment test

Change-Id: I3ebec9b0c82a228f9d3a4e3d865ca44a233ec83e
This commit is contained in:
Ian Wienand 2017-12-15 10:51:49 +11:00
parent 5aae261ebf
commit 1537611f56
4 changed files with 54 additions and 0 deletions

View File

@ -78,6 +78,12 @@ class etherpad_lite (
anchor { 'nodejs-anchor': }
if !defined(Package['git']) {
package { 'git':
ensure => present
}
}
vcsrepo { "${base_install_dir}/etherpad-lite":
ensure => $ep_ensure,
provider => git,

View File

@ -0,0 +1,27 @@
require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance'
describe 'puppet-etherpad_lite:: manifest', :if => ['debian', 'ubuntu'].include?(os[:family]) do
def pp_path
base_path = File.dirname(__FILE__)
File.join(base_path, 'fixtures')
end
def preconditions_puppet_module
module_path = File.join(pp_path, 'preconditions.pp')
File.read(module_path)
end
before(:all) do
apply_manifest(preconditions_puppet_module, catch_failures: true)
end
def init_puppet_module
module_path = File.join(pp_path, 'etherpad_lite.pp')
File.read(module_path)
end
it 'should work with no errors' do
apply_manifest(init_puppet_module, catch_failures: true)
end
end

View File

@ -0,0 +1,17 @@
class { '::etherpad_lite':
ep_ensure => 'latest',
eplite_version => 'cc9f88e7ed4858b72feb64c99beb3e13445ab6d9',
nodejs_version => 'system',
}
class { '::etherpad_lite::apache':
ssl_cert_file_contents => file('/etc/ssl/certs/ssl-cert-snakeoil.pem'),
ssl_cert_file => '/etc/pki/tls/certs/localhost.pem',
ssl_key_file_contents => file('/etc/ssl/private/ssl-cert-snakeoil.key'),
ssl_key_file => '/etc/pki/tls/private/localhost.key',
}
class { '::etherpad_lite::site':
database_password => 'fake_password',
etherpad_title => 'A fake title',
}

View File

@ -0,0 +1,4 @@
# Installing ssl-cert in order to get snakeoil certs
package { 'ssl-cert':
ensure => present,
}