Open kadishmal opened 11 years ago
I believe there are two issues here.
@stevendanna Is there a way to tell minitest to use a different provider, if you know for example that its an upstart service instead of lsbinit or whatever?
@ppgengler We had this issue with vmware tools which uses upstart on RH6 and init on RH5. The code in our test looks like this:
if Chef::VersionConstraint.new(">= 6.0").include?(node['platform_version'])
result = assert_sh("/sbin/status vmware-tools-services")
assert_includes result, "start/running"
else
service("vmware-tools-services").must_be_running
end
@ppgengler An alternative to something like superted mentioned would be something like:
https://github.com/opscode-cookbooks/chef-client/pull/115/files
^ Definitely a cleaner method.
That's cool, although I'll admit I was hoping for something on the minitest-chef-handler side like:
service('foobar', :provider => Chef::Provider::Service::Upstart).must_be_running
That did that work for me; perhaps even took symbols like :upstart
and translated into the providers. I'll poke around and contemplate a PR for it, if you're open?
:+1: @ppgengler that syntax looks ideal to me
I have the following assertion test in
test/cookbooks/cubrid_test/files/default/tests/minitest/default_test.rb
file.Running it CentOS 6.4 x64 Vagrant box via Test Kitchen returned the following failure:
If I login to this CentOS Vagrant box, I can confirm that the service is running:
Running Kitchen test on Ubuntu 10+ Vagrant boxes, passes all tests.