From a57649564bacc6cf7e82e8da8329f33ee0095431 Mon Sep 17 00:00:00 2001 From: alop Date: Thu, 9 May 2013 13:25:54 -0700 Subject: [PATCH] added some template content tests I set the volume_driver to RBD, and test out some of the defaults --- spec/api_spec.rb | 1 + spec/scheduler_spec.rb | 1 + spec/spec_helper.rb | 9 +++++++-- spec/volume_spec.rb | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/api_spec.rb b/spec/api_spec.rb index f98f235..af2f271 100644 --- a/spec/api_spec.rb +++ b/spec/api_spec.rb @@ -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 diff --git a/spec/scheduler_spec.rb b/spec/scheduler_spec.rb index ed88fce..4ef972f 100644 --- a/spec/scheduler_spec.rb +++ b/spec/scheduler_spec.rb @@ -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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bc56ad5..f6120f3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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 diff --git a/spec/volume_spec.rb b/spec/volume_spec.rb index 05bd5d1..e4f8b6f 100644 --- a/spec/volume_spec.rb +++ b/spec/volume_spec.rb @@ -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