diff options
author | Louis-Philippe VĂ©ronneau <pollito@riseup.net> | 2017-08-23 19:28:13 +0000 |
---|---|---|
committer | Louis-Philippe VĂ©ronneau <pollito@riseup.net> | 2017-08-23 19:28:13 +0000 |
commit | 9e573dc12f4a0ae2f608ebdac03452a4ecc6c13d (patch) | |
tree | ecb6a642dcfd71e54df8096964118bbf24d5a07d /spec | |
parent | f3db3309f3a3fc5ee0f621593ed83805798f7890 (diff) | |
parent | 2472621c1c2e20c8fd8922674b83c6a815df1d38 (diff) |
Merge branch 'broken_release_checks' into 'master'
test: move release targets for debian
See merge request !65
Diffstat (limited to 'spec')
-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 |
4 files changed, 58 insertions, 31 deletions
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 |