rouster 0.62 → 0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +5 -0
- data/lib/rouster.rb +7 -7
- data/lib/rouster/deltas.rb +8 -3
- data/lib/rouster/puppet.rb +23 -2
- data/lib/rouster/testing.rb +10 -6
- data/test/functional/deltas/test_get_os.rb +68 -0
- data/test/unit/puppet/resources/puppet_run_with_failed_exec +59 -0
- data/test/unit/puppet/resources/puppet_run_with_successful_exec +61 -0
- data/test/unit/puppet/test_puppet_parsing.rb +44 -0
- data/test/unit/testing/test_validate_port.rb +5 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f6f24bd67f15a77eb224c1d7113697ddf655644
|
4
|
+
data.tar.gz: e12f55be25bb6e83b69df057f6f9b5aca70d364e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dbdd864b27dae6c8de015f027c4935e1ef328ff8a03b22ad6812f6d7b3ee64c99dfe106da9e427e6c7d53d83b09e82484d382df72c2e7c29c4b8a577cfcb515
|
7
|
+
data.tar.gz: ce7bbaa357a902683f9ac0d3e2bf5eba3f48c60c50aa9dde5e0d5b7145939ec62d7790ff65eabf6c72c737a28c8bf638bb7feac23a76fa5ffd66618cde0e3e2b
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -52,6 +52,7 @@ GEM
|
|
52
52
|
nokogiri (1.6.3.1)
|
53
53
|
mini_portile (= 0.6.0)
|
54
54
|
power_assert (0.1.4)
|
55
|
+
rake (10.4.2)
|
55
56
|
test-unit (3.0.2)
|
56
57
|
power_assert
|
57
58
|
|
@@ -64,4 +65,8 @@ DEPENDENCIES
|
|
64
65
|
log4r (~> 1.1.9)
|
65
66
|
net-scp
|
66
67
|
net-ssh
|
68
|
+
rake (= 10.4.2)
|
67
69
|
test-unit (~> 3.0.0)
|
70
|
+
|
71
|
+
BUNDLED WITH
|
72
|
+
1.10.6
|
data/lib/rouster.rb
CHANGED
@@ -12,7 +12,7 @@ require 'rouster/vagrant'
|
|
12
12
|
class Rouster
|
13
13
|
|
14
14
|
# sporadically updated version number
|
15
|
-
VERSION = 0.
|
15
|
+
VERSION = 0.63
|
16
16
|
|
17
17
|
# custom exceptions -- what else do we want them to include/do?
|
18
18
|
class ArgumentError < StandardError; end # thrown by methods that take parameters from users
|
@@ -24,7 +24,7 @@ class Rouster
|
|
24
24
|
class PassthroughError < StandardError; end # thrown by anything Passthrough related (mostly vagrant.rb)
|
25
25
|
class SSHConnectionError < StandardError; end # thrown by available_via_ssh() -- and potentially _run()
|
26
26
|
|
27
|
-
attr_accessor :facts
|
27
|
+
attr_accessor :facts, :last_puppet_run
|
28
28
|
attr_reader :cache, :cache_timeout, :deltas, :exitcode, :logger, :name, :output, :passthrough, :retries, :sshkey, :unittest, :vagrantbinary, :vagrantfile
|
29
29
|
|
30
30
|
##
|
@@ -360,7 +360,7 @@ class Rouster
|
|
360
360
|
if @ssh.nil? or @ssh.closed?
|
361
361
|
begin
|
362
362
|
res = self.connect_ssh_tunnel()
|
363
|
-
rescue Rouster::InternalError, Net::SSH::Disconnect => e
|
363
|
+
rescue Rouster::InternalError, Net::SSH::Disconnect, Errno::ECONNREFUSED, Errno::ECONNRESET => e
|
364
364
|
res = false
|
365
365
|
end
|
366
366
|
|
@@ -518,9 +518,9 @@ class Rouster
|
|
518
518
|
:osx => '/System/Library/CoreServices/SystemVersion.plist',
|
519
519
|
}
|
520
520
|
|
521
|
-
res
|
521
|
+
res = :invalid
|
522
522
|
|
523
|
-
files.each do |os,file|
|
523
|
+
files.each do |os, file|
|
524
524
|
if self.is_file?(file)
|
525
525
|
@logger.debug(sprintf('determined OS to be[%s] via[%s]', os, file))
|
526
526
|
res = os
|
@@ -528,7 +528,7 @@ class Rouster
|
|
528
528
|
end
|
529
529
|
end
|
530
530
|
|
531
|
-
@logger.error(sprintf('unable to determine OS, looking for[%s]', files)) if res.
|
531
|
+
@logger.error(sprintf('unable to determine OS, looking for[%s]', files)) if res.eql?(:invalid)
|
532
532
|
|
533
533
|
@ostype = res
|
534
534
|
res
|
@@ -640,7 +640,7 @@ class Rouster
|
|
640
640
|
|
641
641
|
if wait
|
642
642
|
inc = wait.to_i / 10
|
643
|
-
0
|
643
|
+
0.upto(9) do |e|
|
644
644
|
@logger.debug(sprintf('waiting for reboot: round[%s], step[%s], total[%s]', e, inc, wait))
|
645
645
|
return true if self.is_available_via_ssh?()
|
646
646
|
sleep inc
|
data/lib/rouster/deltas.rb
CHANGED
@@ -476,6 +476,10 @@ class Rouster
|
|
476
476
|
:systemv => '/sbin/service --status-all',
|
477
477
|
:upstart => 'initctl list',
|
478
478
|
},
|
479
|
+
|
480
|
+
:invalid => {
|
481
|
+
:invalid => 'invalid',
|
482
|
+
},
|
479
483
|
}
|
480
484
|
|
481
485
|
if type.eql?(:all)
|
@@ -486,7 +490,7 @@ class Rouster
|
|
486
490
|
|
487
491
|
type.each do |provider|
|
488
492
|
|
489
|
-
raise InternalError.new(sprintf('unable to get service information from VM operating system[%s]', os))
|
493
|
+
raise InternalError.new(sprintf('unable to get service information from VM operating system[%s]', os)) if provider.eql?(:invalid)
|
490
494
|
raise ArgumentError.new(sprintf('unable to find command provider[%s] for [%s]', provider, os)) if commands[os][provider].nil?
|
491
495
|
|
492
496
|
@logger.info(sprintf('get_services using provider [%s] on [%s]', provider, os))
|
@@ -665,10 +669,11 @@ class Rouster
|
|
665
669
|
end
|
666
670
|
|
667
671
|
end
|
668
|
-
|
669
|
-
|
672
|
+
else
|
673
|
+
raise InternalError.new(sprintf('unable to get service information from VM operating system[%s]', os))
|
670
674
|
end
|
671
675
|
|
676
|
+
|
672
677
|
# end of provider processing
|
673
678
|
end
|
674
679
|
|
data/lib/rouster/puppet.rb
CHANGED
@@ -46,6 +46,27 @@ class Rouster
|
|
46
46
|
res
|
47
47
|
end
|
48
48
|
|
49
|
+
##
|
50
|
+
# did_exec_fire?
|
51
|
+
#
|
52
|
+
# given the name of an Exec resource, parse the output from the most recent puppet run
|
53
|
+
# and return true/false based on whether the exec in question was fired
|
54
|
+
def did_exec_fire?(resource_name, puppet_run = self.last_puppet_run)
|
55
|
+
# Notice: /Stage[main]//Exec[foo]/returns: executed successfully
|
56
|
+
# Error: /Stage[main]//Exec[bar]/returns: change from notrun to 0 failed: Could not find command '/bin/bar'
|
57
|
+
matchers = [
|
58
|
+
'Notice: /Stage\[.*\]//Exec\[%s\]/returns: executed successfully',
|
59
|
+
'Error: /Stage\[.*\]//Exec\[%s\]/returns: change from notrun to 0 failed'
|
60
|
+
]
|
61
|
+
|
62
|
+
matchers.each do |m|
|
63
|
+
matcher = sprintf(m, resource_name)
|
64
|
+
return true if puppet_run.match(matcher)
|
65
|
+
end
|
66
|
+
|
67
|
+
false
|
68
|
+
end
|
69
|
+
|
49
70
|
##
|
50
71
|
# get_catalog
|
51
72
|
#
|
@@ -468,7 +489,7 @@ class Rouster
|
|
468
489
|
cmd << sprintf(' %s', opts[:additional_options]) unless opts[:additional_options].nil?
|
469
490
|
cmd << sprintf(' %s', file)
|
470
491
|
|
471
|
-
self.run(cmd, opts[:expected_exitcode])
|
492
|
+
self.last_puppet_run = self.run(cmd, opts[:expected_exitcode])
|
472
493
|
end
|
473
494
|
end
|
474
495
|
|
@@ -490,7 +511,7 @@ class Rouster
|
|
490
511
|
cmd << sprintf(' %s', opts[:additional_options]) unless opts[:additional_options].nil?
|
491
512
|
cmd << sprintf(' %s', m)
|
492
513
|
|
493
|
-
self.run(cmd, opts[:expected_exitcode])
|
514
|
+
self.last_puppet_run = self.run(cmd, opts[:expected_exitcode])
|
494
515
|
end
|
495
516
|
|
496
517
|
end
|
data/lib/rouster/testing.rb
CHANGED
@@ -581,13 +581,17 @@ class Rouster
|
|
581
581
|
|
582
582
|
when :address
|
583
583
|
lr = Array.new
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
local = ! lr.find{|e| e.true? }.nil? # this feels jankity
|
584
|
+
if ports[expectations[:protocol]][number]
|
585
|
+
addresses = ports[expectations[:protocol]][number][:address]
|
586
|
+
addresses.each_key do |address|
|
587
|
+
lr.push(address.eql?(v.to_s))
|
588
|
+
end
|
590
589
|
|
590
|
+
local = ! lr.find{|e| e.true? }.nil? # this feels jankity
|
591
|
+
else
|
592
|
+
# this port isn't open in the first place, won't match any addresses we expect to see it on
|
593
|
+
local = false
|
594
|
+
end
|
591
595
|
else
|
592
596
|
raise InternalError.new(sprintf('unknown expectation[%s / %s]', k, v))
|
593
597
|
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require sprintf('%s/../../../path_helper', File.dirname(File.expand_path(__FILE__)))
|
2
|
+
|
3
|
+
require 'rouster'
|
4
|
+
require 'rouster/puppet'
|
5
|
+
require 'rouster/testing'
|
6
|
+
require 'test/unit'
|
7
|
+
|
8
|
+
class TestValidateFileFunctional < Test::Unit::TestCase
|
9
|
+
|
10
|
+
# TODO this should probably be further abstracted into the implementation, but this is fine for now
|
11
|
+
FLAG_FILES = {
|
12
|
+
:ubuntu => '/etc/os-release', # debian too
|
13
|
+
:solaris => '/etc/release',
|
14
|
+
:redhat => '/etc/redhat-release', # centos too
|
15
|
+
:osx => '/System/Library/CoreServices/SystemVersion.plist',
|
16
|
+
}
|
17
|
+
|
18
|
+
def setup
|
19
|
+
# expose private methods
|
20
|
+
Rouster.send(:public, *Rouster.private_instance_methods)
|
21
|
+
Rouster.send(:public, *Rouster.protected_instance_methods)
|
22
|
+
|
23
|
+
@app = Rouster.new(:name => 'app')
|
24
|
+
end
|
25
|
+
|
26
|
+
def teardown
|
27
|
+
# put the flag file back in place
|
28
|
+
FLAG_FILES.each_pair do |_os, ff|
|
29
|
+
bkup = sprintf('%s.bkup', ff)
|
30
|
+
if @app.is_file?(bkup)
|
31
|
+
@app.run(sprintf('mv %s %s', bkup, ff))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_happy_path
|
37
|
+
|
38
|
+
type = @app.os_type
|
39
|
+
assert_not_nil(type, sprintf('unable to determine vm[%s] OS', @app))
|
40
|
+
assert_not_equal(:invalid, type)
|
41
|
+
|
42
|
+
assert_nothing_raised do
|
43
|
+
@app.get_services
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_unhappy_path
|
49
|
+
# move the flag file out of the way
|
50
|
+
FLAG_FILES.each_pair do |_os, ff|
|
51
|
+
if @app.is_file?(ff)
|
52
|
+
@app.run(sprintf('mv %s %s.bkup', ff, ff))
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
type = @app.os_type
|
57
|
+
|
58
|
+
assert_equal(:invalid, type, sprintf('got wrong value for unmarked OS[%s]', type))
|
59
|
+
|
60
|
+
e = assert_raise do
|
61
|
+
@app.get_services
|
62
|
+
end
|
63
|
+
|
64
|
+
assert_equal(Rouster::InternalError, e.class, sprintf('wrong exception raised[%s] [%s]', e.class, e.message))
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
[0;36mDebug: Creating default schedules[0m
|
2
|
+
[0;36mDebug: Using settings: adding file resource 'clientyamldir': 'File[/home/vagrant/.puppet/var/client_yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/var/client_yaml"}'[0m
|
3
|
+
[0;36mDebug: Using settings: adding file resource 'lastrunreport': 'File[/home/vagrant/.puppet/var/state/last_run_report.yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :backup=>false, :mode=>"640", :path=>"/home/vagrant/.puppet/var/state/last_run_report.yaml"}'[0m
|
4
|
+
[0;36mDebug: Using settings: adding file resource 'confdir': 'File[/home/vagrant/.puppet]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet"}'[0m
|
5
|
+
[0;36mDebug: Using settings: adding file resource 'ssldir': 'File[/home/vagrant/.puppet/ssl]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"771", :path=>"/home/vagrant/.puppet/ssl"}'[0m
|
6
|
+
[0;36mDebug: Using settings: adding file resource 'privatekeydir': 'File[/home/vagrant/.puppet/ssl/private_keys]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/ssl/private_keys"}'[0m
|
7
|
+
[0;36mDebug: Using settings: adding file resource 'client_datadir': 'File[/home/vagrant/.puppet/var/client_data]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/var/client_data"}'[0m
|
8
|
+
[0;36mDebug: Using settings: adding file resource 'statedir': 'File[/home/vagrant/.puppet/var/state]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"1755", :path=>"/home/vagrant/.puppet/var/state"}'[0m
|
9
|
+
[0;36mDebug: Using settings: adding file resource 'vardir': 'File[/home/vagrant/.puppet/var]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/var"}'[0m
|
10
|
+
[0;36mDebug: Using settings: adding file resource 'libdir': 'File[/home/vagrant/.puppet/var/lib]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/var/lib"}'[0m
|
11
|
+
[0;36mDebug: Using settings: adding file resource 'publickeydir': 'File[/home/vagrant/.puppet/ssl/public_keys]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/ssl/public_keys"}'[0m
|
12
|
+
[0;36mDebug: Using settings: adding file resource 'rundir': 'File[/home/vagrant/.puppet/var/run]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"755", :path=>"/home/vagrant/.puppet/var/run"}'[0m
|
13
|
+
[0;36mDebug: Using settings: adding file resource 'privatedir': 'File[/home/vagrant/.puppet/ssl/private]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/ssl/private"}'[0m
|
14
|
+
[0;36mDebug: Using settings: adding file resource 'statefile': 'File[/home/vagrant/.puppet/var/state/state.yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :backup=>false, :mode=>"660", :path=>"/home/vagrant/.puppet/var/state/state.yaml"}'[0m
|
15
|
+
[0;36mDebug: Using settings: adding file resource 'clientbucketdir': 'File[/home/vagrant/.puppet/var/clientbucket]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/var/clientbucket"}'[0m
|
16
|
+
[0;36mDebug: Using settings: adding file resource 'lastrunfile': 'File[/home/vagrant/.puppet/var/state/last_run_summary.yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :backup=>false, :mode=>"644", :path=>"/home/vagrant/.puppet/var/state/last_run_summary.yaml"}'[0m
|
17
|
+
[0;36mDebug: Using settings: adding file resource 'logdir': 'File[/home/vagrant/.puppet/var/log]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/var/log"}'[0m
|
18
|
+
[0;36mDebug: Using settings: adding file resource 'certdir': 'File[/home/vagrant/.puppet/ssl/certs]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/ssl/certs"}'[0m
|
19
|
+
[0;36mDebug: Using settings: adding file resource 'graphdir': 'File[/home/vagrant/.puppet/var/state/graphs]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/var/state/graphs"}'[0m
|
20
|
+
[0;36mDebug: Using settings: adding file resource 'requestdir': 'File[/home/vagrant/.puppet/ssl/certificate_requests]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/ssl/certificate_requests"}'[0m
|
21
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var]: Autorequiring File[/home/vagrant/.puppet][0m
|
22
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl/certs]: Autorequiring File[/home/vagrant/.puppet/ssl][0m
|
23
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/state]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
24
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/state/graphs]: Autorequiring File[/home/vagrant/.puppet/var/state][0m
|
25
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/state/last_run_report.yaml]: Autorequiring File[/home/vagrant/.puppet/var/state][0m
|
26
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/run]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
27
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl/certificate_requests]: Autorequiring File[/home/vagrant/.puppet/ssl][0m
|
28
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl]: Autorequiring File[/home/vagrant/.puppet][0m
|
29
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/state/last_run_summary.yaml]: Autorequiring File[/home/vagrant/.puppet/var/state][0m
|
30
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl/private_keys]: Autorequiring File[/home/vagrant/.puppet/ssl][0m
|
31
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/client_data]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
32
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/client_yaml]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
33
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/clientbucket]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
34
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl/private]: Autorequiring File[/home/vagrant/.puppet/ssl][0m
|
35
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl/public_keys]: Autorequiring File[/home/vagrant/.puppet/ssl][0m
|
36
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/log]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
37
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/state/state.yaml]: Autorequiring File[/home/vagrant/.puppet/var/state][0m
|
38
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/lib]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
39
|
+
[0;36mDebug: Finishing transaction 69859761088440[0m
|
40
|
+
[0;36mDebug: Loaded state in 0.00 seconds[0m
|
41
|
+
[0;36mDebug: Loaded state in 0.00 seconds[0m
|
42
|
+
[0;32mInfo: Applying configuration version '1427151219'[0m
|
43
|
+
[0;36mDebug: /Schedule[daily]: Skipping device resources because running on a host[0m
|
44
|
+
[0;36mDebug: /Schedule[monthly]: Skipping device resources because running on a host[0m
|
45
|
+
[0;36mDebug: /Schedule[hourly]: Skipping device resources because running on a host[0m
|
46
|
+
[1;31mError: Could not find command '/bin/bar'[0m
|
47
|
+
[1;31mError: /Stage[main]//Exec[bar]/returns: change from notrun to 0 failed: Could not find command '/bin/bar'[0m
|
48
|
+
[0;36mDebug: /Schedule[never]: Skipping device resources because running on a host[0m
|
49
|
+
[0;36mDebug: /Schedule[weekly]: Skipping device resources because running on a host[0m
|
50
|
+
[0;36mDebug: /Schedule[puppet]: Skipping device resources because running on a host[0m
|
51
|
+
[0;36mDebug: Class[Main]: The container Stage[main] will propagate my refresh event[0m
|
52
|
+
[0;36mDebug: Finishing transaction 69859760392420[0m
|
53
|
+
[0;36mDebug: Storing state[0m
|
54
|
+
[0;36mDebug: Stored state in 0.01 seconds[0m
|
55
|
+
[mNotice: Finished catalog run in 0.10 seconds[0m
|
56
|
+
[0;36mDebug: Using settings: adding file resource 'rrddir': 'File[/home/vagrant/.puppet/var/rrd]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/var/rrd"}'[0m
|
57
|
+
[0;36mDebug: Finishing transaction 69859760156920[0m
|
58
|
+
[0;36mDebug: Received report to process from centos6.internal.salesforce.com[0m
|
59
|
+
[0;36mDebug: Processing report from centos6.internal.salesforce.com with processor Puppet::Reports::Store[0m
|
@@ -0,0 +1,61 @@
|
|
1
|
+
[0;36mDebug: Creating default schedules[0m
|
2
|
+
[0;36mDebug: Using settings: adding file resource 'clientyamldir': 'File[/home/vagrant/.puppet/var/client_yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/var/client_yaml"}'[0m
|
3
|
+
[0;36mDebug: Using settings: adding file resource 'lastrunreport': 'File[/home/vagrant/.puppet/var/state/last_run_report.yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :backup=>false, :mode=>"640", :path=>"/home/vagrant/.puppet/var/state/last_run_report.yaml"}'[0m
|
4
|
+
[0;36mDebug: Using settings: adding file resource 'confdir': 'File[/home/vagrant/.puppet]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet"}'[0m
|
5
|
+
[0;36mDebug: Using settings: adding file resource 'ssldir': 'File[/home/vagrant/.puppet/ssl]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"771", :path=>"/home/vagrant/.puppet/ssl"}'[0m
|
6
|
+
[0;36mDebug: Using settings: adding file resource 'privatekeydir': 'File[/home/vagrant/.puppet/ssl/private_keys]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/ssl/private_keys"}'[0m
|
7
|
+
[0;36mDebug: Using settings: adding file resource 'client_datadir': 'File[/home/vagrant/.puppet/var/client_data]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/var/client_data"}'[0m
|
8
|
+
[0;36mDebug: Using settings: adding file resource 'statedir': 'File[/home/vagrant/.puppet/var/state]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"1755", :path=>"/home/vagrant/.puppet/var/state"}'[0m
|
9
|
+
[0;36mDebug: Using settings: adding file resource 'vardir': 'File[/home/vagrant/.puppet/var]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/var"}'[0m
|
10
|
+
[0;36mDebug: Using settings: adding file resource 'libdir': 'File[/home/vagrant/.puppet/var/lib]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/var/lib"}'[0m
|
11
|
+
[0;36mDebug: Using settings: adding file resource 'publickeydir': 'File[/home/vagrant/.puppet/ssl/public_keys]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/ssl/public_keys"}'[0m
|
12
|
+
[0;36mDebug: Using settings: adding file resource 'rundir': 'File[/home/vagrant/.puppet/var/run]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"755", :path=>"/home/vagrant/.puppet/var/run"}'[0m
|
13
|
+
[0;36mDebug: Using settings: adding file resource 'privatedir': 'File[/home/vagrant/.puppet/ssl/private]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/ssl/private"}'[0m
|
14
|
+
[0;36mDebug: Using settings: adding file resource 'statefile': 'File[/home/vagrant/.puppet/var/state/state.yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :backup=>false, :mode=>"660", :path=>"/home/vagrant/.puppet/var/state/state.yaml"}'[0m
|
15
|
+
[0;36mDebug: Using settings: adding file resource 'clientbucketdir': 'File[/home/vagrant/.puppet/var/clientbucket]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/var/clientbucket"}'[0m
|
16
|
+
[0;36mDebug: Using settings: adding file resource 'lastrunfile': 'File[/home/vagrant/.puppet/var/state/last_run_summary.yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :backup=>false, :mode=>"644", :path=>"/home/vagrant/.puppet/var/state/last_run_summary.yaml"}'[0m
|
17
|
+
[0;36mDebug: Using settings: adding file resource 'logdir': 'File[/home/vagrant/.puppet/var/log]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/var/log"}'[0m
|
18
|
+
[0;36mDebug: Using settings: adding file resource 'certdir': 'File[/home/vagrant/.puppet/ssl/certs]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/ssl/certs"}'[0m
|
19
|
+
[0;36mDebug: Using settings: adding file resource 'graphdir': 'File[/home/vagrant/.puppet/var/state/graphs]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/var/state/graphs"}'[0m
|
20
|
+
[0;36mDebug: Using settings: adding file resource 'requestdir': 'File[/home/vagrant/.puppet/ssl/certificate_requests]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/home/vagrant/.puppet/ssl/certificate_requests"}'[0m
|
21
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var]: Autorequiring File[/home/vagrant/.puppet][0m
|
22
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl/certs]: Autorequiring File[/home/vagrant/.puppet/ssl][0m
|
23
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/state]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
24
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/state/graphs]: Autorequiring File[/home/vagrant/.puppet/var/state][0m
|
25
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/state/last_run_report.yaml]: Autorequiring File[/home/vagrant/.puppet/var/state][0m
|
26
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/run]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
27
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl/certificate_requests]: Autorequiring File[/home/vagrant/.puppet/ssl][0m
|
28
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl]: Autorequiring File[/home/vagrant/.puppet][0m
|
29
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/state/last_run_summary.yaml]: Autorequiring File[/home/vagrant/.puppet/var/state][0m
|
30
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl/private_keys]: Autorequiring File[/home/vagrant/.puppet/ssl][0m
|
31
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/client_data]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
32
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/client_yaml]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
33
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/clientbucket]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
34
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl/private]: Autorequiring File[/home/vagrant/.puppet/ssl][0m
|
35
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/ssl/public_keys]: Autorequiring File[/home/vagrant/.puppet/ssl][0m
|
36
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/log]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
37
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/state/state.yaml]: Autorequiring File[/home/vagrant/.puppet/var/state][0m
|
38
|
+
[0;36mDebug: /File[/home/vagrant/.puppet/var/lib]: Autorequiring File[/home/vagrant/.puppet/var][0m
|
39
|
+
[0;36mDebug: Finishing transaction 69859761088440[0m
|
40
|
+
[0;36mDebug: Loaded state in 0.00 seconds[0m
|
41
|
+
[0;36mDebug: Loaded state in 0.00 seconds[0m
|
42
|
+
[0;32mInfo: Applying configuration version '1427151219'[0m
|
43
|
+
[0;36mDebug: /Schedule[daily]: Skipping device resources because running on a host[0m
|
44
|
+
[0;36mDebug: /Schedule[monthly]: Skipping device resources because running on a host[0m
|
45
|
+
[0;36mDebug: /Schedule[hourly]: Skipping device resources because running on a host[0m
|
46
|
+
[0;36mDebug: Exec[foo](provider=posix): Executing '/bin/echo foo'[0m
|
47
|
+
[0;36mDebug: Executing '/bin/echo foo'[0m
|
48
|
+
[mNotice: /Stage[main]//Exec[foo]/returns: executed successfully[0m
|
49
|
+
[0;36mDebug: /Stage[main]//Exec[foo]: The container Class[Main] will propagate my refresh event[0m
|
50
|
+
[0;36mDebug: /Schedule[never]: Skipping device resources because running on a host[0m
|
51
|
+
[0;36mDebug: /Schedule[weekly]: Skipping device resources because running on a host[0m
|
52
|
+
[0;36mDebug: /Schedule[puppet]: Skipping device resources because running on a host[0m
|
53
|
+
[0;36mDebug: Class[Main]: The container Stage[main] will propagate my refresh event[0m
|
54
|
+
[0;36mDebug: Finishing transaction 69859760392420[0m
|
55
|
+
[0;36mDebug: Storing state[0m
|
56
|
+
[0;36mDebug: Stored state in 0.01 seconds[0m
|
57
|
+
[mNotice: Finished catalog run in 0.10 seconds[0m
|
58
|
+
[0;36mDebug: Using settings: adding file resource 'rrddir': 'File[/home/vagrant/.puppet/var/rrd]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"750", :path=>"/home/vagrant/.puppet/var/rrd"}'[0m
|
59
|
+
[0;36mDebug: Finishing transaction 69859760156920[0m
|
60
|
+
[0;36mDebug: Received report to process from centos6.internal.salesforce.com[0m
|
61
|
+
[0;36mDebug: Processing report from centos6.internal.salesforce.com with processor Puppet::Reports::Store[0m
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require sprintf('%s/../../../path_helper', File.dirname(File.expand_path(__FILE__)))
|
2
|
+
|
3
|
+
require 'rouster'
|
4
|
+
require 'rouster/puppet'
|
5
|
+
require 'test/unit'
|
6
|
+
|
7
|
+
# this is a unit test, no need for a real Rouster VM
|
8
|
+
|
9
|
+
class TestGetPuppetStar < Test::Unit::TestCase
|
10
|
+
|
11
|
+
def setup
|
12
|
+
assert_nothing_raised do
|
13
|
+
@app = Rouster.new(:name => 'app', :unittest => true)
|
14
|
+
end
|
15
|
+
|
16
|
+
# expose private methods
|
17
|
+
Rouster.send(:public, *Rouster.protected_instance_methods)
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_with_successful_exec
|
21
|
+
title = 'foo'
|
22
|
+
input = File.read(sprintf('%s/../../../test/unit/puppet/resources/puppet_run_with_successful_exec', File.dirname(File.expand_path(__FILE__))))
|
23
|
+
|
24
|
+
|
25
|
+
assert(@app.did_exec_fire?(title, input))
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_with_failed_exec
|
29
|
+
title = 'bar'
|
30
|
+
input = File.read(sprintf('%s/../../../test/unit/puppet/resources/puppet_run_with_failed_exec', File.dirname(File.expand_path(__FILE__))))
|
31
|
+
|
32
|
+
assert(@app.did_exec_fire?(title, input))
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_looking_for_nonexistent_exec
|
36
|
+
title = 'fizzbang'
|
37
|
+
input = File.read(sprintf('%s/../../../test/unit/puppet/resources/puppet_run_with_successful_exec', File.dirname(File.expand_path(__FILE__))))
|
38
|
+
|
39
|
+
assert_false(@app.did_exec_fire?(title, input))
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
44
|
+
|
@@ -91,6 +91,11 @@ class TestValidatePort < Test::Unit::TestCase
|
|
91
91
|
|
92
92
|
end
|
93
93
|
|
94
|
+
def test_negative_port_dne
|
95
|
+
assert_equal(false, @app.validate_port(4567, { :ensure => true, :address => '*' }))
|
96
|
+
assert_equal(false, @app.validate_port(4567, { :ensure => true, :address => '127.0.0.1' }))
|
97
|
+
end
|
98
|
+
|
94
99
|
def teardown
|
95
100
|
# noop
|
96
101
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rouster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.63'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Conor Horan-Kates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- test/basic.rb
|
142
142
|
- test/functional/deltas/test_get_crontab.rb
|
143
143
|
- test/functional/deltas/test_get_groups.rb
|
144
|
+
- test/functional/deltas/test_get_os.rb
|
144
145
|
- test/functional/deltas/test_get_packages.rb
|
145
146
|
- test/functional/deltas/test_get_ports.rb
|
146
147
|
- test/functional/deltas/test_get_services.rb
|
@@ -172,7 +173,10 @@ files:
|
|
172
173
|
- test/puppet/modules/role/manifests/ui.pp
|
173
174
|
- test/puppet/test_apply.rb
|
174
175
|
- test/tunnel_vs_scp.rb
|
176
|
+
- test/unit/puppet/resources/puppet_run_with_failed_exec
|
177
|
+
- test/unit/puppet/resources/puppet_run_with_successful_exec
|
175
178
|
- test/unit/puppet/test_get_puppet_star.rb
|
179
|
+
- test/unit/puppet/test_puppet_parsing.rb
|
176
180
|
- test/unit/test_generate_unique_mac.rb
|
177
181
|
- test/unit/test_new.rb
|
178
182
|
- test/unit/test_parse_ls_string.rb
|
@@ -209,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
213
|
version: 1.3.6
|
210
214
|
requirements: []
|
211
215
|
rubyforge_project: Rouster
|
212
|
-
rubygems_version: 2.4.
|
216
|
+
rubygems_version: 2.4.8
|
213
217
|
signing_key:
|
214
218
|
specification_version: 4
|
215
219
|
summary: Rouster is an abstraction layer for Vagrant
|