~ubuntu-branches/ubuntu/quantal/puppet/quantal

« back to all changes in this revision

Viewing changes to spec/unit/type/sshkey_spec.rb

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-07-14 01:56:30 UTC
  • mfrom: (1.1.29) (3.1.43 sid)
  • Revision ID: package-import@ubuntu.com-20120714015630-ntj41rkvkq4zph4y
Tags: 2.7.18-1ubuntu1
* Resynchronise with Debian. (LP: #1023931) Remaining changes:
  - debian/puppetmaster-passenger.postinst: Make sure we error if puppet
    config print doesn't work
  - debian/puppetmaster-passenger.postinst: Ensure upgrades from
    <= 2.7.11-1 fixup passenger apache configuration.
* Dropped upstreamed patches:
  - debian/patches/CVE-2012-1906_CVE-2012-1986_to_CVE-2012-1989.patch
  - debian/patches/puppet-12844
  - debian/patches/2.7.17-Puppet-July-2012-CVE-fixes.patch
* Drop Build-Depends on ruby-rspec (in universe):
  - debian/control: remove ruby-rspec from Build-Depends
  - debian/patches/no-rspec.patch: make Rakefile work anyway if rspec
    isn't installed so we can use it in debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
  describe "when validating values" do
30
30
 
31
 
    it "should support ssh-dss as a type value" do
32
 
      proc { @class.new(:name => "foo", :type => "ssh-dss") }.should_not raise_error
33
 
    end
34
 
 
35
 
    it "should support ssh-rsa as a type value" do
36
 
      proc { @class.new(:name => "whev", :type => "ssh-rsa") }.should_not raise_error
37
 
    end
38
 
 
39
 
    it "should alias :dsa to ssh-dss as a value for type" do
40
 
      key = @class.new(:name => "whev", :type => :dsa)
 
31
    [:'ssh-dss', :'ssh-rsa', :rsa, :dsa, :'ecdsa-sha2-nistp256', :'ecdsa-sha2-nistp384', :'ecdsa-sha2-nistp521'].each do |keytype|
 
32
      it "should support #{keytype} as a type value" do
 
33
        proc { @class.new(:name => "foo", :type => keytype) }.should_not raise_error
 
34
      end
 
35
    end
 
36
 
 
37
    it "should alias :rsa to :ssh-rsa" do
 
38
      key = @class.new(:name => "foo", :type => :rsa)
 
39
      key.should(:type).should == :'ssh-rsa'
 
40
    end
 
41
 
 
42
    it "should alias :dsa to :ssh-dss" do
 
43
      key = @class.new(:name => "foo", :type => :dsa)
41
44
      key.should(:type).should == :'ssh-dss'
42
45
    end
43
46
 
44
 
    it "should alias :rsa to ssh-rsa as a value for type" do
45
 
      key = @class.new(:name => "whev", :type => :rsa)
46
 
      key.should(:type).should == :'ssh-rsa'
47
 
    end
48
 
 
49
47
    it "should not support values other than ssh-dss, ssh-rsa, dsa, rsa for type" do
50
48
      proc { @class.new(:name => "whev", :type => :'ssh-dsa') }.should raise_error(Puppet::Error)
51
49
    end