|
@@ -4,7 +4,7 @@ require 'spec_helper'
|
|
|
describe 'apt::update', :type => :class do
|
|
|
context "when update['always']=true" do
|
|
|
#This should completely disable all of this logic. These tests are to guarantee that we don't somehow magically change the behavior.
|
|
|
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
|
|
|
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
|
|
|
let (:pre_condition) { "class{'::apt': update => {'always' => true},}" }
|
|
|
it 'should trigger an apt-get update run' do
|
|
|
#set the apt_update exec's refreshonly attribute to false
|
|
@@ -14,7 +14,7 @@ describe 'apt::update', :type => :class do
|
|
|
context "when apt::update['frequency'] has the value of #{update_frequency}" do
|
|
|
{ 'a recent run' => Time.now.to_i, 'we are due for a run' => 1406660561,'the update-success-stamp file does not exist' => -1 }.each_pair do |desc, factval|
|
|
|
context "and $::apt_update_last_success indicates #{desc}" do
|
|
|
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :apt_update_last_success => factval } }
|
|
|
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :apt_update_last_success => factval, :lsbdistcodename => 'wheezy' } }
|
|
|
let (:pre_condition) { "class{'::apt': update => {'always' => true, 'frequency' => '#{update_frequency}'}, }" }
|
|
|
it 'should trigger an apt-get update run' do
|
|
|
# set the apt_update exec's refreshonly attribute to false
|
|
@@ -22,7 +22,7 @@ describe 'apt::update', :type => :class do
|
|
|
end
|
|
|
end
|
|
|
context 'when $::apt_update_last_success is nil' do
|
|
|
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
|
|
|
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
|
|
|
let (:pre_condition) { "class{'::apt': update => {'always' => true, 'frequency' => '#{update_frequency}'}, }" }
|
|
|
it 'should trigger an apt-get update run' do
|
|
|
#set the apt_update exec\'s refreshonly attribute to false
|
|
@@ -38,7 +38,7 @@ describe 'apt::update', :type => :class do
|
|
|
context "and apt::update['frequency']='always'" do
|
|
|
{ 'a recent run' => Time.now.to_i, 'we are due for a run' => 1406660561,'the update-success-stamp file does not exist' => -1 }.each_pair do |desc, factval|
|
|
|
context "and $::apt_update_last_success indicates #{desc}" do
|
|
|
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :apt_update_last_success => factval } }
|
|
|
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :apt_update_last_success => factval, :lsbdistcodename => 'wheezy' } }
|
|
|
let (:pre_condition) { "class{'::apt': update => {'always' => false, 'frequency' => 'always' },}" }
|
|
|
it 'should trigger an apt-get update run' do
|
|
|
#set the apt_update exec's refreshonly attribute to false
|
|
@@ -47,7 +47,7 @@ describe 'apt::update', :type => :class do
|
|
|
end
|
|
|
end
|
|
|
context 'when $::apt_update_last_success is nil' do
|
|
|
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
|
|
|
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
|
|
|
let (:pre_condition) { "class{ '::apt': update => {'always' => false, 'frequency' => 'always' },}" }
|
|
|
it 'should trigger an apt-get update run' do
|
|
|
#set the apt_update exec\'s refreshonly attribute to false
|
|
@@ -58,7 +58,7 @@ describe 'apt::update', :type => :class do
|
|
|
context "and apt::update['frequency']='reluctantly'" do
|
|
|
{'a recent run' => Time.now.to_i, 'we are due for a run' => 1406660561,'the update-success-stamp file does not exist' => -1 }.each_pair do |desc, factval|
|
|
|
context "and $::apt_update_last_success indicates #{desc}" do
|
|
|
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :apt_update_last_success => factval} }
|
|
|
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :apt_update_last_success => factval, :lsbdistcodename => 'wheezy'} }
|
|
|
let (:pre_condition) { "class{ '::apt': update => {'always' => false, 'frequency' => 'reluctantly' },}" }
|
|
|
it 'should not trigger an apt-get update run' do
|
|
|
#don't change the apt_update exec's refreshonly attribute. (it should be true)
|
|
@@ -67,7 +67,7 @@ describe 'apt::update', :type => :class do
|
|
|
end
|
|
|
end
|
|
|
context 'when $::apt_update_last_success is nil' do
|
|
|
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
|
|
|
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
|
|
|
let (:pre_condition) { "class{ '::apt': update => {'always' => false, 'frequency' => 'reluctantly' },}" }
|
|
|
it 'should not trigger an apt-get update run' do
|
|
|
#don't change the apt_update exec's refreshonly attribute. (it should be true)
|
|
@@ -79,7 +79,7 @@ describe 'apt::update', :type => :class do
|
|
|
context "and apt::update['frequency'] has the value of #{update_frequency}" do
|
|
|
{ 'we are due for a run' => 1406660561,'the update-success-stamp file does not exist' => -1 }.each_pair do |desc, factval|
|
|
|
context "and $::apt_update_last_success indicates #{desc}" do
|
|
|
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :apt_update_last_success => factval } }
|
|
|
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :apt_update_last_success => factval, :lsbdistcodename => 'wheezy' } }
|
|
|
let (:pre_condition) { "class{ '::apt': update => {'always' => false, 'frequency' => '#{update_frequency}',} }" }
|
|
|
it 'should trigger an apt-get update run' do
|
|
|
#set the apt_update exec\'s refreshonly attribute to false
|
|
@@ -88,7 +88,7 @@ describe 'apt::update', :type => :class do
|
|
|
end
|
|
|
end
|
|
|
context 'when the $::apt_update_last_success fact has a recent value' do
|
|
|
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :apt_update_last_success => Time.now.to_i } }
|
|
|
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy', :apt_update_last_success => Time.now.to_i } }
|
|
|
let (:pre_condition) { "class{ '::apt': update => {'always' => false, 'frequency' => '#{update_frequency}',} }" }
|
|
|
it 'should not trigger an apt-get update run' do
|
|
|
#don't change the apt_update exec\'s refreshonly attribute. (it should be true)
|
|
@@ -96,7 +96,7 @@ describe 'apt::update', :type => :class do
|
|
|
end
|
|
|
end
|
|
|
context 'when $::apt_update_last_success is nil' do
|
|
|
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
|
|
|
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy', :apt_update_last_success => nil } }
|
|
|
let (:pre_condition) { "class{ '::apt': update => {'always' => false, 'frequency' => '#{update_frequency}',} }" }
|
|
|
it 'should trigger an apt-get update run' do
|
|
|
#set the apt_update exec\'s refreshonly attribute to false
|