diff options
-rw-r--r-- | manifests/params.pp | 2 | ||||
-rw-r--r-- | manifests/reboot_required_notify.pp | 2 | ||||
-rw-r--r-- | spec/classes/init_spec.rb | 17 | ||||
-rw-r--r-- | spec/defines/conf_spec.rb | 17 | ||||
-rw-r--r-- | spec/defines/preferences_snippet_spec.rb | 17 | ||||
-rw-r--r-- | spec/unit/custom_facts_spec.rb | 38 |
6 files changed, 60 insertions, 33 deletions
diff --git a/manifests/params.pp b/manifests/params.pp index 3879c81..b67a85a 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -6,7 +6,7 @@ class apt::params () { $use_next_release = false $manage_preferences = true $custom_preferences = undef - $debian_url = 'http://httpredir.debian.org/debian/' + $debian_url = 'http://deb.debian.org/debian/' $security_url = 'http://security.debian.org/' $ubuntu_url = 'http://archive.ubuntu.com/ubuntu' $lts_url = $debian_url diff --git a/manifests/reboot_required_notify.pp b/manifests/reboot_required_notify.pp index 3463bb4..a538c9a 100644 --- a/manifests/reboot_required_notify.pp +++ b/manifests/reboot_required_notify.pp @@ -1,6 +1,6 @@ class apt::reboot_required_notify { - if versioncmp($::operatingsystemmajrelease, 8) >= 0 { + if versioncmp($::operatingsystemmajrelease, '8') >= 0 { class { 'apt::reboot_required_notify::jessie': } # Clean up systems that were upgraded from Wheezy or earlier: class { 'apt::reboot_required_notify::wheezy': ensure => absent } diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 9ba554f..a3f19a0 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -5,14 +5,15 @@ describe 'apt', :type => :class do 'class { "apt": }' end let(:facts) { { - :lsbdistid => 'Debian', - :osfamily => 'Debian', - :operatingsystem => 'Debian', - :debian_release => 'jessie', - :debian_codename => 'jessie', - :lsbdistcodename => 'jessie', - :virtual => 'physical', - :puppetversion => Puppet.version, } } + :lsbdistid => 'Debian', + :osfamily => 'Debian', + :operatingsystem => 'Debian', + :debian_release => 'jessie', + :debian_codename => 'jessie', + :lsbdistcodename => 'jessie', + :debian_nextcodename => 'stretch', + :virtual => 'physical', + :puppetversion => Puppet.version, } } #it { is_expected.to compile.with_all_deps } it { is_expected.to compile } end diff --git a/spec/defines/conf_spec.rb b/spec/defines/conf_spec.rb index cc4fb1f..167b249 100644 --- a/spec/defines/conf_spec.rb +++ b/spec/defines/conf_spec.rb @@ -4,14 +4,15 @@ describe 'apt::apt_conf', :type => :define do 'class { "apt": }' end let(:facts) { { - :lsbdistid => 'Debian', - :osfamily => 'Debian', - :operatingsystem => 'Debian', - :debian_release => 'jessie', - :debian_codename => 'jessie', - :lsbdistcodename => 'jessie', - :virtual => 'physical', - :puppetversion => Puppet.version, } } + :lsbdistid => 'Debian', + :osfamily => 'Debian', + :operatingsystem => 'Debian', + :debian_release => 'jessie', + :debian_codename => 'jessie', + :lsbdistcodename => 'jessie', + :debian_nextcodename => 'stretch', + :virtual => 'physical', + :puppetversion => Puppet.version, } } let :title do 'norecommends' end diff --git a/spec/defines/preferences_snippet_spec.rb b/spec/defines/preferences_snippet_spec.rb index 012a5f6..6b1a23f 100644 --- a/spec/defines/preferences_snippet_spec.rb +++ b/spec/defines/preferences_snippet_spec.rb @@ -4,14 +4,15 @@ describe 'apt::preferences_snippet', :type => :define do 'class { "apt": }' end let(:facts) { { - :lsbdistid => 'Debian', - :osfamily => 'Debian', - :operatingsystem => 'Debian', - :debian_release => 'jessie', - :debian_codename => 'jessie', - :lsbdistcodename => 'jessie', - :virtual => 'physical', - :puppetversion => Puppet.version, } } + :lsbdistid => 'Debian', + :osfamily => 'Debian', + :operatingsystem => 'Debian', + :debian_release => 'jessie', + :debian_codename => 'jessie', + :lsbdistcodename => 'jessie', + :debian_nextcodename => 'stretch', + :virtual => 'physical', + :puppetversion => Puppet.version, } } let :title do 'test' end diff --git a/spec/unit/custom_facts_spec.rb b/spec/unit/custom_facts_spec.rb index 9a28d92..c24b376 100644 --- a/spec/unit/custom_facts_spec.rb +++ b/spec/unit/custom_facts_spec.rb @@ -14,8 +14,8 @@ describe "Facter::Util::Fact" do Facter.fact(:lsbdistcodename).stubs(:value).returns("wheezy") end - it "debian_release = oldstable" do - expect(Facter.fact(:debian_release).value).to eq('oldstable') + it "debian_release = oldoldstable" do + expect(Facter.fact(:debian_release).value).to eq('oldoldstable') end it "debian_codename = wheezy" do @@ -26,8 +26,8 @@ describe "Facter::Util::Fact" do expect(Facter.fact(:debian_nextcodename).value).to eq('jessie') end - it "debian_nextrelease = stable" do - expect(Facter.fact(:debian_nextrelease).value).to eq('stable') + it "debian_nextrelease = oldstable" do + expect(Facter.fact(:debian_nextrelease).value).to eq('oldstable') end end @@ -38,8 +38,8 @@ describe "Facter::Util::Fact" do Facter.fact(:lsbdistcodename).stubs(:value).returns("jessie") end - it "debian_release = stable" do - expect(Facter.fact(:debian_release).value).to eq('stable') + it "debian_release = oldstable" do + expect(Facter.fact(:debian_release).value).to eq('oldstable') end it "debian_codename = jessie" do @@ -50,7 +50,31 @@ describe "Facter::Util::Fact" do expect(Facter.fact(:debian_nextcodename).value).to eq('stretch') end - it "debian_nextrelease = testing" do + it "debian_nextrelease = stable" do + expect(Facter.fact(:debian_nextrelease).value).to eq('stable') + end + end + + context 'Debian 9' do + before do + Facter.fact(:operatingsystem).stubs(:value).returns("Debian") + Facter.fact(:operatingsystemrelease).stubs(:value).returns("9.0") + Facter.fact(:lsbdistcodename).stubs(:value).returns("stretch") + end + + it "debian_release = stable" do + expect(Facter.fact(:debian_release).value).to eq('stable') + end + + it "debian_codename = stretch" do + expect(Facter.fact(:debian_codename).value).to eq('stretch') + end + + it "debian_nextcodename = stretch" do + expect(Facter.fact(:debian_nextcodename).value).to eq('buster') + end + + it "debian_nextrelease = stable" do expect(Facter.fact(:debian_nextrelease).value).to eq('testing') end end |