added some template content tests

I set the volume_driver to RBD, and test out some of the defaults
This commit is contained in:
alop
2013-05-09 13:25:54 -07:00
parent 299b41415d
commit a57649564b
4 changed files with 10 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ describe "cinder::api" do
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
@node = @chef_run.node
@node.set["cinder"]["syslog"]["use"] = true
@node.set["cinder"]["volume"]["volume_driver"] = "cinder.volume.driver.RBDDriver"
@chef_run.converge "cinder::api"
end

View File

@@ -7,6 +7,7 @@ describe "cinder::scheduler" do
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
@node = @chef_run.node
@node.set["cinder"]["syslog"]["use"] = true
@node.set["cinder"]["volume"]["volume_driver"] = "cinder.volume.driver.RBDDriver"
@chef_run.converge "cinder::scheduler"
end

View File

@@ -44,8 +44,13 @@ def expect_creates_cinder_conf service, action=:restart
end
it "template contents" do
chef_run.node.set['cinder']['custom_template_banner'] = 'chef spec test'
expect(@file).to create_file_with_content '/etc/cinder/cinder.conf', 'chef spec test'
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "autogenerated"
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "logging.conf"
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "lock_path=/var/lock/cinder"
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "rbd_pool=rbd"
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "iscsi_helper=tgtadm"
expect(@chef_run).to create_file_with_content "/etc/cinder/cinder.conf", "RBDDriver"
end
it "notifies nova-api-ec2 restart" do

View File

@@ -7,6 +7,7 @@ describe "cinder::volume" do
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
@node = @chef_run.node
@node.set["cinder"]["syslog"]["use"] = true
@node.set["cinder"]["volume"]["volume_driver"] = "cinder.volume.driver.RBDDriver"
@chef_run.converge "cinder::volume"
end