diff options
author | Jeff McCune <jeff@puppetlabs.com> | 2011-10-10 11:52:33 -0700 |
---|---|---|
committer | Jeff McCune <jeff@puppetlabs.com> | 2011-10-10 11:52:33 -0700 |
commit | 9f98d3feaf7e3fee55bc2b7b2e1d8f75b0972672 (patch) | |
tree | c774302c46efde850662da3c3588d93e21e6f570 /spec/unit/puppet/parser/functions/get_pubkey_spec.rb | |
parent | 14852e0259e1e43371dbcb2675e00c6d6e614f05 (diff) | |
parent | 07b2a3afd996fa367e2e1b3692b5b8eea3273af2 (diff) | |
download | puppet-stdlib-9f98d3feaf7e3fee55bc2b7b2e1d8f75b0972672.tar.gz puppet-stdlib-9f98d3feaf7e3fee55bc2b7b2e1d8f75b0972672.tar.bz2 |
Merge branch 'ticket/master/revert_8925'
* ticket/master/revert_8925:
(#10007) Revert "Merge pull request #13 from kbarber/issue/master/8925-user_ssl_certs"
Diffstat (limited to 'spec/unit/puppet/parser/functions/get_pubkey_spec.rb')
-rwxr-xr-x | spec/unit/puppet/parser/functions/get_pubkey_spec.rb | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/spec/unit/puppet/parser/functions/get_pubkey_spec.rb b/spec/unit/puppet/parser/functions/get_pubkey_spec.rb deleted file mode 100755 index e4cdd9f..0000000 --- a/spec/unit/puppet/parser/functions/get_pubkey_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env rspec - -require 'spec_helper' -require 'net/http' -require 'thread' -require 'fileutils' - -describe "the get_pubkey function" do - include PuppetSpec::Files - - before :all do - Puppet::Parser::Functions.autoloader.loadall - end - - before :each do - @scope = Puppet::Parser::Scope.new - end - - it "should exist" do - Puppet::Parser::Functions.function("get_pubkey").should == "function_get_pubkey" - end - - it "should raise a ParseError if there is less than 1 argument" do - lambda { @scope.function_get_pubkey([]) }.should(raise_error(Puppet::ParseError)) - end - - it "should raise a ParseError if the argument is empty" do - lambda { @scope.function_get_pubkey([""]) }.should(raise_error(Puppet::ParseError)) - end - - it "should raise a ParseError if the argument contains strange characters" do - lambda { @scope.function_get_pubkey(["%^&"]) }.should(raise_error(Puppet::ParseError)) - end - - it "should return a valid certificate if CA is local" do - Puppet[:ca] = true - Puppet[:signeddir] = "spec/master_config/ssl/ca/signed/" - result = @scope.function_get_pubkey(["bob@mydomain.com"]) - result.should(eq(<<-EOS)) ------BEGIN RSA PUBLIC KEY----- -MIGJAoGBAL7+Idbd+eohxCXVXcICvo1IaqAzyjezWxfxMxoBF4mjdvwY9RalRM5j -Itm9ThVwLMezcISYSNPI42Y70+9XIK/3f6OxnSMoB7kDKX9MvcbZkRAtOfxDeWmA -un+PXuH87VN1r7sViRSSB2dIxB3qjF1HNhAm0ocmSW+sZ3eul2lpAgMBAAE= ------END RSA PUBLIC KEY----- -EOS - end - - it "should throw an error if CN is missing and CA is local" do - Puppet[:ca] = true - Puppet[:signeddir] = "spec/master_config/ssl/ca/signed/" - result = @scope.function_get_pubkey(["missing@mydomain.com"]) - result.should(eq(:undef)) - end -end |