@@ -30,13 +30,14 @@ def metadata
3030 let ( :basic_hosts ) { make_hosts ( { :pe_ver => '3.0' ,
3131 :platform => 'linux' ,
3232 :roles => [ 'agent' ] ,
33- :type => 'pe' } , 4 ) }
33+ :type => 'pe' } , 5 ) }
3434 let ( :hosts ) { basic_hosts [ 0 ] [ :roles ] = [ 'master' , 'database' , 'dashboard' ]
3535 basic_hosts [ 1 ] [ :platform ] = 'windows'
3636 basic_hosts [ 2 ] [ :platform ] = 'osx-10.9-x86_64'
3737 basic_hosts [ 3 ] [ :platform ] = 'eos'
38+ basic_hosts [ 4 ] [ :platform ] = 'sles'
3839 basic_hosts }
39- let ( :hosts_sorted ) { [ hosts [ 1 ] , hosts [ 0 ] , hosts [ 2 ] , hosts [ 3 ] ] }
40+ let ( :hosts_sorted ) { [ hosts [ 1 ] , hosts [ 0 ] , hosts [ 2 ] , hosts [ 3 ] , hosts [ 4 ] ] }
4041 let ( :winhost ) { make_host ( 'winhost' , { :platform => 'windows' ,
4142 :pe_ver => '3.0' ,
4243 :type => 'pe' ,
@@ -55,7 +56,10 @@ def metadata
5556 :type => 'pe' ,
5657 :working_dir => '/tmp' ,
5758 :dist => 'puppet-enterprise-3.7.1-rc0-78-gffc958f-eos-4-i386' } ) }
58-
59+ let ( :sles11host ) { make_host ( 'sles11' , { :platform => 'sles' ,
60+ :pe_ver => '3.0' ,
61+ :type => 'pe' ,
62+ :working_dir => '/tmp' } ) }
5963 let ( :lei_hosts ) { make_hosts ( { :pe_ver => '3.0' ,
6064 :platform => 'linux' ,
6165 :roles => [ 'agent' ] ,
@@ -1637,8 +1641,30 @@ def slice_installer_options(host)
16371641 subject . do_install ( [ ] )
16381642 end
16391643
1644+ context "install rpm file in sles host" do
1645+ let ( :opts ) {
1646+ { :puppet_collection => 'puppet7' }
1647+ }
1648+ let ( :stream ) { opts [ :puppet_collection ] }
1649+ let ( :puppet_agent_ver ) { '7.29.1.26' }
1650+ let ( :agent_downloads_url ) { "http://agent-downloads.delivery.puppetlabs.net/puppet-agent" }
1651+ let ( :master_version ) { '7.29.1.26.gf344eeefa' }
1652+ let ( :path ) { "#{ agent_downloads_url } /#{ puppet_agent_ver } /repos/sles/11/#{ stream } /x86_64" }
1653+ let ( :filename ) { "puppet-agent-#{ master_version } -1.sles11.x86_64" }
1654+ let ( :extension ) { '.rpm' }
1655+ let ( :url ) { "#{ path } /#{ filename } #{ extension } " }
1656+
1657+ it "generates the correct url to download the package" do
1658+ allow ( subject ) . to receive ( :puppet_fact ) . and_return ( master_version )
1659+ allow ( subject ) . to receive ( :master ) . and_return ( { } )
1660+
1661+ expect ( hosts [ 4 ] ) . to receive ( :install_package_with_rpm ) . with ( url ) . once
1662+ subject . install_rpm_on_sles11_host ( hosts [ 4 ] , puppet_agent_ver , opts )
1663+ end
1664+ end
1665+
16401666 it 'can perform a simple installation' do
1641- expect ( subject ) . to receive ( :get_mco_setting ) . and_return ( { } )
1667+ expect ( subject ) . to receive ( :get_mco_setting ) . and_return ( { } ) . twice
16421668 allow ( subject ) . to receive ( :verify_network_resources ) . with ( hosts , nil )
16431669 allow ( subject ) . to receive ( :on ) . and_return ( Beaker ::Result . new ( { } , '' ) )
16441670 allow ( subject ) . to receive ( :fetch_pe ) . and_return ( true )
0 commit comments