Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The file does not have the expected owner" (expected "root", actual: nil) #31

Closed
tknerr opened this issue Aug 28, 2012 · 3 comments
Closed

Comments

@tknerr
Copy link

tknerr commented Aug 28, 2012

Maybe I'm doing something wrong, but I get this error where I'd expect the tests to pass:

  1) Failure:
test_0001_should_create_the_root_owned_tmp_foo_file(foo::default) [/opt/ruby/lib/ruby/gems/1.9.1/gems/minitest-chef-handler-0.6.1/lib/minitest-chef-handler/resources.rb:33]:
The file does not have the expected owner.
Expected: "root"
  Actual: nil

My recipe looks like that:

file "/tmp/foo" do
  action :create
  owner "root"
  group "root"
  mode "0644"
  content "hey, I'm running on #{node['platform']}!"
end

And the minitest like that:

require 'minitest/spec'

describe 'foo::default' do

  include MiniTest::Chef::Assertions
  include MiniTest::Chef::Context
  include MiniTest::Chef::Resources

  it 'should create the root-owned "/tmp/foo" file' do
    file("/tmp/foo").must_exist.with(:owner, "root").and(:group, "root").and(:mode, "0644")
  end
end

Am I doing something plain wrong or should the test above pass?

I'm using minitest-chef-handler from within the minitest-handler 0.1.0 cookbook. The node to be converged runs Chef 0.10.10 with 1.9.2p290 system Ruby.

P.S.: my workstation from which I provision the node using Vagrant is a Windows 7 box, if that is of interest.

@tknerr
Copy link
Author

tknerr commented Aug 28, 2012

The file is actually created with the correct owner/group and permissions:

vagrant@foo-vm:~$ ll /tmp/foo
-rw-r--r-- 1 root root 27 Aug 28 09:39 /tmp/foo

@acrmp
Copy link
Contributor

acrmp commented Aug 28, 2012

Hi Torben,

This is a known bug with minitest-chef-handler and Chef 0.10.10. See #23 and #27 for more detail.

The related Chef ticket is here and a fix will be in Chef 10.14:
http://tickets.opscode.com/browse/CHEF-3235

Cheers,

Andrew.

@tknerr
Copy link
Author

tknerr commented Aug 28, 2012

Good to know, thanks Andrew!

Closing the issue then because it's a dup of #23 and #27

@tknerr tknerr closed this as completed Aug 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants