Issue #5794 has been updated by Valdis Vitayaudom.
need help to validate testing should be committed for this change
diff --git a/spec/unit/reports/store_spec.rb
b/spec/unit/reports/store_spec.rb
index 1acb5ba..3ce9dab 100644
--- a/spec/unit/reports/store_spec.rb
+++ b/spec/unit/reports/store_spec.rb
@@ -2,12 +2,16 @@
Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ?
require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
+require 'puppet_spec/files'
require 'puppet/reports'
require 'time'
processor = Puppet::Reports.report(:store)
describe processor do
+
+ include PuppetSpec::Files
+
describe "#process" do
include PuppetSpec::Files
before :each do
@@ -28,4 +32,13 @@ describe processor do
File.read(File.join(Puppet[:reportdir], @report.host,
"201101061200.yaml")).should == @report.to_yaml
end
end
+
+ describe "#testdir" do
+ include PuppetSpec::Files
+ it "should create a report subdirectory for the client if one doesn't
exist" do
+ Puppet[:reportdir] = tmpdir("reports")
+ @report = YAML.load_file(File.join(PuppetSpec::FIXTURE_DIR,
'yaml/report2.6.x.yaml')).extend processor
+ File.should be_directory(File.join(Puppet[:reportdir], @report.host))
+ end
+ end
end
$ envpuppet rspec -c -f d spec/unit/reports/store_spec.rb
...
Failures:
1) Puppet::Reports::Store#testdir should create a report subdirectory for
the client if one doesn't exist
Failure/Error: File.should be_directory(File.join(Puppet[:reportdir],
@report.host))
expected
directory?("/tmp/reports20110305-5589-v6h0ld-0/ubuntu1004desktop.localdomain")
to return true, got false
# ./spec/unit/reports/store_spec.rb:41
Finished in 0.04665 seconds
3 examples, 1 failure
----------------------------------------
Bug #5794: puppet reports tries to create .../reports/$fqdn without creating
.../reports
https://projects.puppetlabs.com/issues/5794
Author: Daniel Pittman
Status: Accepted
Priority: Normal
Assignee:
Category:
Target version: 2.6.x
Affected Puppet version: development
Keywords:
Branch:
Found while testing `puppet apply` with `--vardir=/tmp --confdir=/tmp
--ssldir=/tmp`:
err: /File[/tmp/reports/centos55.local]/ensure: change from absent to
directory failed: Cannot create /tmp/reports/centos55.local; parent directory
/tmp/reports does not exist
err: Report store failed: Got 1 failure(s) while initializing: change from
absent to directory failed: Cannot create /tmp/reports/centos55.local; parent
directory /tmp/reports does not exist
It looks like puppet is not creating, or depending on, the reports directory
correctly when it tries to create the local reports directory during the run.
Found in:
commit 9b2b4aebed29f035415c1f7324943d3ba2993ea2
Merge: a2ff092 fb8509a
Author: Matt Robinson <[email protected]>
Date: Thu Dec 16 15:06:31 2010 -0800
Merge branch 'next'
* next:
maint: Fix ActiveRecord confine issue
maint: Fix a test that was missing a require
maint: Fix tests that don't run on their own
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" 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-bugs?hl=en.