]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - 3rdparty/modules/cinder/spec/defines/cinder_backend_iscsi_spec.rb
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / cinder / spec / defines / cinder_backend_iscsi_spec.rb
diff --git a/3rdparty/modules/cinder/spec/defines/cinder_backend_iscsi_spec.rb b/3rdparty/modules/cinder/spec/defines/cinder_backend_iscsi_spec.rb
new file mode 100644 (file)
index 0000000..1006d74
--- /dev/null
@@ -0,0 +1,50 @@
+require 'spec_helper'
+
+describe 'cinder::backend::iscsi' do
+
+  let(:title) {'hippo'}
+
+  let :req_params do {
+    :iscsi_ip_address => '127.0.0.2',
+    :iscsi_helper => 'tgtadm',
+  }
+  end
+
+  let :facts do
+    {:osfamily => 'Debian'}
+  end
+
+  let :params do
+    req_params
+  end
+
+  describe 'with default params' do
+
+    it 'should configure iscsi driver' do
+      should contain_cinder_config('hippo/volume_backend_name').with(
+        :value => 'hippo')
+      should contain_cinder_config('hippo/volume_driver').with(
+        :value => 'cinder.volume.drivers.lvm.LVMISCSIDriver')
+      should contain_cinder_config('hippo/iscsi_ip_address').with(
+        :value => '127.0.0.2')
+      should contain_cinder_config('hippo/iscsi_helper').with(
+        :value => 'tgtadm')
+      should contain_cinder_config('hippo/volume_group').with(
+        :value => 'cinder-volumes')
+    end
+  end
+
+  describe 'with RedHat' do
+
+    let :facts do
+      {:osfamily => 'RedHat'}
+    end
+
+    it { should contain_file_line('cinder include').with(
+      :line => 'include /etc/cinder/volumes/*',
+      :path => '/etc/tgt/targets.conf'
+    ) }
+
+  end
+
+end