]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - 3rdparty/modules/keystone/spec/classes/keystone_cron_token_flush_spec.rb
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / keystone / spec / classes / keystone_cron_token_flush_spec.rb
diff --git a/3rdparty/modules/keystone/spec/classes/keystone_cron_token_flush_spec.rb b/3rdparty/modules/keystone/spec/classes/keystone_cron_token_flush_spec.rb
new file mode 100644 (file)
index 0000000..597042b
--- /dev/null
@@ -0,0 +1,68 @@
+require 'spec_helper'
+
+describe 'keystone::cron::token_flush' do
+
+  let :facts do
+    { :osfamily => 'Debian' }
+  end
+
+  describe 'with default parameters' do
+    it 'configures a cron' do
+      should contain_cron('keystone-manage token_flush').with(
+        :ensure      => 'present',
+        :command     => 'keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1',
+        :environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
+        :user        => 'keystone',
+        :minute      => 1,
+        :hour        => 0,
+        :monthday    => '*',
+        :month       => '*',
+        :weekday     => '*'
+      )
+    end
+  end
+
+  describe 'when specifying a maxdelay param' do
+    let :params do
+      {
+        :maxdelay => 600
+      }
+    end
+
+    it 'configures a cron with delay' do
+      should contain_cron('keystone-manage token_flush').with(
+        :ensure      => 'present',
+        :command     => 'sleep `expr ${RANDOM} \\% 600`; keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1',
+        :environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
+        :user        => 'keystone',
+        :minute      => 1,
+        :hour        => 0,
+        :monthday    => '*',
+        :month       => '*',
+        :weekday     => '*'
+      )
+    end
+  end
+
+  describe 'when specifying a maxdelay param' do
+    let :params do
+      {
+        :ensure => 'absent'
+      }
+    end
+
+    it 'configures a cron with delay' do
+      should contain_cron('keystone-manage token_flush').with(
+        :ensure      => 'absent',
+        :command     => 'keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1',
+        :environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
+        :user        => 'keystone',
+        :minute      => 1,
+        :hour        => 0,
+        :monthday    => '*',
+        :month       => '*',
+        :weekday     => '*'
+      )
+    end
+  end
+end