Please review pull request #421: Bug/2.7.x/12188 pid handling warning cleanup opened by (daniel-pittman)
Description:
When I changed the testing for the PID file system I neglected to check that
Win32 would work; this makes sure the path used is absolute for the platform
the specs run on, fixing that problem.
Signed-off-by: Daniel Pittman [email protected]
- Opened: Sat Jan 28 02:09:07 UTC 2012
- Based on: puppetlabs:2.7.x (6f394cb38d8c5602cce3e1224e4a0f74e19370fd)
- Requested merge: daniel-pittman:bug/2.7.x/12188-pid-handling-warning-cleanup (289dddcaec5c50ded1f79c978c95c2fdac4e1f09)
Diff follows:
diff --git a/spec/unit/daemon_spec.rb b/spec/unit/daemon_spec.rb
index 9eedef7..3788a0a 100755
--- a/spec/unit/daemon_spec.rb
+++ b/spec/unit/daemon_spec.rb
@@ -10,6 +10,8 @@ def without_warnings
end
describe Puppet::Daemon do
+ include PuppetSpec::Files
+
before do
@daemon = Puppet::Daemon.new
end
@@ -141,9 +143,9 @@ def without_warnings
pidfile = mock 'pidfile'
Puppet.settings.stubs(:value).with(:name).returns "eh"
- Puppet.settings.expects(:value).with(:pidfile).returns "/my/file"
+ Puppet.settings.expects(:value).with(:pidfile).returns make_absolute("/my/file")
- Puppet::Util::Pidlock.expects(:new).with("/my/file").returns pidfile
+ Puppet::Util::Pidlock.expects(:new).with(make_absolute("/my/file")).returns pidfile
pidfile.expects(:lock).returns true
@daemon.create_pidfile
@@ -153,9 +155,9 @@ def without_warnings
pidfile = mock 'pidfile'
Puppet.settings.stubs(:value).with(:name).returns "eh"
- Puppet.settings.stubs(:value).with(:pidfile).returns "/my/file"
+ Puppet.settings.stubs(:value).with(:pidfile).returns make_absolute("/my/file")
- Puppet::Util::Pidlock.expects(:new).with("/my/file").returns pidfile
+ Puppet::Util::Pidlock.expects(:new).with(make_absolute("/my/file")).returns pidfile
pidfile.expects(:lock).returns false
@@ -175,8 +177,8 @@ def without_warnings
it "should do nothing if the pidfile is not present" do
pidfile = mock 'pidfile', :unlock => false
- Puppet[:pidfile] = "/my/file"
- Puppet::Util::Pidlock.expects(:new).with("/my/file").returns pidfile
+ Puppet[:pidfile] = make_absolute("/my/file")
+ Puppet::Util::Pidlock.expects(:new).with(make_absolute("/my/file")).returns pidfile
@daemon.remove_pidfile
end
@@ -184,8 +186,8 @@ def without_warnings
it "should unlock the pidfile using the Pidlock class" do
pidfile = mock 'pidfile', :unlock => true
- Puppet[:pidfile] = "/my/file"
- Puppet::Util::Pidlock.expects(:new).with("/my/file").returns pidfile
+ Puppet[:pidfile] = make_absolute("/my/file")
+ Puppet::Util::Pidlock.expects(:new).with(make_absolute("/my/file")).returns pidfile
@daemon.remove_pidfile
end
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
