Commit 26e7cd1e authored by Fabien Combernous's avatar Fabien Combernous

Merge branch '33-correct-ruby-syntax-with-ruby-version-2-5-1-and-executor-tags' into 'master'

Resolve "Correct Ruby syntax with ruby version 2.5.1 and executor tags"

Closes #33

See merge request adullact/puppet-freeipa!34
parents 18686203 d59ce8bb
......@@ -16,38 +16,27 @@ before_script:
- bundle -v
- bundle install --without system_tests --path vendor/bundle --jobs $(nproc)
syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.4.4-Puppet ~> 5.5:
syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.5.1-Puppet ~> 5.5:
stage: syntax
image: ruby:2.5.1
script:
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
variables:
PUPPET_GEM_VERSION: '~> 5.5'
RBENV_VERSION: '2.4.4'
tags:
- puppet-tests
- fast
- executor-docker
parallel_spec-Ruby 2.1.9-Puppet ~> 4.0:
stage: unit
script:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 4.0'
RBENV_VERSION: '2.4.4'
tags:
- puppet-tests
- fast
parallel_spec-Ruby 2.4.4-Puppet ~> 5.5:
parallel_spec-Ruby 2.5.1-Puppet ~> 5.5:
stage: unit
image: ruby:2.5.1
script:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 5.5'
RBENV_VERSION: '2.5.1'
tags:
- puppet-tests
- fast
- executor-docker
acceptance with puppet5:
stage: acceptance
......@@ -61,6 +50,7 @@ acceptance with puppet5:
- bundle exec rake beaker:default
tags:
- puppet-tests
- executor-shell
- fast
except:
- master
......@@ -18,7 +18,7 @@ AllCops:
- "**/Guardfile"
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
Max: 300
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
......
# frozen_string_literal: true
require 'spec_helper_acceptance'
describe 'freeipa class' do
......@@ -22,7 +24,7 @@ describe 'freeipa class' do
install_epel => true,
webui_disable_kerberos => true,
webui_enable_proxy => true,
webui_force_https => true,
webui_force_https => true
}
EOS
......@@ -54,12 +56,12 @@ describe 'freeipa class' do
enable_hostname => true,
manage_host_entry => true,
install_epel => true,
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan',
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan'
}
EOS
apply_manifest_on(replica, pp, :catch_failures => true, :debug => true)
apply_manifest_on(replica, pp, :catch_changes => true, :debug => true)
apply_manifest_on(replica, pp, catch_failures: true, debug: true)
apply_manifest_on(replica, pp, catch_changes: true, debug: true)
end
describe command('ipactl status') do
......@@ -68,7 +70,7 @@ describe 'freeipa class' do
end
end
end
### Test Install Client
context 'when clients' do
context 'with default parameters' do
......@@ -80,7 +82,7 @@ describe 'freeipa class' do
domain => 'vagrant.example.lan',
domain_join_password => 'vagrant123',
install_epel => true,
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan',
ipa_master_fqdn => 'ipa-server-1.vagrant.example.lan'
}
EOS
......@@ -109,21 +111,21 @@ describe 'freeipa class' do
end
it 'adds the public key in freeipa to toto' do
on(master, "key=`cat /root/.ssh/id_rsa.pub`; ipa user-mod toto --sshpubkey=\"$key\"")
on(master, 'key=`cat /root/.ssh/id_rsa.pub`; ipa user-mod toto --sshpubkey=\"$key\"')
end
# Add HBAC Rule to give all ipa users access to ipa-client-centos
it 'creates a HBAC rule for all users' do
on(master, "ipa hbacrule-add --usercat=all --servicecat=all allGroup")
on(master, 'ipa hbacrule-add --usercat=all --servicecat=all allGroup')
end
it 'adds centos client to allGroup rule' do
on(master, "ipa hbacrule-add-host --hosts=ipa-client-centos allGroup")
on(master, 'ipa hbacrule-add-host --hosts=ipa-client-centos allGroup')
end
# Remove allow_all HBAC
it 'deletes the allow_all default rule' do
on(master, "ipa hbacrule-del allow_all")
on(master, 'ipa hbacrule-del allow_all')
end
it 'test ssh on allowed host with returns' do
......@@ -131,7 +133,7 @@ describe 'freeipa class' do
exec { 'test ssh':
path => '/bin/',
command => 'ssh -o "StrictHostKeyChecking no" toto@192.168.44.37 id',
returns => "0",
returns => "0"
}
EOS
......@@ -143,7 +145,7 @@ describe 'freeipa class' do
exec { 'test ssh':
path => '/bin/',
command => 'ssh -o "StrictHostKeyChecking no" toto@localhost id',
returns => "255",
returns => "255"
}
EOS
......
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa::config::admin_user' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:pre_condition) { 'class{"freeipa": ipa_role => "master", ipa_master_fqdn => "master.example.com", ipa_server_fqdn => "foo.example.com", domain_join_password => "foobartest", admin_password => "foobartest", directory_services_password => "foobartest"}' }
let(:pre_condition) do
manifest = <<-EOS
class{ 'freeipa' :
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
}
EOS
manifest
end
let(:facts) { os_facts }
it { is_expected.to compile }
......
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa::config::webui' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:pre_condition) { 'class{"freeipa": ipa_role => "master", ipa_master_fqdn => "master.example.com", ipa_server_fqdn => "foo.example.com", domain_join_password => "foobartest", admin_password => "foobartest", directory_services_password => "foobartest"}' }
let(:pre_condition) do
manifest = <<-EOS
class{ 'freeipa' :
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
}
EOS
manifest
end
let(:facts) { os_facts }
it { is_expected.to compile }
......
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa::config' do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa' do
......@@ -8,11 +10,11 @@ describe 'freeipa' do
{
ipa_role: 'client',
ipa_master_fqdn: 'foo.example.com',
domain_join_password: 'foobartest',
domain_join_password: 'foobartest'
}
end
it { is_expected.to compile }
end
end
end
This diff is collapsed.
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa::install::autofs' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:pre_condition) do
'class{"freeipa": ipa_role => "client", ipa_master_fqdn => "foo.example.com", domain_join_password => "foobartest"}'
manifest = <<-EOS
class{ 'freeipa' :
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
}
EOS
manifest
end
let(:facts) { os_facts }
......
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa::install::client' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:pre_condition) do
'class{"freeipa": ipa_role => "client", ipa_master_fqdn => "foo.example.com", domain_join_password => "foobartest", install_ipa_client => true, install_ipa_server => false}'
manifest = <<-EOS
class{'freeipa':
ipa_role => 'client',
ipa_master_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
install_ipa_client => true,
install_ipa_server => false
}
EOS
manifest
end
let(:facts) { os_facts }
......
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa::install::server::master' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:pre_condition) { 'class{"freeipa": ipa_role => "master", ipa_master_fqdn => "master.example.com", ipa_server_fqdn => "foo.example.com", domain_join_password => "foobartest", admin_password => "foobartest", directory_services_password => "foobartest"}' }
let(:pre_condition) do
manifest = <<-EOS
class{ 'freeipa' :
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
}
EOS
manifest
end
let(:facts) { os_facts }
it { is_expected.to compile }
......
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa::install::server::replica' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:pre_condition) { 'class{"freeipa": ipa_role => "replica", ipa_master_fqdn => "master.example.com", ipa_server_fqdn => "foo.example.com", domain_join_password => "foobartest", admin_password => "foobartest", directory_services_password => "foobartest"}' }
let(:pre_condition) do
manifest = <<-EOS
class{ 'freeipa' :
ipa_role => 'replica',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
}
EOS
manifest
end
let(:facts) { os_facts }
it { is_expected.to compile }
......
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa::install::server' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:pre_condition) do
'class{"freeipa": ipa_role => "master", ipa_master_fqdn => "foo.example.com", domain_join_password => "foobartest", admin_password => "foobartest", directory_services_password => "foobartest", install_ipa_client => false, install_ipa_server => true}'
manifest = <<-EOS
class{ 'freeipa' :
ipa_role => 'replica',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
}
EOS
manifest
end
let(:facts) { os_facts }
......
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa::install::sssd' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:pre_condition) do
'class{"freeipa": ipa_role => "client", ipa_master_fqdn => "foo.example.com", domain_join_password => "foobartest"}'
manifest = <<-EOS
class{ 'freeipa' :
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
}
EOS
manifest
end
let(:facts) { os_facts }
it { is_expected.to compile }
......
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa::install' do
......@@ -5,8 +7,19 @@ describe 'freeipa::install' do
context "on #{os}" do
let(:facts) { os_facts }
let(:pre_condition) do
'class{"freeipa": ipa_role => "client", ipa_master_fqdn => "foo.example.com", domain_join_password => "foobartest"}'
end
manifest = <<-EOS
class{ 'freeipa' :
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
}
EOS
manifest
end
it { is_expected.to compile }
end
end
......
require 'spec_helper'
describe 'freeipa::validate_params' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
let(:pre_condition) do
'class{"freeipa": ipa_role => "client", ipa_master_fqdn => "foo.example.com", domain_join_password => "foobartest"}'
end
it { is_expected.to compile }
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe 'freeipa::helpers::flushcache' do
let(:pre_condition) { 'class{"::freeipa": ipa_role => "client", ipa_master_fqdn => "foo.example.com", domain_join_password => "foobartest"}' }
let(:pre_condition) do
manifest = <<-EOS
class{ 'freeipa' :
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
}
EOS
manifest
end
let(:title) { 'namevar' }
let(:params) do
{}
......
# frozen_string_literal: true
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
......@@ -11,7 +13,7 @@ include RspecPuppetFacts
default_facts = {
puppetversion: Puppet.version,
facterversion: Facter.version,
facterversion: Facter.version
}
default_facts_path = File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml'))
......
# frozen_string_literal: true
require 'beaker-rspec'
require 'beaker-puppet'
require 'beaker/puppet_install_helper'
......@@ -13,7 +15,7 @@ install_module_on(hosts)
#
# By this way, users of puppet-freeipa can use puppetlabs-stdlibs version > 5.0.0.
# and acceptance tests can use puppetlabs-stdlibs version < 5.0.0
#install_module_dependencies_on(hosts)
# install_module_dependencies_on(hosts)
RSpec.configure do |c|
# Configure all nodes in nodeset
......@@ -40,7 +42,6 @@ RSpec.configure do |c|
}
EOS
apply_manifest_on(host, yumipv4, catch_failures: true) if fact('os.family') == 'RedHat'
end
## Preconfigure master
......@@ -71,7 +72,7 @@ RSpec.configure do |c|
}
EOS
apply_manifest_on(replica, pp, :catch_failures => true, :debug => true)
apply_manifest_on(replica, pp, catch_failures: true, debug: true)
end
## Preconfigure client
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment