beaker 1.11.1 → 1.11.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGQ0YzFjMDg1ZWEzZmIxNTgzOWQ0NmM4MmIyODM1NmNiZjA2YzBjZg==
4
+ YzdiZWJkMDg4NTUxZmY5NGYyYTczYjU3MGE2MThlZjU5ZmFiN2JmZQ==
5
5
  data.tar.gz: !binary |-
6
- NzMxOTllOGEwMWRjZDQ0MzMxY2VkMDI4ZDBmZWExZGE4NGVhZTgwNw==
6
+ MTgzYTI4YzdmOTFjNmVjMDIzYWJmODkxOWUxMTVhYjczNjY5MzU3Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmFiYjE3ODI1NWRiZDc0ZDg0ODJmYjdmOTU0ZjczYmE3YTc2OTdkNDY2ZTQx
10
- MjJkYTRjYjM5MzQwZDIxNWYyMTAwYTllNzRkNGZjZWFmZDNhNDhmMmRlZjQ0
11
- OTc3YTBhYTgwYTg5Nzc2ZWI0ZWVhODA3YjI5NTlmNDc4NmVhYmQ=
9
+ ZTJjZTg2NmU3OTY3MTVlNzIzNGE4NTA2YjU3ZmY2OTlhYTg5Yjk2NDkyMTc1
10
+ YzNlMDE3ZmNlNGUyZTNlYWJjOGQ5YTg5YTJiMzNmYzBiOTBiYjA4OTYxNzJl
11
+ YWFmNGM0OWNjNTI1YzJhZDA1MWMwNjYwN2Y1NGE2ZjBkZDdiNTA=
12
12
  data.tar.gz: !binary |-
13
- Zjk0OGFhOWE5MGY2NDk4MzY3MjNiNGMyZWRmNjhlNjM4NWUzNTRiZTJmODE0
14
- OTE4ZWIwNzkxZTJiMjY3N2ZmMjY1OTE2YzQ5NDdiYjIxMDEzOTdiN2JkNWJj
15
- OGJjZjFlOTg3NzA4NWJkODk3YTRiNWRjM2FhYzM4ZDI1ZjJlNTA=
13
+ ZjBlMjU0M2FjZDRmMmIxN2U5ZDYxNmVkZWU3MzA1Njk2ZDBkYjFhOGRhNWM4
14
+ YWY3Njg3ZjEwNTAzMGViNzFjYzY4ZTlkNDYxYjVmYzg5MzkxNDhkYWIwNjlj
15
+ YTNlZWJlNGYwNWUxYmM3ODA4ZWFiYWMzYWI3ZGVkMTJkZDU5MTU=
@@ -921,20 +921,12 @@ module Beaker
921
921
  sleep 2 unless agent_running
922
922
  end
923
923
 
924
- if agent['platform'].include?('solaris')
925
- on(agent, '/usr/sbin/svcadm disable -s svc:/network/pe-puppet:default')
926
- elsif agent['platform'].include?('aix')
927
- on(agent, '/usr/bin/stopsrc -s pe-puppet')
928
- elsif agent['platform'].include?('windows')
929
- on(agent, 'net stop pe-puppet', :acceptable_exit_codes => [0,2])
930
- else
931
- # For the sake of not passing the PE version into this method,
932
- # we just query the system to find out which service we want to
933
- # stop
934
- result = on agent, "[ -e /etc/init.d/pe-puppet-agent ]", :acceptable_exit_codes => [0,1]
935
- service = (result.exit_code == 0) ? 'pe-puppet-agent' : 'pe-puppet'
936
- on(agent, "/etc/init.d/#{service} stop")
937
- end
924
+ # The agent service is `pe-puppet` everywhere EXCEPT certain linux distros on PE 2.8
925
+ # In all the case that it is different, this init script will exist. So we can assume
926
+ # that if the script doesn't exist, we should just use `pe-puppet`
927
+ result = on agent, "[ -e /etc/init.d/pe-puppet-agent ]", :acceptable_exit_codes => [0,1]
928
+ agent_service = (result.exit_code == 0) ? 'pe-puppet-agent' : 'pe-puppet'
929
+ on agent, puppet_resource('service', agent_service, 'ensure=stopped')
938
930
  end
