Merge pull request #434 from bmjen/modules-2474
Modules-2474: Only runs enhanced salts functions test on systems that ...
This commit is contained in:
commit
59b3fb4472
1 changed files with 29 additions and 20 deletions
|
@ -2,6 +2,11 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "the pw_hash function" do
|
||||
|
||||
before :all do
|
||||
@enhanced_salts_supported = RUBY_PLATFORM == 'java'
|
||||
end
|
||||
|
||||
let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
|
||||
|
||||
it "should exist" do
|
||||
|
@ -57,6 +62,8 @@ describe "the pw_hash function" do
|
|||
expect { scope.function_pw_hash(['password', 'sha-512', 'salt']) }.to( raise_error(Puppet::ParseError, /system does not support enhanced salts/) )
|
||||
end
|
||||
|
||||
if @enhanced_salts_supported
|
||||
describe "on systems with enhanced salts support" do
|
||||
it "should return a hashed password" do
|
||||
result = scope.function_pw_hash(['password', 'sha-512', 'salt'])
|
||||
expect(result).to eql('$6$salt$IxDD3jeSOb5eB1CX5LBsqZFVkJdido3OUILO5Ifz5iwMuTS4XMS130MTSuDDl3aCI6WouIL9AjRbLCelDCy.g.')
|
||||
|
@ -85,3 +92,5 @@ describe "the pw_hash function" do
|
|||
expect(hash_parts).not_to eql(nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue