Merge pull request #58 from alop/spec-template

Spec template
This commit is contained in:
John Dewey 2013-05-09 15:06:35 -07:00
commit 6ffe37b361
5 changed files with 23 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
@ -61,7 +62,9 @@ describe "cinder::api" do
end
it "template contents" do
pending "TODO: implement"
expect(@chef_run).to create_file_with_content "/etc/cinder/api-paste.ini", "autogenerated"
expect(@chef_run).to create_file_with_content "/etc/cinder/api-paste.ini", "service"
expect(@chef_run).not_to create_file_with_content "/etc/cinder/api-paste.ini", "signing_dir"
end
it "notifies nova-api-ec2 restart" do

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

@ -46,7 +46,14 @@ def expect_creates_cinder_conf service, action=:restart
end
it "template contents" do
pending "TODO: implement"
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"
expect(@chef_run).not_to create_file_with_content "/etc/cinder/cinder.conf", "NetAppISCSIDriver"
end
it "notifies nova-api-ec2 restart" do

View File

@ -29,5 +29,9 @@ describe "cinder::volume" do
it "starts iscsi target on boot" do
expect(@chef_run).to set_service_to_start_on_boot "tgtd"
end
it "has different tgt" do
expect(@chef_run).to create_file_with_content "/etc/tgt/targets.conf", "/var/lib/cinder/volumes"
end
end
end

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
@ -47,6 +48,11 @@ describe "cinder::volume" do
it "notifies nova-api-ec2 restart" do
expect(@file).to notify "service[iscsitarget]", :restart
end
it "template contents" do
expect(@chef_run).to create_file_with_content "/etc/tgt/targets.conf", "autogenerated"
expect(@chef_run).to create_file_with_content "/etc/tgt/targets.conf", "/etc/tgt/conf.d"
end
end
describe "patches" do