Commit 7d573043 authored by Scott Barthelemy's avatar Scott Barthelemy

Update spec.rb files to use the new datatypes

parent f69c5df5
......@@ -11,9 +11,11 @@ describe 'freeipa::config::admin_user' do
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
domain => 'vagrant.lan',
password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
ip_address => '192.168.44.35',
}
EOS
manifest
......
......@@ -11,9 +11,11 @@ describe 'freeipa::config::webui' do
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
domain => 'vagrant.lan',
password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
ip_address => '192.168.44.35',
}
EOS
manifest
......
......@@ -10,7 +10,11 @@ describe 'freeipa' do
{
ipa_role: 'client',
ipa_master_fqdn: 'foo.example.com',
domain_join_password: 'foobartest'
domain: 'vagrant.lan',
password_usedto_joindomain: 'foobartest',
admin_password: 'vagrant123',
directory_services_password: 'vagrant123',
ip_address: '192.168.44.35'
}
end
......
......@@ -9,17 +9,6 @@ describe 'freeipa', type: :class do
if facts[:os]['family'] == 'RedHat'
context 'on Centos' do
context 'as bad_val role' do
let :params do
{
ipa_role: 'bad_val',
domain: 'rspec.example.lan'
}
end
it { is_expected.to raise_error(Puppet::Error, %r{parameter ipa_role must be}) }
end
context 'as master' do
context 'with defaults' do
let :params do
......@@ -27,7 +16,9 @@ describe 'freeipa', type: :class do
ipa_role: 'master',
domain: 'rspec.example.lan',
admin_password: 'rspecrspec123',
directory_services_password: 'rspecrspec123'
directory_services_password: 'rspecrspec123',
ip_address: '192.168.44.35',
ipa_master_fqdn: 'master.rspec.example.lan',
}
end
......@@ -36,7 +27,6 @@ describe 'freeipa', type: :class do
it { is_expected.to contain_class('freeipa::install::sssd') }
it { is_expected.to contain_class('freeipa::install::server::master') }
it { is_expected.to contain_class('freeipa::config::webui') }
it { is_expected.to contain_class('freeipa::validate_params') }
it { is_expected.not_to contain_class('freeipa::install::autofs') }
it { is_expected.not_to contain_class('freeipa::install::server::replica') }
......@@ -53,68 +43,19 @@ describe 'freeipa', type: :class do
it { is_expected.to compile.with_all_deps }
end
context 'with idstart out of range' do
let :params do
{
ipa_role: 'master',
domain: 'rspec.example.lan',
admin_password: 'rspecrspec123',
directory_services_password: 'rspecrspec123',
idstart: 100
}
end
it { is_expected.to raise_error(Puppet::Error, %r{an integer greater than 10000}) }
end
context 'with manage_host_entry but not ip_address' do
let :params do
{
ipa_role: 'master',
domain: 'rspec.example.lan',
admin_password: 'rspecrspec123',
directory_services_password: 'rspecrspec123',
manage_host_entry: true
}
end
it { is_expected.to raise_error(Puppet::Error, %r{parameter ip_address is mandatory}) }
end
context 'without admin_password' do
let :params do
{
ipa_role: 'master',
domain: 'rspec.example.lan',
directory_services_password: 'rspecrspec123'
}
end
it { is_expected.to raise_error(Puppet::Error, %r{populated and at least of length 8}) }
end
context 'without directory_services_password' do
let :params do
{
ipa_role: 'master',
domain: 'rspec.example.lan',
admin_password: 'rspecrspec123'
}
end
it { is_expected.to raise_error(Puppet::Error, %r{populated and at least of length 8}) }
end
end
context 'as replica' do
context 'with defaults' do
let :params do
{
ipa_role: 'replica',
domain: 'rspec.example.lan',
ipa_master_fqdn: 'ipa-server-1.rspec.example.lan',
domain_join_password: 'rspecrspec123'
ipa_role: 'replica',
domain: 'rspec.example.lan',
admin_password: 'rspecrspec123',
directory_services_password: 'rspecrspec123',
ip_address: '192.168.44.36',
ipa_master_fqdn: 'replica.rspec.example.lan',
password_usedto_joindomain: 'rspecrspec123',
}
end
......@@ -123,7 +64,6 @@ describe 'freeipa', type: :class do
it { is_expected.to contain_class('freeipa::install::sssd') }
it { is_expected.to contain_class('freeipa::install::server::replica') }
it { is_expected.to contain_class('freeipa::config::webui') }
it { is_expected.to contain_class('freeipa::validate_params') }
it { is_expected.not_to contain_class('freeipa::install::autofs') }
it { is_expected.not_to contain_class('freeipa::install::server::master') }
......@@ -140,30 +80,6 @@ describe 'freeipa', type: :class do
it { is_expected.to compile.with_all_deps }
end
context 'missing ipa_master_fqdn' do
let :params do
{
ipa_role: 'replica',
domain: 'rspec.example.lan',
domain_join_password: 'rspecrspec123'
}
end
it { is_expected.to raise_error(Puppet::Error, %r{parameter named ipa_master_fqdn must be set}) }
end
context 'missing domain_join_password' do
let :params do
{
ipa_role: 'replica',
domain: 'rspec.example.lan',
ipa_master_fqdn: 'ipa-server-1.rspec.example.lan'
}
end
it { is_expected.to raise_error(Puppet::Error, %r{domain_join_password cannot be empty}) }
end
end
end
end
......@@ -172,17 +88,19 @@ describe 'freeipa', type: :class do
context 'with defaults' do
let :params do
{
ipa_role: 'client',
domain: 'rspec.example.lan',
ipa_master_fqdn: 'ipa-server-1.rspec.example.lan',
domain_join_password: 'rspecrspec123'
ipa_role: 'client',
domain: 'rspec.example.lan',
admin_password: 'rspecrspec123',
directory_services_password: 'rspecrspec123',
ip_address: '192.168.44.36',
ipa_master_fqdn: 'client.rspec.example.lan',
password_usedto_joindomain: 'rspecrspec123',
}
end
it { is_expected.to contain_class('freeipa::install') }
it { is_expected.to contain_class('freeipa::install::sssd') }
it { is_expected.to contain_class('freeipa::install::client') }
it { is_expected.to contain_class('freeipa::validate_params') }
it { is_expected.not_to contain_class('freeipa::install::autofs') }
it { is_expected.not_to contain_class('freeipa::install::server') }
......@@ -207,30 +125,6 @@ describe 'freeipa', type: :class do
it { is_expected.to compile.with_all_deps }
end
context 'missing ipa_master_fqdn' do
let :params do
{
ipa_role: 'client',
domain: 'rspec.example.lan',
domain_join_password: 'rspecrspec123'
}
end
it { is_expected.to raise_error(Puppet::Error, %r{parameter named ipa_master_fqdn must be set}) }
end
context 'missing domain_join_password' do
let :params do
{
ipa_role: 'client',
domain: 'rspec.example.lan',
ipa_master_fqdn: 'ipa-server-1.rspec.example.lan'
}
end
it { is_expected.to raise_error(Puppet::Error, %r{domain_join_password cannot be empty}) }
end
end
end
end
......
......@@ -5,20 +5,22 @@ require 'spec_helper'
describe 'freeipa::install::autofs' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
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',
domain => 'vagrant.lan',
password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
ip_address => '192.168.44.35',
}
EOS
manifest
end
let(:facts) { os_facts }
it { is_expected.to compile }
end
......
......@@ -5,19 +5,22 @@ require 'spec_helper'
describe 'freeipa::install::client' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
let(:pre_condition) do
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
class{ 'freeipa' :
ipa_role => 'client',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain => 'vagrant.lan',
password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
ip_address => '192.168.44.35',
}
EOS
manifest
end
let(:facts) { os_facts }
it { is_expected.to compile }
end
......
......@@ -11,14 +11,15 @@ describe 'freeipa::install::server::master' do
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
domain => 'vagrant.lan',
password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
ip_address => '192.168.44.35',
}
EOS
manifest
end
let(:facts) { os_facts }
it { is_expected.to compile }
......
......@@ -11,9 +11,11 @@ describe 'freeipa::install::server::replica' do
ipa_role => 'replica',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
domain => 'vagrant.lan',
password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
ip_address => '192.168.44.35',
}
EOS
manifest
......
......@@ -5,20 +5,22 @@ require 'spec_helper'
describe 'freeipa::install::server' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
let(:pre_condition) do
manifest = <<-EOS
class{ 'freeipa' :
ipa_role => 'replica',
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
domain => 'vagrant.lan',
password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
ip_address => '192.168.44.35',
}
EOS
manifest
end
let(:facts) { os_facts }
it { is_expected.to compile }
end
......
......@@ -5,22 +5,23 @@ require 'spec_helper'
describe 'freeipa::install::sssd' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
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',
domain => 'vagrant.lan',
password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
ip_address => '192.168.44.35',
}
EOS
manifest
end
let(:facts) { os_facts }
it { is_expected.to compile }
end
end
......
......@@ -12,9 +12,11 @@ describe 'freeipa::install' do
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
domain => 'vagrant.lan',
password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
ip_address => '192.168.44.35',
}
EOS
manifest
......
......@@ -9,9 +9,11 @@ describe 'freeipa::helpers::flushcache' do
ipa_role => 'master',
ipa_master_fqdn => 'master.example.com',
ipa_server_fqdn => 'foo.example.com',
domain_join_password => 'foobartest',
domain => 'vagrant.lan',
password_usedto_joindomain => 'foobartest',
admin_password => 'foobartest',
directory_services_password => 'foobartest',
ip_address => '192.168.44.35',
}
EOS
manifest
......
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