939
931
 
940
932
  #stops the puppet agent running on the default host
@@ -191,9 +191,9 @@ module Beaker
191
191
  # (Otherwise uses individual Windows hosts pe_ver)
192
192
  # @api private
193
193
  def fetch_puppet_on_windows(host, opts)
194
- path = opts[:pe_dir] || host['pe_dir']
194
+ path = host['pe_dir'] || opts[:pe_dir]
195
195
  local = File.directory?(path)
196
- version = opts[:pe_ver_win] || host['pe_ver']
196
+ version = host['pe_ver'] || opts[:pe_ver_win]
197
197
  filename = "puppet-enterprise-#{version}"
198
198
  extension = ".msi"
199
199
  if local
@@ -219,7 +219,7 @@ module Beaker
219
219
  # (Otherwise uses individual hosts pe_ver)
220
220
  # @api private
221
221
  def fetch_puppet_on_unix(host, opts)
222
- path = opts[:pe_dir] || host['pe_dir']
222
+ path = host['pe_dir'] || opts[:pe_dir]
223
223
  local = File.directory?(path)
224
224
  filename = "#{host['dist']}"
225
225
  if local
@@ -32,6 +32,18 @@ module Beaker
32
32
  Command.new('hiera', args, options )
33
33
  end
34
34
 
35
+ # This is hairy and because of legacy code it will take a bit more
36
+ # work to disentangle all of the things that are being passed into
37
+ # this catchall param.
38
+ #
39
+ # @api dsl
40
+ def razor(*args)
41
+ options = args.last.is_a?(Hash) ? args.pop : {}
42
+ options['ENV'] ||= {}
43
+ options['ENV'] = options['ENV'].merge( Command::DEFAULT_GIT_ENV )
44
+ Command.new('razor', args, options )
45
+ end
46
+
35
47
  # @param [String] command_string A string of to be interpolated
36
48
  # within the context of a host in
37
49
  # question
@@ -17,8 +17,8 @@ module Beaker
17
17
  SLES_PACKAGES = ['ntp']
18
18
  ETC_HOSTS_PATH = "/etc/hosts"
19
19
  ETC_HOSTS_PATH_SOLARIS = "/etc/inet/hosts"
20
- ROOT_KEYS_SCRIPT = "https://raw.github.com/puppetlabs/puppetlabs-sshkeys/master/templates/scripts/manage_root_authorized_keys"
21
- ROOT_KEYS_SYNC_CMD = "curl -k -o - #{ROOT_KEYS_SCRIPT} | %s"
20
+ ROOT_KEYS_SCRIPT = "https://raw.githubusercontent.com/puppetlabs/puppetlabs-sshkeys/master/templates/scripts/manage_root_authorized_keys"
21
+ ROOT_KEYS_SYNC_CMD = "curl -k -o - -L #{ROOT_KEYS_SCRIPT} | %s"
22
22
  APT_CFG = %q{ Acquire::http::Proxy "http://proxy.puppetlabs.net:3128/"; }
23
23
  IPS_PKG_REPO="http://solaris-11-internal-repo.delivery.puppetlabs.net"
24
24
 
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '1.11.1'
3
+ STRING = '1.11.2'
4
4
  end
5
5
  end
@@ -551,50 +551,15 @@ describe ClassMixedWithDSLHelpers do
551
551
  result_pass.exit_code = 0
552
552
  end
553
553
 
