diff --git a/Gemfile b/Gemfile index f61c3b3..a16e242 100644 --- a/Gemfile +++ b/Gemfile @@ -30,6 +30,9 @@ end group :system_tests do gem 'beaker-rspec', :require => false + # Workaround for fog-google requiring ruby 2.0 on latest version + # https://github.com/fog/fog-google/commit/a66b16fa7c2373f9c8be2e80bc942ad8d13ece3f + gem 'fog-google', '0.1.0' end # vim:ft=ruby diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb index 6534a94..5a95062 100644 --- a/spec/acceptance/basic_spec.rb +++ b/spec/acceptance/basic_spec.rb @@ -7,8 +7,8 @@ describe 'basic gerrit' do File.join(base_path, 'fixtures') end - def ssh_keygen_puppet_module - module_path = File.join(pp_path, 'ssh_keygen.pp') + def preconditions_puppet_module + module_path = File.join(pp_path, 'preconditions.pp') File.read(module_path) end @@ -18,7 +18,7 @@ describe 'basic gerrit' do end before(:all) do - apply_manifest(ssh_keygen_puppet_module, catch_failures: true) + apply_manifest(preconditions_puppet_module, catch_failures: true) end it 'should work with no errors' do diff --git a/spec/acceptance/fixtures/default.pp b/spec/acceptance/fixtures/default.pp index 0c398e1..32d9821 100644 --- a/spec/acceptance/fixtures/default.pp +++ b/spec/acceptance/fixtures/default.pp @@ -1,18 +1,3 @@ -# workaround since ssl-cert group is not being installed as part of -# this module -package { 'ssl-cert': - ensure => present, -} - -exec { 'ensure ssl-cert exists': - command => '/usr/sbin/groupadd -f ssl-cert' -} - -# workaround since pip is not being installed as part of this module -package { 'python-pip': - ensure => present, -} - class { '::gerrit::mysql': mysql_root_password => 'UNSET', database_name => 'reviewdb', diff --git a/spec/acceptance/fixtures/ssh_keygen.pp b/spec/acceptance/fixtures/preconditions.pp similarity index 50% rename from spec/acceptance/fixtures/ssh_keygen.pp rename to spec/acceptance/fixtures/preconditions.pp index 12e129f..e5dbe3e 100644 --- a/spec/acceptance/fixtures/ssh_keygen.pp +++ b/spec/acceptance/fixtures/preconditions.pp @@ -1,3 +1,8 @@ +# Installing ssl-cert in order to get snakeoil certs +package { 'ssl-cert': + ensure => present, +} + # method to create ssh directory define create_ssh_key_directory() { Exec { path => '/bin:/usr/bin' } @@ -21,7 +26,19 @@ define ssh_keygen ( } $ssh_key_directory = '/tmp/gerrit-ssh-keys' -create_ssh_key_directory { $ssh_key_directory: } -ssh_keygen {'ssh_rsa_key': ssh_directory => $ssh_key_directory } -ssh_keygen {'ssh_project_rsa_key': ssh_directory => $ssh_key_directory } -ssh_keygen {'ssh_replication_rsa_key': ssh_directory => $ssh_key_directory } +file { $ssh_key_directory: + ensure => directory, +} + +ssh_keygen {'ssh_rsa_key': + ssh_directory => $ssh_key_directory, + require => File[$ssh_key_directory], +} +ssh_keygen {'ssh_project_rsa_key': + ssh_directory => $ssh_key_directory, + require => File[$ssh_key_directory], +} +ssh_keygen {'ssh_replication_rsa_key': + ssh_directory => $ssh_key_directory, + require => File[$ssh_key_directory], +}