summaryrefslogtreecommitdiffstats
path: root/spec/unit/provider/ssh_authorized_key
diff options
context:
space:
mode:
authorFrancois Deppierraz <francois@slayer.ctrlaltdel.ch>2009-03-21 23:32:02 +0100
committerJames Turnbull <james@lovedthanlost.net>2009-03-24 08:15:33 +1100
commit39deaf373c46c20d14a04391ad4b7c70ad43e266 (patch)
treebf9b030dcf812269a1bc1ca70bb91deb477897e3 /spec/unit/provider/ssh_authorized_key
parentdcf2bf2be7275afc68054f3c9d51b548111b6574 (diff)
downloadpuppet-39deaf373c46c20d14a04391ad4b7c70ad43e266.tar.gz
puppet-39deaf373c46c20d14a04391ad4b7c70ad43e266.tar.xz
puppet-39deaf373c46c20d14a04391ad4b7c70ad43e266.zip
Fixed #2004 - ssh_authorized_key fails if no target is defined
This commit depends on 7f291afdacf59f762c3b78481f5420ec8919e46d (fixing #1629) which was cherry-picked from master. Signed-off-by: Francois Deppierraz <francois@ctrlaltdel.ch>
Diffstat (limited to 'spec/unit/provider/ssh_authorized_key')
-rwxr-xr-xspec/unit/provider/ssh_authorized_key/parsed.rb24
1 files changed, 2 insertions, 22 deletions
diff --git a/spec/unit/provider/ssh_authorized_key/parsed.rb b/spec/unit/provider/ssh_authorized_key/parsed.rb
index 73d623573..1e5d6be48 100755
--- a/spec/unit/provider/ssh_authorized_key/parsed.rb
+++ b/spec/unit/provider/ssh_authorized_key/parsed.rb
@@ -72,27 +72,6 @@ describe provider_class do
genkey(key).should == "from=\"192.168.1.1\",no-pty,no-X11-forwarding ssh-rsa AAAAfsfddsjldjgksdflgkjsfdlgkj root@localhost\n"
end
- it "should prefetch ~user/.ssh/authorized_keys when user is given" do
- key = Puppet::Type.type(:ssh_authorized_key).create(
- :name => "Test",
- :key => "AA",
- :type => "rsa",
- :ensure => :present,
- :user => "root")
- prov = @provider.new key
-
- prov.prefetch
- prov.target.should == File.expand_path("~root/.ssh/authorized_keys")
- end
-
- it "should create destination dir" do
- # No idea how to test the flush method
- end
-
- it "should set correct default permissions" do
- # No idea how to test the flush method
- end
-
it "'s parse_options method should be able to parse options containing commas" do
options = %w{from="host1.reductlivelabs.com,host.reductivelabs.com" command="/usr/local/bin/run" ssh-pty}
optionstr = options.join(", ")
@@ -119,7 +98,8 @@ describe provider_class do
describe "and a user has been specified" do
before :each do
@resource.stubs(:should).with(:user).returns "nobody"
- @resource.stubs(:should).with(:target).returns nil
+ target = File.expand_path("~nobody/.ssh/authorized_keys")
+ @resource.stubs(:should).with(:target).returns target
end
it "should create the directory" do