Skip to content

Commit

Permalink
Add tests for RPM GPG KEY.
Browse files Browse the repository at this point in the history
  • Loading branch information
yevtushenko committed Oct 19, 2016
1 parent ac9002c commit 2b3e150
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,72 @@
it { should contain_yumrepo('zabbix-nonsupported').with_baseurl('http://repo.zabbix.com/non-supported/rhel/6/$basearch/') }
end

context 'on RedHat 6 and Zabbix 3.0' do
let :params do
{
zabbix_version: '3.0',
manage_repo: true
}
end

let :facts do
{
:operatingsystem => 'RedHat',
:operatingsystemrelease => '6',
:operatingsystemmajrelease => '6',
:architecture => 'x86_64',
:osfamily => 'RedHat',
:$majorrelease => '6',
:is_pe => false,
:puppetversion => Puppet.version,
:facterversion => Facter.version,
:ipaddress => '192.168.1.10',
:lsbdistcodename => '',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin'
}
end

it { should contain_yumrepo('zabbix').with_baseurl('http://repo.zabbix.com/zabbix/3.0/rhel/6/$basearch/') }
it { should contain_yumrepo('zabbix').with_gpgkey('http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX') }
it { should contain_yumrepo('zabbix-nonsupported').with_baseurl('http://repo.zabbix.com/non-supported/rhel/6/$basearch/') }
it { should contain_yumrepo('zabbix-nonsupported').with_gpgkey('http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX') }
end

context 'on RedHat 6 and Zabbix 3.2' do
let :params do
{
zabbix_version: '3.2',
manage_repo: true
}
end

let :facts do
{
:operatingsystem => 'RedHat',
:operatingsystemrelease => '6',
:operatingsystemmajrelease => '6',
:architecture => 'x86_64',
:osfamily => 'RedHat',
:$majorrelease => '6',
:is_pe => false,
:puppetversion => Puppet.version,
:facterversion => Facter.version,
:ipaddress => '192.168.1.10',
:lsbdistcodename => '',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin'
}
end

it { should contain_yumrepo('zabbix').with_baseurl('http://repo.zabbix.com/zabbix/3.2/rhel/6/$basearch/') }
it { should contain_yumrepo('zabbix').with_gpgkey('http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') }
it { should contain_yumrepo('zabbix-nonsupported').with_baseurl('http://repo.zabbix.com/non-supported/rhel/6/$basearch/') }
it { should contain_yumrepo('zabbix-nonsupported').with_gpgkey('http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') }
end

context 'on RedHat 7 and Zabbix 3.0' do
let :params do
{
Expand Down Expand Up @@ -454,6 +520,41 @@
end

it { should contain_yumrepo('zabbix').with_baseurl('http://repo.zabbix.com/zabbix/3.0/rhel/7/$basearch/') }
it { should contain_yumrepo('zabbix').with_gpgkey('http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX') }
it { should contain_yumrepo('zabbix-nonsupported').with_baseurl('http://repo.zabbix.com/non-supported/rhel/7/$basearch/') }
it { should contain_yumrepo('zabbix-nonsupported').with_gpgkey('http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX') }
end

context 'on RedHat 7 and Zabbix 3.2' do
let :params do
{
zabbix_version: '3.2',
manage_repo: true
}
end

let :facts do
{
:operatingsystem => 'RedHat',
:operatingsystemrelease => '7.1',
:operatingsystemmajrelease => '7',
:architecture => 'x86_64',
:osfamily => 'RedHat',
:$majorrelease => '7',
:is_pe => false,
:puppetversion => Puppet.version,
:facterversion => Facter.version,
:ipaddress => '192.168.1.10',
:lsbdistcodename => '',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin'
}
end

it { should contain_yumrepo('zabbix').with_baseurl('http://repo.zabbix.com/zabbix/3.2/rhel/7/$basearch/') }
it { should contain_yumrepo('zabbix').with_gpgkey('http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') }
it { should contain_yumrepo('zabbix-nonsupported').with_baseurl('http://repo.zabbix.com/non-supported/rhel/7/$basearch/') }
it { should contain_yumrepo('zabbix-nonsupported').with_gpgkey('http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') }
end
end

0 comments on commit 2b3e150

Please sign in to comment.