]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - 3rdparty/modules/glance/spec/classes/glance_backend_rbd_spec.rb
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / glance / spec / classes / glance_backend_rbd_spec.rb
diff --git a/3rdparty/modules/glance/spec/classes/glance_backend_rbd_spec.rb b/3rdparty/modules/glance/spec/classes/glance_backend_rbd_spec.rb
new file mode 100644 (file)
index 0000000..b843ac6
--- /dev/null
@@ -0,0 +1,46 @@
+require 'spec_helper'
+
+describe 'glance::backend::rbd' do
+  let :facts do
+    {
+      :osfamily => 'Debian'
+    }
+  end
+
+  describe 'when defaults with rbd_store_user' do
+    let :params do
+      {
+        :rbd_store_user  => 'glance',
+      }
+    end
+
+    it { should contain_glance_api_config('glance_store/default_store').with_value('rbd') }
+    it { should contain_glance_api_config('glance_store/rbd_store_pool').with_value('images') }
+    it { should contain_glance_api_config('glance_store/rbd_store_ceph_conf').with_value('/etc/ceph/ceph.conf') }
+    it { should contain_glance_api_config('glance_store/rbd_store_chunk_size').with_value('8') }
+
+
+    it { should contain_package('python-ceph').with(
+        :name   => 'python-ceph',
+        :ensure => 'present'
+      )
+    }
+  end
+
+  describe 'when passing params' do
+    let :params do
+      {
+        :rbd_store_user        => 'user',
+        :rbd_store_chunk_size  => '2',
+        :package_ensure        => 'latest',
+      }
+    end
+    it { should contain_glance_api_config('glance_store/rbd_store_user').with_value('user') }
+    it { should contain_glance_api_config('glance_store/rbd_store_chunk_size').with_value('2') }
+    it { should contain_package('python-ceph').with(
+        :name   => 'python-ceph',
+        :ensure => 'latest'
+      )
+    }
+  end
+end