Project

General

Profile

« Previous | Next » 

Revision 2a616445

Added by Justin Sherrill almost 10 years ago

Refs #5029 - specify inital org and location

View differences:

modules/foreman_proxy/spec/classes/foreman_proxy__config__spec.rb
:domain => 'example.org',
:ipaddress_eth0 => '127.0.1.1',
:operatingsystem => 'RedHat',
:operatingsystemrelease => '6',
:operatingsystemrelease => '6.5',
:osfamily => 'RedHat',
}
end
......
'/etc/foreman-proxy/settings.d/bmc.yml', '/etc/foreman-proxy/settings.d/realm.yml'].each do |cfile|
should contain_file(cfile).
with({
:owner => 'foreman-proxy',
:owner => 'root',
:group => 'foreman-proxy',
:mode => '0644',
:mode => '0640',
:require => 'Class[Foreman_proxy::Install]',
:notify => 'Class[Foreman_proxy::Service]',
})
......
':customrun_args: -ay -f -s',
':puppetssh_sudo: false',
':puppetssh_command: /usr/bin/puppet agent --onetime --no-usecacheonfailure',
':puppet_url: https://host.example.org:8140',
':puppet_ssl_ca: /var/lib/puppet/ssl/certs/ca.pem',
":puppet_ssl_cert: /var/lib/puppet/ssl/certs/#{facts[:fqdn]}.pem",
":puppet_ssl_key: /var/lib/puppet/ssl/private_keys/#{facts[:fqdn]}.pem",
]
end
......
:require => 'File[/etc/sudoers.d]',
})
end
context 'when operatingsystemrelease is 7.0.1406' do
let :facts do
{
:fqdn => 'host.example.org',
:domain => 'example.org',
:ipaddress_eth0 => '127.0.1.1',
:operatingsystem => 'CentOS',
:operatingsystemrelease => '7.0.1406',
:osfamily => 'RedHat',
}
end
it 'should not manage /etc/sudoers.d' do
should contain_file('/etc/sudoers.d').with_ensure('directory')
end
end
context 'when operatingsystemrelease is 5.10' do
let :facts do
{
:fqdn => 'host.example.org',
:domain => 'example.org',
:ipaddress_eth0 => '127.0.1.1',
:operatingsystem => 'RedHat',
:operatingsystemrelease => '5.10',
:osfamily => 'RedHat',
}
end
it 'should not manage /etc/sudoers.d' do
should_not contain_file('/etc/sudoers.d')
end
end
end
context 'with bmc' do
......
:fqdn => 'host.example.org',
:ipaddress => '127.0.1.2',
:operatingsystem => 'RedHat',
:operatingsystemrelease => '6',
:operatingsystemrelease => '6.5',
:osfamily => 'RedHat',
}
end
......
:fqdn => 'host.example.org',
:ipaddress => '127.0.1.2',
:operatingsystem => 'RedHat',
:operatingsystemrelease => '6',
:operatingsystemrelease => '6.5',
:osfamily => 'RedHat',
}
end
......
])
end
end
context 'when puppet_use_environment_api set' do
let :pre_condition do
'class {"foreman_proxy":
puppet_use_environment_api => false,
}'
end
it 'should set puppet_use_environment_api' do
verify_contents(subject, '/etc/foreman-proxy/settings.d/puppet.yml', [
':puppet_use_environment_api: false',
])
end
end
end

Also available in: Unified diff