Update to work with new version of rspec-puppet
This commit is contained in:
parent
388ba4d147
commit
8ed84f7e18
@ -9,9 +9,12 @@ describe 'ssh' do
|
|||||||
:sshrsakey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEArGElx46pD6NNnlxVaTbp0ZJMgBKCmbTCT3RaeCk0ZUJtQ8wkcwTtqIXmmiuFsynUT0DFSd8UIodnBOPqitimmooAVAiAi30TtJVzADfPScMiUnBJKZajIBkEMkwUcqsfh630jyBvLPE/kyQcxbEeGtbu1DG3monkeymanOBW1AKc5o+cJLXcInLnbowMG7NXzujT3BRYn/9s5vtT1V9cuZJs4XLRXQ50NluxJI7sVfRPVvQI9EMbTS4AFBXUej3yfgaLSV+nPZC/lmJ2gR4t/tKvMFF9m16f8IcZKK7o0rK7v81G/tREbOT5YhcKLK+0wBfR6RsmHzwy4EddZloyLQ=='
|
:sshrsakey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEArGElx46pD6NNnlxVaTbp0ZJMgBKCmbTCT3RaeCk0ZUJtQ8wkcwTtqIXmmiuFsynUT0DFSd8UIodnBOPqitimmooAVAiAi30TtJVzADfPScMiUnBJKZajIBkEMkwUcqsfh630jyBvLPE/kyQcxbEeGtbu1DG3monkeymanOBW1AKc5o+cJLXcInLnbowMG7NXzujT3BRYn/9s5vtT1V9cuZJs4XLRXQ50NluxJI7sVfRPVvQI9EMbTS4AFBXUej3yfgaLSV+nPZC/lmJ2gR4t/tKvMFF9m16f8IcZKK7o0rK7v81G/tREbOT5YhcKLK+0wBfR6RsmHzwy4EddZloyLQ=='
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { should include_class('ssh')}
|
|
||||||
|
|
||||||
it { should_not include_class('common')}
|
it { should compile.with_all_deps }
|
||||||
|
|
||||||
|
it { should contain_class('ssh')}
|
||||||
|
|
||||||
|
it { should_not contain_class('common')}
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_package('ssh_packages').with({
|
should contain_package('ssh_packages').with({
|
||||||
@ -91,9 +94,11 @@ describe 'ssh' do
|
|||||||
:sshrsakey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEArGElx46pD6NNnlxVaTbp0ZJMgBKCmbTCT3RaeCk0ZUJtQ8wkcwTtqIXmmiuFsynUT0DFSd8UIodnBOPqitimmooAVAiAi30TtJVzADfPScMiUnBJKZajIBkEMkwUcqsfh630jyBvLPE/kyQcxbEeGtbu1DG3monkeymanOBW1AKc5o+cJLXcInLnbowMG7NXzujT3BRYn/9s5vtT1V9cuZJs4XLRXQ50NluxJI7sVfRPVvQI9EMbTS4AFBXUej3yfgaLSV+nPZC/lmJ2gR4t/tKvMFF9m16f8IcZKK7o0rK7v81G/tREbOT5YhcKLK+0wBfR6RsmHzwy4EddZloyLQ=='
|
:sshrsakey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEArGElx46pD6NNnlxVaTbp0ZJMgBKCmbTCT3RaeCk0ZUJtQ8wkcwTtqIXmmiuFsynUT0DFSd8UIodnBOPqitimmooAVAiAi30TtJVzADfPScMiUnBJKZajIBkEMkwUcqsfh630jyBvLPE/kyQcxbEeGtbu1DG3monkeymanOBW1AKc5o+cJLXcInLnbowMG7NXzujT3BRYn/9s5vtT1V9cuZJs4XLRXQ50NluxJI7sVfRPVvQI9EMbTS4AFBXUej3yfgaLSV+nPZC/lmJ2gR4t/tKvMFF9m16f8IcZKK7o0rK7v81G/tREbOT5YhcKLK+0wBfR6RsmHzwy4EddZloyLQ=='
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { should include_class('ssh')}
|
it { should compile.with_all_deps }
|
||||||
|
|
||||||
it { should_not include_class('common')}
|
it { should contain_class('ssh')}
|
||||||
|
|
||||||
|
it { should_not contain_class('common')}
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_package('ssh_packages').with({
|
should contain_package('ssh_packages').with({
|
||||||
@ -174,9 +179,11 @@ describe 'ssh' do
|
|||||||
:sshrsakey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEArGElx46pD6NNnlxVaTbp0ZJMgBKCmbTCT3RaeCk0ZUJtQ8wkcwTtqIXmmiuFsynUT0DFSd8UIodnBOPqitimmooAVAiAi30TtJVzADfPScMiUnBJKZajIBkEMkwUcqsfh630jyBvLPE/kyQcxbEeGtbu1DG3monkeymanOBW1AKc5o+cJLXcInLnbowMG7NXzujT3BRYn/9s5vtT1V9cuZJs4XLRXQ50NluxJI7sVfRPVvQI9EMbTS4AFBXUej3yfgaLSV+nPZC/lmJ2gR4t/tKvMFF9m16f8IcZKK7o0rK7v81G/tREbOT5YhcKLK+0wBfR6RsmHzwy4EddZloyLQ=='
|
:sshrsakey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEArGElx46pD6NNnlxVaTbp0ZJMgBKCmbTCT3RaeCk0ZUJtQ8wkcwTtqIXmmiuFsynUT0DFSd8UIodnBOPqitimmooAVAiAi30TtJVzADfPScMiUnBJKZajIBkEMkwUcqsfh630jyBvLPE/kyQcxbEeGtbu1DG3monkeymanOBW1AKc5o+cJLXcInLnbowMG7NXzujT3BRYn/9s5vtT1V9cuZJs4XLRXQ50NluxJI7sVfRPVvQI9EMbTS4AFBXUej3yfgaLSV+nPZC/lmJ2gR4t/tKvMFF9m16f8IcZKK7o0rK7v81G/tREbOT5YhcKLK+0wBfR6RsmHzwy4EddZloyLQ=='
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { should include_class('ssh')}
|
it { should compile.with_all_deps }
|
||||||
|
|
||||||
it { should_not include_class('common')}
|
it { should contain_class('ssh')}
|
||||||
|
|
||||||
|
it { should_not contain_class('common')}
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_package('ssh_packages').with({
|
should contain_package('ssh_packages').with({
|
||||||
@ -257,9 +264,11 @@ describe 'ssh' do
|
|||||||
:sshrsakey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEArGElx46pD6NNnlxVaTbp0ZJMgBKCmbTCT3RaeCk0ZUJtQ8wkcwTtqIXmmiuFsynUT0DFSd8UIodnBOPqitimmooAVAiAi30TtJVzADfPScMiUnBJKZajIBkEMkwUcqsfh630jyBvLPE/kyQcxbEeGtbu1DG3monkeymanOBW1AKc5o+cJLXcInLnbowMG7NXzujT3BRYn/9s5vtT1V9cuZJs4XLRXQ50NluxJI7sVfRPVvQI9EMbTS4AFBXUej3yfgaLSV+nPZC/lmJ2gR4t/tKvMFF9m16f8IcZKK7o0rK7v81G/tREbOT5YhcKLK+0wBfR6RsmHzwy4EddZloyLQ=='
|
:sshrsakey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEArGElx46pD6NNnlxVaTbp0ZJMgBKCmbTCT3RaeCk0ZUJtQ8wkcwTtqIXmmiuFsynUT0DFSd8UIodnBOPqitimmooAVAiAi30TtJVzADfPScMiUnBJKZajIBkEMkwUcqsfh630jyBvLPE/kyQcxbEeGtbu1DG3monkeymanOBW1AKc5o+cJLXcInLnbowMG7NXzujT3BRYn/9s5vtT1V9cuZJs4XLRXQ50NluxJI7sVfRPVvQI9EMbTS4AFBXUej3yfgaLSV+nPZC/lmJ2gR4t/tKvMFF9m16f8IcZKK7o0rK7v81G/tREbOT5YhcKLK+0wBfR6RsmHzwy4EddZloyLQ=='
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it { should include_class('ssh')}
|
it { should compile.with_all_deps }
|
||||||
|
|
||||||
it { should_not include_class('common')}
|
it { should contain_class('ssh')}
|
||||||
|
|
||||||
|
it { should_not contain_class('common')}
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_package('ssh_packages').with({
|
should contain_package('ssh_packages').with({
|
||||||
@ -346,7 +355,7 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/ssh supports osfamilies RedHat, Suse and Debian. Detected osfamily is <C64>./)
|
}.to raise_error(Puppet::Error,/ssh supports osfamilies RedHat, Suse and Debian. Detected osfamily is <C64>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -368,6 +377,8 @@ describe 'ssh' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it { should compile.with_all_deps }
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_file('ssh_config').with({
|
should contain_file('ssh_config').with({
|
||||||
'ensure' => 'file',
|
'ensure' => 'file',
|
||||||
@ -416,6 +427,8 @@ describe 'ssh' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it { should compile.with_all_deps }
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_file('sshd_config').with({
|
should contain_file('sshd_config').with({
|
||||||
'ensure' => 'file',
|
'ensure' => 'file',
|
||||||
@ -469,9 +482,11 @@ describe 'ssh' do
|
|||||||
{ :manage_root_ssh_config => 'true' }
|
{ :manage_root_ssh_config => 'true' }
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should include_class('ssh')}
|
it { should compile.with_all_deps }
|
||||||
|
|
||||||
it { should include_class('common')}
|
it { should contain_class('ssh')}
|
||||||
|
|
||||||
|
it { should contain_class('common')}
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_file('root_ssh_dir').with({
|
should contain_file('root_ssh_dir').with({
|
||||||
@ -509,7 +524,7 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_config_port must be a valid number and is set to <22invalid>./)
|
}.to raise_error(Puppet::Error,/sshd_config_port must be a valid number and is set to <22invalid>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -529,7 +544,7 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/manage_root_ssh_config is <invalid> and must be \'true\' or \'false\'./)
|
}.to raise_error(Puppet::Error,/manage_root_ssh_config is <invalid> and must be \'true\' or \'false\'./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -548,7 +563,7 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_password_authentication may be either \'yes\' or \'no\' and is set to <invalid>./)
|
}.to raise_error(Puppet::Error,/sshd_password_authentication may be either \'yes\' or \'no\' and is set to <invalid>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -567,7 +582,7 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_allow_tcp_forwarding may be either \'yes\' or \'no\' and is set to <invalid>./)
|
}.to raise_error(Puppet::Error,/sshd_allow_tcp_forwarding may be either \'yes\' or \'no\' and is set to <invalid>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -586,7 +601,7 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_x11_forwarding may be either \'yes\' or \'no\' and is set to <invalid>./)
|
}.to raise_error(Puppet::Error,/sshd_x11_forwarding may be either \'yes\' or \'no\' and is set to <invalid>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -605,7 +620,7 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_use_pam may be either \'yes\' or \'no\' and is set to <invalid>./)
|
}.to raise_error(Puppet::Error,/sshd_use_pam may be either \'yes\' or \'no\' and is set to <invalid>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -624,7 +639,7 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_client_alive_interval must be an integer and is set to <invalid>./)
|
}.to raise_error(Puppet::Error,/sshd_client_alive_interval must be an integer and is set to <invalid>./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -643,10 +658,11 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/is not an absolute path/)
|
}.to raise_error(Puppet::Error,/is not an absolute path/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with sshd_banner_content set and with default value on sshd_config_banner on valid osfamily' do
|
context 'with sshd_banner_content set and with default value on sshd_config_banner on valid osfamily' do
|
||||||
let :facts do
|
let :facts do
|
||||||
{
|
{
|
||||||
@ -663,7 +679,7 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/sshd_config_banner must be set to be able to use sshd_banner_content/)
|
}.to raise_error(Puppet::Error,/sshd_config_banner must be set to be able to use sshd_banner_content/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -683,7 +699,7 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error,/ssh_config_sendenv_xmodifiers type must be true or false./)
|
}.to raise_error(Puppet::Error,/ssh_config_sendenv_xmodifiers type must be true or false./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -702,6 +718,8 @@ describe 'ssh' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it { should compile.with_all_deps }
|
||||||
|
|
||||||
it { should contain_file('ssh_config').with_content(/^ SendEnv XMODIFIERS$/) }
|
it { should contain_file('ssh_config').with_content(/^ SendEnv XMODIFIERS$/) }
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -717,9 +735,11 @@ describe 'ssh' do
|
|||||||
{ :manage_firewall => true }
|
{ :manage_firewall => true }
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should include_class('ssh')}
|
it { should compile.with_all_deps }
|
||||||
|
|
||||||
it { should_not include_class('common')}
|
it { should contain_class('ssh')}
|
||||||
|
|
||||||
|
it { should_not contain_class('common')}
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_firewall('22 open port 22 for SSH').with({
|
should contain_firewall('22 open port 22 for SSH').with({
|
||||||
@ -754,6 +774,8 @@ describe 'ssh' do
|
|||||||
}
|
}
|
||||||
} } }
|
} } }
|
||||||
|
|
||||||
|
it { should compile.with_all_deps }
|
||||||
|
|
||||||
it {
|
it {
|
||||||
should contain_ssh_authorized_key('root_for_userX').with({
|
should contain_ssh_authorized_key('root_for_userX').with({
|
||||||
'ensure' => 'present',
|
'ensure' => 'present',
|
||||||
@ -787,7 +809,7 @@ describe 'ssh' do
|
|||||||
|
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect {
|
expect {
|
||||||
should include_class('ssh')
|
should contain_class('ssh')
|
||||||
}.to raise_error(Puppet::Error)
|
}.to raise_error(Puppet::Error)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user