summaryrefslogtreecommitdiff
path: root/files/puppet/modules/pixelated/spec/classes
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-02-09 10:05:07 +0100
committervarac <varacanero@zeromail.org>2017-02-09 10:05:07 +0100
commitf3eafa18540e84eb1673df6ff316ce453eb86429 (patch)
tree887dfda48190a1e5aa2e5e4af8d56535cfca7b3c /files/puppet/modules/pixelated/spec/classes
parent410cee61b6cf5b792b4c74493c0f699260c22743 (diff)
git subrepo clone --force https://github.com/pixelated/puppet-pixelated.git files/puppet/modules/pixelated
subrepo: subdir: "files/puppet/modules/pixelated" merged: "0b29fe6" upstream: origin: "https://github.com/pixelated/puppet-pixelated.git" branch: "master" commit: "0b29fe6" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "841aa43"
Diffstat (limited to 'files/puppet/modules/pixelated/spec/classes')
-rw-r--r--files/puppet/modules/pixelated/spec/classes/agent_spec.rb2
-rw-r--r--files/puppet/modules/pixelated/spec/classes/apt_preferences_spec.rb19
-rw-r--r--files/puppet/modules/pixelated/spec/classes/apt_spec.rb27
-rw-r--r--files/puppet/modules/pixelated/spec/classes/pixelated_spec.rb2
-rw-r--r--files/puppet/modules/pixelated/spec/classes/syslog_spec.rb2
5 files changed, 41 insertions, 11 deletions
diff --git a/files/puppet/modules/pixelated/spec/classes/agent_spec.rb b/files/puppet/modules/pixelated/spec/classes/agent_spec.rb
index f55be37..2ba956b 100644
--- a/files/puppet/modules/pixelated/spec/classes/agent_spec.rb
+++ b/files/puppet/modules/pixelated/spec/classes/agent_spec.rb
@@ -25,7 +25,7 @@ require 'spec_helper'
"define apache::vhost::file($content,$mod_security) {}",
"define apt::sources_list($content='deb url') {}",
"define apt::apt_conf($source='file url',$refresh_apt='true') {}",
- "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian') {}",
+ "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian',$package='*',$ensure='present') {}",
] }
it { should contain_class('pixelated::syslog') }
diff --git a/files/puppet/modules/pixelated/spec/classes/apt_preferences_spec.rb b/files/puppet/modules/pixelated/spec/classes/apt_preferences_spec.rb
index 778e739..8b071f1 100644
--- a/files/puppet/modules/pixelated/spec/classes/apt_preferences_spec.rb
+++ b/files/puppet/modules/pixelated/spec/classes/apt_preferences_spec.rb
@@ -12,15 +12,20 @@ describe 'pixelated::apt::preferences' do
let(:pre_condition) { [
"class apt {}",
"define apt::sources_list($content='deb url') {}",
- "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian') {}",
+ "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian',$package='*',$ensure='present') {}",
] }
-# %w( soledad-server soledad-client soledad-common leap-keymanager leap-auth).each do | package |
- #it { should contain_apt__preferences_snippet("#{package}").with_pin('release o=pixelated')}
- #end
+ describe 'pixelated packages' do
+ it { should contain_apt__preferences_snippet("pixelated").with_pin('origin "packages.pixelated-project.org"')}
+ it { should contain_apt__preferences_snippet("pixelated").with_priority('1000')}
+ end
+
+ %w( soledad-server soledad-client soledad-common leap-keymanager leap-auth).each do | file |
+ it { should contain_file("/etc/apt/preferences.d/#{file}").with_ensure('absent')}
+ end
- # %w( python-urllib3 python-requests python-six).each do | package |
- #it { should contain_apt__preferences_snippet("#{package}").with_release(/jessie/) }
- #end
+ %w( python-urllib3 python-requests python-six).each do | package |
+ it { should contain_apt__preferences_snippet("#{package}").with_release(/jessie/) }
+ end
end
diff --git a/files/puppet/modules/pixelated/spec/classes/apt_spec.rb b/files/puppet/modules/pixelated/spec/classes/apt_spec.rb
index df5c33f..7fe995a 100644
--- a/files/puppet/modules/pixelated/spec/classes/apt_spec.rb
+++ b/files/puppet/modules/pixelated/spec/classes/apt_spec.rb
@@ -5,6 +5,7 @@ describe 'pixelated::apt' do
{
:operatingsystem => 'Debian',
:lsbdistid => 'Debian',
+ :domain => 'default',
:lsbdistcodename => 'jessie',
}
end
@@ -14,8 +15,32 @@ describe 'pixelated::apt' do
"define apt::sources_list($content='deb url') {}",
] }
- it { should contain_apt__sources_list('pixelated.list') }
+ it { should contain_apt__sources_list('pixelated.list').
+ with_content("deb [arch=amd64] http://packages.pixelated-project.org/debian jessie main\n") }
it { should contain_file('/srv/leap/0x287A1542472DC0E3_packages@pixelated-project.org.asc') }
it { should contain_exec('add_pixelated_key') }
+ context 'staging' do
+ let(:facts) do
+ {
+ :domain => 'staging.pixelated-project.org',
+ :lsbdistcodename => 'jessie',
+ }
+ end
+
+ it { should contain_apt__sources_list('pixelated.list').
+ with_content("deb [arch=amd64] http://packages.pixelated-project.org/debian jessie-snapshots main\n") }
+ end
+
+ context 'unstable' do
+ let(:facts) do
+ {
+ :domain => 'unstable.pixelated-project.org',
+ :lsbdistcodename => 'jessie',
+ }
+ end
+
+ it { should contain_apt__sources_list('pixelated.list').
+ with_content("deb [arch=amd64] http://packages.pixelated-project.org/debian jessie-snapshots main\n") }
+ end
end
diff --git a/files/puppet/modules/pixelated/spec/classes/pixelated_spec.rb b/files/puppet/modules/pixelated/spec/classes/pixelated_spec.rb
index b24f721..4d9386e 100644
--- a/files/puppet/modules/pixelated/spec/classes/pixelated_spec.rb
+++ b/files/puppet/modules/pixelated/spec/classes/pixelated_spec.rb
@@ -21,7 +21,7 @@ describe 'pixelated' do
"define apache::vhost::file($content,$mod_security) {}",
"define apt::sources_list($content='deb url') {}",
"define apt::apt_conf($source='file url',$refresh_apt='true') {}",
- "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian') {}",
+ "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian',$package='*',$ensure='present') {}",
] }
it { should contain_class('pixelated::agent') }
diff --git a/files/puppet/modules/pixelated/spec/classes/syslog_spec.rb b/files/puppet/modules/pixelated/spec/classes/syslog_spec.rb
index f1b98a4..b4aacbf 100644
--- a/files/puppet/modules/pixelated/spec/classes/syslog_spec.rb
+++ b/files/puppet/modules/pixelated/spec/classes/syslog_spec.rb
@@ -15,7 +15,7 @@ describe 'pixelated::syslog' do
"define apache::vhost::file($content,$mod_security) {}",
"define apt::sources_list($content='deb url') {}",
"define apt::apt_conf($source='file url') {}",
- "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian') {}",
+ "define apt::preferences_snippet($release='stable',$priority='999',$pin='release o=Debian',$package='*',$ensure='present') {}",
] }