554
- it 'runs the correct command on solaris' do
555
- vardir = '/var'
556
- solaris_agent = make_host( 'solaris', :platform => 'solaris' )
557
- solaris_agent.stub( :puppet ).and_return( { 'vardir' => vardir } )
558
-
559
- subject.should_receive( :on ).with( solaris_agent, "[ -e '#{vardir}/state/agent_catalog_run.lock' ]", :acceptable_exit_codes => [0,1] ).once.and_return( result_fail )
560
- subject.should_receive( :on ).with( solaris_agent, '/usr/sbin/svcadm disable -s svc:/network/pe-puppet:default' ).once
561
-
562
- subject.stop_agent_on( solaris_agent )
563
-
564
- end
565
-
566
- it 'runs the correct command on aix' do
567
- vardir = '/var'
568
- aix_agent = make_host( 'aix', :platform => 'aix' )
569
- aix_agent.stub( :puppet ).and_return( { 'vardir' => vardir } )
570
-
571
- subject.should_receive( :on ).with( aix_agent, "[ -e '#{vardir}/state/agent_catalog_run.lock' ]", :acceptable_exit_codes => [0,1] ).once.and_return( result_fail )
572
- subject.should_receive( :on ).with( aix_agent, '/usr/bin/stopsrc -s pe-puppet' ).once
573
-
574
- subject.stop_agent_on( aix_agent )
575
-
576
- end
577
-
578
- it 'runs the correct command on windows' do
579
- vardir = '/var'
580
- win_agent = make_host( 'win', :platform => 'windows' )
581
- win_agent.stub( :puppet ).and_return( { 'vardir' => vardir } )
582
-
583
- subject.should_receive( :on ).with( win_agent, "[ -e '#{vardir}/state/agent_catalog_run.lock' ]", :acceptable_exit_codes => [0,1] ).once.and_return( result_fail )
584
- subject.should_receive( :on ).with( win_agent, 'net stop pe-puppet', :acceptable_exit_codes => [0,2] ).once
585
-
586
- subject.stop_agent_on( win_agent )
587
-
588
- end
589
-
590
- it 'runs the pe-puppet on a unix system without pe-puppet-agent' do
554
+ it 'runs the pe-puppet on a system without pe-puppet-agent' do
591
555
  vardir = '/var'
592
556
  deb_agent = make_host( 'deb', :platform => 'debian-7-amd64' )
593
557
  deb_agent.stub( :puppet ).and_return( { 'vardir' => vardir } )
594
558
 
595
559
  subject.should_receive( :on ).with( deb_agent, "[ -e '#{vardir}/state/agent_catalog_run.lock' ]", :acceptable_exit_codes => [0,1] ).once.and_return( result_fail )
596
560
  subject.should_receive( :on ).with( deb_agent, "[ -e /etc/init.d/pe-puppet-agent ]", :acceptable_exit_codes => [0,1] ).once.and_return( result_fail )
597
- subject.should_receive( :on ).with( deb_agent, "/etc/init.d/pe-puppet stop" ).once
561
+ subject.should_receive( :puppet_resource ).with( "service", "pe-puppet", "ensure=stopped").once
562
+ subject.should_receive( :on ).once
598
563
 
599
564
  subject.stop_agent_on( deb_agent )
600
565
 
@@ -607,7 +572,8 @@ describe ClassMixedWithDSLHelpers do
607
572
 
608
573
  subject.should_receive( :on ).with( el_agent, "[ -e '#{vardir}/state/agent_catalog_run.lock' ]", :acceptable_exit_codes => [0,1] ).once.and_return( result_fail )
609
574
  subject.should_receive( :on ).with( el_agent, "[ -e /etc/init.d/pe-puppet-agent ]", :acceptable_exit_codes => [0,1] ).once.and_return( result_pass )
610
- subject.should_receive( :on ).with( el_agent, "/etc/init.d/pe-puppet-agent stop" ).once
575
+ subject.should_receive( :puppet_resource ).with("service", "pe-puppet-agent", "ensure=stopped").once
576
+ subject.should_receive( :on ).once
611
577
 
612
578
  subject.stop_agent_on( el_agent )
613
579
  end
@@ -23,6 +23,14 @@ describe ClassMixedWithDSLWrappers do
23
23
  end
24
24
  end
25
25
 
26
+ describe '#razor' do
27
+ it 'should split out the options and pass "razor" as first arg to Command' do
28
+ Beaker::Command.should_receive( :new ).
29
+ with('razor', [ '-p' ], opts)
30
+ subject.razor( '-p' )
31
+ end
32
+ end
33
+
26
34
  describe '#puppet' do
27
35
  it 'should split out the options and pass "puppet <blank>" to Command' do
28
36
  merged_opts = {}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-15 00:00:00.000000000 Z
11
+ date: 2014-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest