diff options
author | Paul Lathrop <paul@tertiusfamily.net> | 2009-02-27 12:25:28 -0800 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-02-28 10:01:23 +1100 |
commit | c052ff881e4a0cf6edfe4c1974597cd3abb378cf (patch) | |
tree | df96ea6696d29a2bb80248ee530d2fbcea1d9a90 /spec/unit | |
parent | e2b406239eaa255c41acb31942169296bea71948 (diff) | |
download | puppet-c052ff881e4a0cf6edfe4c1974597cd3abb378cf.tar.gz puppet-c052ff881e4a0cf6edfe4c1974597cd3abb378cf.tar.xz puppet-c052ff881e4a0cf6edfe4c1974597cd3abb378cf.zip |
Make puppetd --waitforcert option behave as documented:
"You can turn off waiting for certificates by specifying a time of 0."
Also add a test to ensure we catch any future regression of this behavior.
Signed-off-by: Paul Lathrop <paul@tertiusfamily.net>
Diffstat (limited to 'spec/unit')
-rwxr-xr-x | spec/unit/executables/client/certhandler.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/executables/client/certhandler.rb b/spec/unit/executables/client/certhandler.rb index 4f8f8139c..69d6de92b 100755 --- a/spec/unit/executables/client/certhandler.rb +++ b/spec/unit/executables/client/certhandler.rb @@ -91,6 +91,19 @@ describe cert_handler, "when handling certificates" do end end + describe "when waitforcert is disabled" do + before do + @handler = cert_handler.new(0, false) + @handler.stubs(:read_cert).returns false + end + + it "should exit if the cert request does not return a certificate" do + @caclient.stubs(:request_cert).returns(false) + @handler.expects(:exit).with(1).raises(SystemExit) + lambda { @handler.retrieve_cert }.should raise_error(SystemExit) + end + end + describe "when in one time mode" do before do #true puts us in onetime mode |