diff options
author | Luchi <39198766+luchihoratiu@users.noreply.github.com> | 2020-03-10 11:56:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-10 11:56:24 +0200 |
commit | 4732c3f7cac68b7376b579c1390d0f2fc57300d0 (patch) | |
tree | 8309796c9485c084ec87cd84d26d17ecfb904213 /spec/integration/provider | |
parent | 9f710d8e502b5bf2ca3d213d2bddea13f7a4b7b8 (diff) | |
parent | 92a734a6620fcc51691d60347e344f87ac801bde (diff) | |
download | puppet-sshkeys_core-4732c3f7cac68b7376b579c1390d0f2fc57300d0.tar.gz puppet-sshkeys_core-4732c3f7cac68b7376b579c1390d0f2fc57300d0.tar.bz2 |
Merge pull request #27 from ciprianbadescu/MODULES-7613/use_composite_namevars
(MODULES-7613) use name and type as composite namevar
Diffstat (limited to 'spec/integration/provider')
-rw-r--r-- | spec/integration/provider/sshkey_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/integration/provider/sshkey_spec.rb b/spec/integration/provider/sshkey_spec.rb index 4a3bf87..5f30db1 100644 --- a/spec/integration/provider/sshkey_spec.rb +++ b/spec/integration/provider/sshkey_spec.rb @@ -52,9 +52,29 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), unless: Puppet.features.m expect(File.read(sshkey_file)).to match(%r{#{super_unique}.*mykey}) end + it 'creates two SSH host key entries with two keys (ensure present)' do + manifest = " + #{type_under_test} { '#{super_unique}_rsa': + ensure => 'present', + type => 'rsa', + name => '#{super_unique}', + key => 'myrsakey', + target => '#{sshkey_file}', } + #{type_under_test} { '#{super_unique}_dss': + ensure => 'present', + type => 'ssh-dss', + name => '#{super_unique}', + key => 'mydsskey', + target => '#{sshkey_file}' }" + apply_with_error_check(manifest) + expect(File.read(sshkey_file)).to match(%r{#{super_unique}.*myrsakey}) + expect(File.read(sshkey_file)).to match(%r{#{super_unique}.*mydsskey}) + end + it 'deletes an entry for an SSH host key' do manifest = "#{type_under_test} { '#{sshkey_name}': ensure => 'absent', + type => 'rsa', target => '#{sshkey_file}' }" apply_with_error_check(manifest) expect(File.read(sshkey_file)).not_to match(%r{#{sshkey_name}.*Yqk0=}) @@ -121,6 +141,7 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), unless: Puppet.features.m it 'updates an entry with a single new host_alias' do manifest = "#{type_under_test} { '#{sshkey_name}': ensure => 'present', + type => 'rsa', host_aliases => '#{host_alias}', target => '#{sshkey_file}' }" apply_with_error_check(manifest) @@ -132,6 +153,7 @@ describe Puppet::Type.type(:sshkey).provider(:parsed), unless: Puppet.features.m it 'updates an entry with multiple new host_aliases' do manifest = "#{type_under_test} { '#{sshkey_name}': ensure => 'present', + type => 'rsa', host_aliases => [ 'r0ckdata.com', 'erict.net' ], target => '#{sshkey_file}' }" apply_with_error_check(manifest) |