]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
add test for options
authormh <mh@immerda.ch>
Wed, 5 Feb 2014 22:21:36 +0000 (23:21 +0100)
committermh <mh@immerda.ch>
Wed, 5 Feb 2014 22:21:36 +0000 (23:21 +0100)
spec/defines/ssh_authorized_key_spec.rb

index 0cc4eb8331e9d2c42344045f5266c69188b81bca..c73a91cc86683612f01b016864b25b4e4d37fe54 100644 (file)
@@ -19,4 +19,27 @@ describe 'sshd::ssh_authorized_key' do
       })
     }
   end
+  context 'manage authoried key with options' do
+    let(:title) { 'foo2' }
+    let(:ssh_key) { 'some_secret_ssh_key' }
+
+    let(:params) {{
+        :key      => ssh_key,
+        :options  => ['command="/usr/bin/date"',
+                      'no-pty','no-X11-forwarding','no-agent-forwarding',
+                      'no-port-forwarding']
+    }}
+
+    it { should contain_ssh_authorized_key('foo2').with({
+        'ensure'  => 'present',
+        'type'    => 'ssh-dss',
+        'user'    => 'foo2',
+        'target'  => '/home/foo2/.ssh/authorized_keys',
+        'key'     => ssh_key,
+        'options' => ['command="/usr/bin/date"',
+                      'no-pty','no-X11-forwarding','no-agent-forwarding',
+                      'no-port-forwarding']
+      })
+    }
+  end
 end